Index: sasmodels/__init__.py
===================================================================
--- sasmodels/__init__.py	(revision 997c9ca708691a03cea900f570d852c2dc1ea859)
+++ sasmodels/__init__.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -47,4 +47,2 @@
         ]
     return return_list
-
-
Index: sasmodels/compare.py
===================================================================
--- sasmodels/compare.py	(revision 110f69cfa1143196495c76df1d5cff08c6ce884e)
+++ sasmodels/compare.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -944,5 +944,5 @@
     # work with trimmed data, not the full set
     sorted_err = np.sort(abs(err.compressed()))
-    if len(sorted_err) == 0.:
+    if len(sorted_err) == 0:
         print(label + "  no valid values")
         return
@@ -1081,6 +1081,6 @@
     ]
 
-NAME_OPTIONS = set(k for k in OPTIONS if not k.endswith('='))
-VALUE_OPTIONS = [k[:-1] for k in OPTIONS if k.endswith('=')]
+NAME_OPTIONS = (lambda: set(k for k in OPTIONS if not k.endswith('=')))()
+VALUE_OPTIONS = (lambda: [k[:-1] for k in OPTIONS if k.endswith('=')])()
 
 
@@ -1174,5 +1174,5 @@
     name = positional_args[-1]
 
-    # pylint: disable=bad-whitespace
+    # pylint: disable=bad-whitespace,C0321
     # Interpret the flags
     opts = {
@@ -1265,5 +1265,5 @@
         elif arg == '-html':    opts['html'] = True
         elif arg == '-help':    opts['html'] = True
-    # pylint: enable=bad-whitespace
+    # pylint: enable=bad-whitespace,C0321
 
     # Magnetism forces 2D for now
@@ -1464,5 +1464,4 @@
     show html docs for the model
     """
-    import os
     from .generate import make_html
     from . import rst2html
@@ -1499,5 +1498,6 @@
         signal.update_parameters(problem)
     frame.Bind(wx.EVT_TOOL, _reset_parameters, frame.ToolBar.GetToolByPos(1))
-    if is_mac: frame.Show()
+    if is_mac:
+        frame.Show()
     # If running withing an app, start the main loop
     if app:
Index: sasmodels/conversion_table.py
===================================================================
--- sasmodels/conversion_table.py	(revision 505d0ad271ca5da4aec3e6cd06d4f0019716da3c)
+++ sasmodels/conversion_table.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -29,850 +29,850 @@
 
 CONVERSION_TABLE = {
-    (3,1,2) : {
-    "adsorbed_layer": [
-        "Core2ndMomentModel",
-        {
-            "scale": "scale",
-            "second_moment": "second_moment",
-            "density_shell": "density_poly",
-            "sld_solvent": "sld_solv",
-            "radius": "radius_core",
-            "volfraction": "volf_cores",
-            "background": "background",
-            "adsorbed_amount": "ads_amount",
-            "sld_shell": "sld_poly"
-        }
-    ],
-    "barbell": [
-        "BarBellModel",
-        {
-            "sld": "sld_barbell",
-            "length": "len_bar",
-            "radius_bell": "rad_bell",
-            "radius": "rad_bar",
-            "sld_solvent": "sld_solv"
-        }
-    ],
-    "bcc_paracrystal": [
-        "BCCrystalModel",
-        {
-            "sld": "sldSph",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "be_polyelectrolyte": [
-        "BEPolyelectrolyte",
-        {
-            "ionization_degree": "alpha",
-            "polymer_concentration": "c",
-            "salt_concentration": "cs",
-            "virial_param": "h",
-            "background": "background",
-            "contrast_factor": "k",
-            "bjerrum_length": "lb",
-            "monomer_length": "b"
-        }
-    ],
-    "binary_hard_sphere": [
-        "BinaryHSModel",
-        {
-            "sld_sm": "ss_sld",
-            "sld_lg": "ls_sld",
-            "volfraction_sm": "vol_frac_ss",
-            "radius_lg": "l_radius",
-            "radius_sm": "s_radius",
-            "volfraction_lg": "vol_frac_ls",
-            "sld_solvent": "solvent_sld"
-        }
-    ],
-    "broad_peak": [
-        "BroadPeakModel",
-        {
-            "peak_pos": "q_peak",
-            "scale": None,
-            "lorentz_length": "length_l",
-            "porod_scale": "scale_p",
-            "lorentz_exp": "exponent_l",
-            "lorentz_scale": "scale_l",
-            "porod_exp": "exponent_p"
-        }
-    ],
-    "capped_cylinder": [
-        "CappedCylinderModel",
-        {
-            "sld": "sld_capcyl",
-            "length": "len_cyl",
-            "radius_cap": "rad_cap",
-            "radius": "rad_cyl",
-            "sld_solvent": "sld_solv"
-        }
-    ],
-    "core_multi_shell": [
-        "CoreMultiShellModel",
-        {
-            "thickness": "thick_shell",
-            "sld": "sld_shell",
-            "radius": "rad_core0",
-            "sld_core": "sld_core0",
-            "sld_solvent": "sld_solv",
-            "n": "n_shells",
-            "M0:sld_core": "M0_sld_core0",
-            "mtheta:sld_core": "M_theta_core0",
-            "mphi:sld_core": "M_phi_core0",
-            "M0:sld1": "M0_sld_shell1",
-            "mtheta:sld1": "M_theta_shell1",
-            "mphi:sld1": "M_phi_shell1",
-            "M0:sld2": "M0_sld_shell2",
-            "mtheta:sld2": "M_theta_shell2",
-            "mphi:sld2": "M_phi_shell2",
-            "M0:sld3": "M0_sld_shell3",
-            "mtheta:sld3": "M_theta_shell3",
-            "mphi:sld3": "M_phi_shell3",
-            "M0:sld4": "M0_sld_shell4",
-            "mtheta:sld4": "M_theta_shell4",
-            "mphi:sld4": "M_phi_shell4",
-            "M0:sld_solvent": "M0_sld_solv",
-            "mtheta:sld_solvent": "M_theta_solv",
-            "mphi:sld_solvent": "M_phi_solv",
-            "up:frac_i": "Up_frac_i",
-            "up:frac_f": "Up_frac_f",
-            "up:angle": "Up_theta",
-        }
-    ],
-    "core_shell_bicelle": [
-        "CoreShellBicelleModel",
-        {
-            "phi": "axis_phi",
-            "sld_core": "core_sld",
-            "sld_rim": "rim_sld",
-            "thick_face": "face_thick",
-            "sld_solvent": "solvent_sld",
-            "thick_rim": "rim_thick",
-            "sld_face": "face_sld",
-            "theta": "axis_theta"
-        }
-    ],
-    "core_shell_cylinder": [
-        "CoreShellCylinderModel",
-        {
-            "theta": "axis_theta",
-            "phi": "axis_phi",
-            "sld_shell": "shell_sld",
-            "sld_solvent": "solvent_sld",
-            "sld_core": "core_sld"
-        }
-    ],
-    "core_shell_ellipsoid:1": [
-        "CoreShellEllipsoidModel",
-        {
-            "sld_core": "sld_core",
-            "sld_shell": "sld_shell",
-            "sld_solvent": "sld_solvent",
-            "radius_equat_core": "equat_core",
-            "x_core": "polar_core",
-            "thick_shell": "equat_shell",
-            "x_polar_shell": "polar_shell",
-            "theta": "axis_theta",
-            "phi": "axis_phi",
-        }
-    ],
-    "core_shell_ellipsoid": [
-        "CoreShellEllipsoidXTModel",
-        {
-            "sld_core": "sld_core",
-            "sld_shell": "sld_shell",
-            "sld_solvent": "sld_solvent",
-            "radius_equat_core": "equat_core",
-            "thick_shell": "T_shell",
-            "x_core": "X_core",
-            "x_polar_shell": "XpolarShell",
-            "theta": "axis_theta",
-            "phi": "axis_phi",
-        }
-    ],
-    "core_shell_parallelepiped": [
-        "CSParallelepipedModel",
-        {
-            "sld_core": "sld_pcore",
-            "sld_a": "sld_rimA",
-            "sld_b": "sld_rimB",
-            "sld_c": "sld_rimC",
-            "sld_solvent": "sld_solv",
-            "length_a": "shortA",
-            "length_b": "midB",
-            "length_c": "longC",
-            "thick_rim_a": "rimA",
-            "thick_rim_c": "rimC",
-            "thick_rim_b": "rimB",
-            "theta": "parallel_theta",
-            "phi": "parallel_phi",
-            "psi": "parallel_psi",
-        }
-    ],
-    "core_shell_sphere": [
-        "CoreShellModel",
-        {
-            "sld_core": "core_sld",
-            "sld_shell": "shell_sld",
-            "sld_solvent": "solvent_sld",
-            "M0:sld_core": "M0_sld_core",
-            "mtheta:sld_core": "M_theta_core",
-            "mphi:sld_core": "M_phi_core",
-            "M0:sld_shell": "M0_sld_shell",
-            "mtheta:sld_shell": "M_theta_shell",
-            "mphi:sld_shell": "M_phi_shell",
-            "M0:sld_solvent": "M0_sld_solv",
-            "mtheta:sld_solvent": "M_theta_solv",
-            "mphi:sld_solvent": "M_phi_solv",
-            "up:frac_i": "Up_frac_i",
-            "up:frac_f": "Up_frac_f",
-            "up:angle": "Up_theta"
-        }
-    ],
-    "correlation_length": [
-        "CorrLength",
-        {
-            "porod_scale": "scale_p",
-            "lorentz_scale": "scale_l",
-            "porod_exp": "exponent_p",
-            "lorentz_exp": "exponent_l",
-            "cor_length": "length_l"
-        },
-        "CorrLengthModel"
-    ],
-    "cylinder": [
-        "CylinderModel",
-        {
-            "sld": "sldCyl",
-            "theta": "cyl_theta",
-            "phi": "cyl_phi",
-            "sld_solvent": "sldSolv",
-            "M0:sld": "M0_sld_cyl",
-            "mtheta:sld": "M_theta_cyl",
-            "mphi:sld": "M_phi_cyl",
-            "M0:sld_solvent": "M0_sld_solv",
-            "mtheta:sld_solvent": "M_theta_solv",
-            "mphi:sld_solvent": "M_phi_solv",
-            "up:frac_i": "Up_frac_i",
-            "up:frac_f": "Up_frac_f",
-            "up:angle": "Up_theta"
-        }
-    ],
-    "dab": [
-        "DABModel",
-        {
-            "cor_length": "length"
-        }
-    ],
-    "ellipsoid": [
-        "EllipsoidModel",
-        {
-            "phi": "axis_phi",
-            "radius_equatorial": "radius_b",
-            "sld": "sldEll",
-            "theta": "axis_theta",
-            "radius_polar": "radius_a",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "elliptical_cylinder": [
-        "EllipticalCylinderModel",
-        {
-            "axis_ratio": "r_ratio",
-            "radius_minor": "r_minor",
-            "sld": "sldCyl",
-            "sld_solvent": "sldSolv",
-            "theta": "cyl_theta",
-            "phi": "cyl_phi",
-            "psi": "cyl_psi",
-        }
-    ],
-    "fcc_paracrystal": [
-        "FCCrystalModel",
-        {
-            "sld": "sldSph",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "flexible_cylinder": [
-        "FlexibleCylinderModel",
-        {
-            "sld": "sldCyl",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "flexible_cylinder_elliptical": [
-        "FlexCylEllipXModel",
-        {
-            "sld": "sldCyl",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "fractal": [
-        "FractalModel",
-        {
-            "sld_block": "sldBlock",
-            "radius": "radius",
-            "cor_length": "cor_length",
-            "sld_solvent": "sldSolv",
-            "fractal_dim": "fractal_dim"
-        }
-    ],
-    "fractal_core_shell": [
-        "FractalCoreShell",
-        {
-            "sld_core": "core_sld",
-            "sld_shell": "shell_sld",
-            "sld_solvent": "solvent_sld",
-            "radius": "radius",
-            "thickness": "thickness",
-            "fractal_dim": "frac_dim",
-            "cor_length": "cor_length",
-            "volfraction": "volfraction",
-        },
-        "FractalCoreShellModel"
-    ],
-    "fuzzy_sphere": [
-        "FuzzySphereModel",
-        {
-            "sld": "sldSph",
-            "fuzziness": "fuzziness",
-            "radius": "radius",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "gauss_lorentz_gel": [
-        "GaussLorentzGel",
-        {
-            "gauss_scale": "scale_g",
-            "cor_length_dynamic": "dyn_colength",
-            "cor_length_static": "stat_colength",
-            "background": "background",
-            "lorentz_scale": "scale_l"
-        },
-        "GaussLorentzGelModel"
-    ],
-    "gaussian_peak": [
-        "Peak Gauss Model",
-        {
-            "peak_pos": "q0",
-            "sigma": "B",
-        },
-        "PeakGaussModel",
-    ],
-    "gel_fit": [
-        "GelFitModel",
-        {
-            "rg": "radius",
-            "lorentz_scale": "lScale",
-            "guinier_scale": "gScale",
-            "fractal_dim": "FractalExp",
-            "cor_length": "zeta",
-        }
-    ],
-    "guinier": [
-        "Guinier",
-        {
-            "rg": "rg"
-        },
-        "GuinierModel",
-    ],
-    "guinier_porod": [
-        "GuinierPorod",
-        {
-            "s": "dim",
-            "rg": "rg",
-            "porod_exp": "m",
-            "scale": "scale",
-            "background": "background"
-        },
-        "GuinierPorodModel",
-    ],
-    "hardsphere": [
-        "HardsphereStructure",
-        {
-            "scale": "scale_factor",
-            "radius_effective": "effect_radius",
-        }
-    ],
-    "hayter_msa": [
-        "HayterMSAStructure",
-        {
-            "scale": "scale_factor",
-            "radius_effective": "effect_radius",
-            "volfraction": "volfraction",
-            "charge": "charge",
-            "temperature": "temperature",
-            "concentration_salt": "saltconc",
-            "dielectconst": "dielectconst",
-        }
-    ],
-    "hollow_cylinder": [
-        "HollowCylinderModel",
-        {
-            "sld": "sldCyl",
-            "sld_solvent": "sldSolv",
-            "radius": "core_radius",
-            "thickness": "radius",
-            "length": "length",
-            "theta": "axis_theta",
-            "phi": "axis_phi",
-        }
-    ],
-    "hollow_rectangular_prism": [
-        "RectangularHollowPrismModel",
-        {
-            "sld": "sldPipe",
-            "sld_solvent": "sldSolv",
-            "length_a": "short_side",
-            "b2a_ratio": "b2a_ratio",
-            "c2a_ratio": "c2a_ratio",
-            "thickness": "thickness",
-        }
-    ],
-    "hollow_rectangular_prism_thin_walls": [
-        "RectangularHollowPrismInfThinWallsModel",
-        {
-            "sld": "sldPipe",
-            "sld_solvent": "sldSolv",
-            "length_a": "short_side",
-            "b2a_ratio": "b2a_ratio",
-            "c2a_ratio": "c2a_ratio",
-        }
-    ],
-    "lamellar": [
-        "LamellarModel",
-        {
-            "sld": "sld_bi",
-            "sld_solvent": "sld_sol",
-            "thickness": "bi_thick"
-        }
-    ],
-    "lamellar_hg": [
-        "LamellarFFHGModel",
-        {
-            "sld": "sld_tail",
-            "sld_solvent": "sld_solvent",
-            "sld_head": "sld_head",
-            "length_tail": "t_length",
-            "length_head": "h_thickness"
-        }
-    ],
-    "lamellar_hg_stack_caille": [
-        "LamellarPSHGModel",
-        {
-            "sld": "sld_tail",
-            "sld_head": "sld_head",
-            "sld_solvent": "sld_solvent",
-            "length_tail": "deltaT",
-            "length_head": "deltaH",
-            "d_spacing": "spacing",
-            "Caille_parameter": "caille",
-            "Nlayers": "n_plates",
-        }
-    ],
-    "lamellar_stack_caille": [
-        "LamellarPSModel",
-        {
-            "sld": "sld_bi",
-            "sld_solvent": "sld_sol",
-            "thickness": "delta",
-            "d_spacing": "spacing",
-            "Caille_parameter": "caille",
-            "Nlayers": "n_plates",
-        }
-    ],
-    "lamellar_stack_paracrystal": [
-        "LamellarPCrystalModel",
-        {
-            "sld": "sld_layer",
-            "sld_solvent": "sld_solvent",
-            "thickness": "thickness",
-            "d_spacing": "spacing",
-            "sigma_d": "pd_spacing",
-            "Nlayers": "Nlayers",
-        }
-    ],
-    "line": [
-        "LineModel",
-        {
-            "slope": "B",
-            "scale": None,
-            "background": None,
-            "intercept": "A"
-        }
-    ],
-    "linear_pearls": [
-        "LinearPearlsModel",
-        {
-            "sld": "sld_pearl",
-            "sld_solvent": "sld_solv",
-            "edge_sep": "edge_separation"
-        }
-    ],
-    "lorentz": [
-        "Lorentz",
-        {
-            "cor_length": "length"
-        },
-        "LorentzModel",
-    ],
-    "mass_fractal": [
-        "MassFractalModel",
-        {
-            "cutoff_length": "co_length",
-            "radius": "radius",
-            "fractal_dim_mass": "mass_dim"
-        }
-    ],
-    "mass_surface_fractal": [
-        "MassSurfaceFractal",
-        {
-            "rg_cluster": "cluster_rg",
-            "fractal_dim_mass": "mass_dim",
-            "radius": "radius",
-            "fractal_dim_surf": "surface_dim",
-            "rg_primary": "primary_rg"
-        }
-    ],
-    "mono_gauss_coil": [
-        "Debye",
-        {
-            "rg": "rg",
-            "i_zero": "scale",
-            "background": "background",
-        },
-        "DebyeModel",
-    ],
-    "multilayer_vesicle": [
-        "MultiShellModel",
-        {
-            "radius": "core_radius",
-            "sld_solvent": "core_sld",
-            "n_shells": "n_pairs",
-            "thick_shell": "s_thickness",
-            "sld": "shell_sld",
-            "thick_solvent": "w_thickness",
-        }
-    ],
-    "onion": [
-        "OnionExpShellModel",
-        {
-            "n_shells": "n_shells",
-            "A": "A_shell",
-            "sld_core": "sld_core0",
-            "radius_core": "rad_core0",
-            "sld_solvent": "sld_solv",
-            "thickness": "thick_shell",
-            "sld_in": "sld_in_shell",
-            "sld_out": "sld_out_shell"
-        }
-    ],
-    "parallelepiped": [
-        "ParallelepipedModel",
-        {
-            "phi": "parallel_phi",
-            "psi": "parallel_psi",
-            "sld_solvent": "sldSolv",
-            "length_a": "short_a",
-            "length_b": "short_b",
-            "sld": "sldPipe",
-            "theta": "parallel_theta",
-            "length_c": "long_c",
-            "M0:sld": "M0_sld_pipe",
-            "mtheta:sld": "M_theta_pipe",
-            "mphi:sld": "M_phi_pipe",
-            "M0:sld_solvent": "M0_sld_solv",
-            "mtheta:sld_solvent": "M_theta_solv",
-            "mphi:sld_solvent": "M_phi_solv",
-            "up:frac_i": "Up_frac_i",
-            "up:frac_f": "Up_frac_f",
-            "up:angle": "Up_theta",
-        }
-    ],
-    "peak_lorentz": [
-        "Peak Lorentz Model",
-        {
-            "peak_pos": "q0",
-            "peak_hwhm": "B"
-        },
-        "PeakLorentzModel",
-    ],
-    "pearl_necklace": [
-        "PearlNecklaceModel",
-        {
-            "scale": "scale",
-            "thick_string": "thick_string",
-            "sld_string": "sld_string",
-            "sld_solvent": "sld_solv",
-            "edge_sep": "edge_separation",
-            "num_pearls": "num_pearls",
-            "radius": "radius",
-            "background": "background",
-            "sld": "sld_pearl"
-        }
-    ],
-    "poly_gauss_coil": [
-        "Poly_GaussCoil",
-        {
-            "rg": "rg",
-            "polydispersity": "poly_m",
-            "i_zero": "scale",
-            "background": "background",
-        }
-    ],
-    "polymer_excl_volume": [
-        "PolymerExclVolume",
-        {
-            "rg": "rg",
-            "scale": "scale",
-            "background": "background",
-            "porod_exp": "m"
-        }
-    ],
-    "polymer_micelle": [
-        "MicelleSphCoreModel",
-        {
-            "sld_corona": "rho_corona",
-            "sld_solvent": "rho_solv",
-            "sld_core": "rho_core",
-            "ndensity": "ndensity",
-            "v_core": "v_core",
-            "v_corona": "v_corona",
-            "radius_core": "radius_core",
-            "rg": "radius_gyr",
-            "d_penetration": "d_penetration",
-            "n_aggreg": "n_aggreg",
-        }
-    ],
-    "porod": [
-        "PorodModel",
-        {
-            "scale": "scale",
-            "background": "background"
-        }
-    ],
-    "power_law": [
-        "PowerLawAbsModel",
-        {
-            "scale": "scale",
-            "background": "background",
-            "power": "m"
-        }
-    ],
-    "pringle": [
-        "PringlesModel",
-        {
-            "scale": "scale",
-            "sld_solvent": "sld_solvent",
-            "thickness": "thickness",
-            "beta": "beta",
-            "radius": "radius",
-            "background": "background",
-            "alpha": "alpha",
-            "sld": "sld_pringle"
-        }
-    ],
-    "raspberry": [
-        "RaspBerryModel",
-        {
-            "volfraction_lg": "volf_Lsph",
-            "volfraction_sm": "volf_Ssph",
-            "radius_sm": "radius_Ssph",
-            "radius_lg": "radius_Lsph",
-            "sld_lg": "sld_Lsph",
-            "sld_sm": "sld_Ssph",
-            "sld_solvent": "sld_solv",
-            "surface_fraction": "surfrac_Ssph",
-            "penetration": "delta_Ssph"
-        }
-    ],
-    "rectangular_prism": [
-        "RectangularPrismModel",
-        {
-            "sld": "sldPipe",
-            "length_a": "short_side",
-            "b2a_ratio": "b2a_ratio",
-            "c2a_ratio": "c2a_ratio",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "rpa": [
-        "RPA10Model",
-        {
-            "K12": "Kab", "K13": "Kac", "K14": "Kad",
-            "K23": "Kbc", "K24": "Kbd", "K34": "Kcd",
-            "N1": "Na", "N2": "Nb", "N3": "Nc", "N4": "Nd",
-            "L1": "La", "L2": "Lb", "L3": "Lc", "L4": "Ld",
-            "v1": "va", "v2": "vb", "v3": "vc", "v4": "vd",
-            "b1": "ba", "b2": "bb", "b3": "bc", "b4": "bd",
-            "Phi1": "Phia", "Phi2": "Phib", "Phi3": "Phic", "Phi4": "Phid",
-            "case_num": "lcase_n"
-        }
-    ],
-    "sc_paracrystal": [
-        "SCCrystalModel",
-        {
-            "sld": "sldSph",
-            "sld_solvent": "sldSolv"
-        }
-    ],
-    "sphere": [
-        "SphereModel",
-        {
-            "sld": "sldSph",
-            "radius": "radius",
-            "sld_solvent": "sldSolv",
-            "M0:sld": "M0_sld_sph",
-            "mtheta:sld": "M_theta_sph",
-            "mphi:sld": "M_phi_sph",
-            "M0:sld_solvent": "M0_sld_solv",
-            "mtheta:sld_solvent": "M_theta_solv",
-            "mphi:sld_solvent": "M_phi_solv",
-            "up:frac_i": "Up_frac_i",
-            "up:frac_f": "Up_frac_f",
-            "up:angle": "Up_theta"
-        }
-    ],
-    "spherical_sld": [
-        "SphericalSLDModel",
-        # Be lazy and use a generator expression to define
-        #    sld1: sld_flat0, ...
-        #    thickness1: thick_flat0, ...
-        #    interface1: thick_inter0, ...
-        #    shape1: func_inter0, ...
-        #    nu1: nu_inter0, ...
-        # but override thickness1 => rad_cor0 and sld1 => sld_core0.
-        # Note: explicit key,value pairs given by **{...} override the
-        # keys from the gnerator expression ((k,v) for k,v in seq) when
-        # used as dict((generator), **{...})
-        dict(((field_new+str(index+1), field_old+str(index))
-              for field_new, field_old in [("sld", "sld_flat"),
-                                           ("thickness", "thick_flat"),
-                                           ("interface", "thick_inter"),
-                                           ("shape", "func_inter"),
-                                           ("nu", "nu_inter"),]
-              for index in range(11)),
-             **{
-                   "n_shells": "n_shells",
-                   "n_steps": "npts_inter",
-                   "sld_solvent": "sld_solv",
-                   "thickness1": "rad_core0",
-                   "sld1": "sld_core0",
-               })
-    ],
-    "squarewell": [
-        "SquareWellStructure",
-        {
-            "scale": "scale_factor",
-            "radius_effective": "effect_radius",
-            "wellwidth": "wellwidth",
-            "welldepth": "welldepth",
-        }
-    ],
-    "stacked_disks": [
-        "StackedDisksModel",
-        {
-            "phi": "axis_phi",
-            "sld_layer": "layer_sld",
-            "sld_core": "core_sld",
-            "theta": "axis_theta",
-            "sld_solvent": "solvent_sld",
-            "n_stacking": "n_stacking",
-            "thick_layer": "layer_thick",
-            "thick_core": "core_thick",
-        }
-    ],
-    "star_polymer": [
-        "StarPolymer",
-        {
-            "arms": "arms",
-            "rg_squared": "R2"
-        }
-    ],
-    "stickyhardsphere": [
-        "StickyHSStructure",
-        {
-            "scale": "scale_factor",
-            "radius_effective": "effect_radius",
-        }
-    ],
-    "surface_fractal": [
-        "SurfaceFractalModel",
-        {
-            "cutoff_length": "co_length",
-            "radius": "radius",
-            "fractal_dim_surf": "surface_dim"
-        }
-    ],
-    "teubner_strey": [
-        "TeubnerStreyModel",
-        {
-            # Note: parameters are completely rewritten in convert.py
-            "volfraction_a": "volfraction_a",
-            "sld_a": "sld_a",
-            "sld_b": "sld_b",
-            "d": "d",
-            "xi": "xi",
-        }
-    ],
-    "triaxial_ellipsoid": [
-        "TriaxialEllipsoidModel",
-        {
-            "phi": "axis_phi",
-            "radius_equat_minor": "semi_axisA",
-            "radius_polar": "semi_axisC",
-            "radius_equat_major": "semi_axisB",
-            "sld_solvent": "sldSolv",
-            "psi": "axis_psi",
-            "sld": "sldEll",
-            "theta": "axis_theta"
-        }
-    ],
-    "two_lorentzian": [
-        "TwoLorentzian",
-        {
-            "lorentz_scale_1": "scale_1",
-            "lorentz_scale_2": "scale_2",
-            "lorentz_exp_1": "exponent_1",
-            "lorentz_exp_2": "exponent_2",
-            "lorentz_length_2": "length_2",
-            "lorentz_length_1": "length_1",
-            "background": "background"
-        },
-        "TwoLorentzianModel",
-    ],
-    "two_power_law": [
-        "TwoPowerLaw",
-        {
-            "coefficent_1": "coef_A",
-            "power_2": "power2",
-            "power_1": "power1",
-            "background": "background",
-            "crossover": "qc"
-        },
-        "TwoPowerLawModel",
-    ],
-    "unified_power_Rg": [
-        "UnifiedPowerRg",
-        dict(((field_new+str(index), field_old+str(index))
-              for field_new, field_old in [("rg", "Rg"),
-                                           ("power", "power"),
-                                           ("G", "G"),
-                                           ("B", "B"),]
-              for index in range(11)),
-             **{
-                   "background": "background",
-                   "scale": "scale",
-               }),
-        "UnifiedPowerRgModel",
-    ],
-    "vesicle": [
-        "VesicleModel",
-        {
-            "sld": "shell_sld",
-            "sld_solvent": "solv_sld"
-        }
-    ]
+    (3, 1, 2) : {
+        "adsorbed_layer": [
+            "Core2ndMomentModel",
+            {
+                "scale": "scale",
+                "second_moment": "second_moment",
+                "density_shell": "density_poly",
+                "sld_solvent": "sld_solv",
+                "radius": "radius_core",
+                "volfraction": "volf_cores",
+                "background": "background",
+                "adsorbed_amount": "ads_amount",
+                "sld_shell": "sld_poly"
+            }
+        ],
+        "barbell": [
+            "BarBellModel",
+            {
+                "sld": "sld_barbell",
+                "length": "len_bar",
+                "radius_bell": "rad_bell",
+                "radius": "rad_bar",
+                "sld_solvent": "sld_solv"
+            }
+        ],
+        "bcc_paracrystal": [
+            "BCCrystalModel",
+            {
+                "sld": "sldSph",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "be_polyelectrolyte": [
+            "BEPolyelectrolyte",
+            {
+                "ionization_degree": "alpha",
+                "polymer_concentration": "c",
+                "salt_concentration": "cs",
+                "virial_param": "h",
+                "background": "background",
+                "contrast_factor": "k",
+                "bjerrum_length": "lb",
+                "monomer_length": "b"
+            }
+        ],
+        "binary_hard_sphere": [
+            "BinaryHSModel",
+            {
+                "sld_sm": "ss_sld",
+                "sld_lg": "ls_sld",
+                "volfraction_sm": "vol_frac_ss",
+                "radius_lg": "l_radius",
+                "radius_sm": "s_radius",
+                "volfraction_lg": "vol_frac_ls",
+                "sld_solvent": "solvent_sld"
+            }
+        ],
+        "broad_peak": [
+            "BroadPeakModel",
+            {
+                "peak_pos": "q_peak",
+                "scale": None,
+                "lorentz_length": "length_l",
+                "porod_scale": "scale_p",
+                "lorentz_exp": "exponent_l",
+                "lorentz_scale": "scale_l",
+                "porod_exp": "exponent_p"
+            }
+        ],
+        "capped_cylinder": [
+            "CappedCylinderModel",
+            {
+                "sld": "sld_capcyl",
+                "length": "len_cyl",
+                "radius_cap": "rad_cap",
+                "radius": "rad_cyl",
+                "sld_solvent": "sld_solv"
+            }
+        ],
+        "core_multi_shell": [
+            "CoreMultiShellModel",
+            {
+                "thickness": "thick_shell",
+                "sld": "sld_shell",
+                "radius": "rad_core0",
+                "sld_core": "sld_core0",
+                "sld_solvent": "sld_solv",
+                "n": "n_shells",
+                "M0:sld_core": "M0_sld_core0",
+                "mtheta:sld_core": "M_theta_core0",
+                "mphi:sld_core": "M_phi_core0",
+                "M0:sld1": "M0_sld_shell1",
+                "mtheta:sld1": "M_theta_shell1",
+                "mphi:sld1": "M_phi_shell1",
+                "M0:sld2": "M0_sld_shell2",
+                "mtheta:sld2": "M_theta_shell2",
+                "mphi:sld2": "M_phi_shell2",
+                "M0:sld3": "M0_sld_shell3",
+                "mtheta:sld3": "M_theta_shell3",
+                "mphi:sld3": "M_phi_shell3",
+                "M0:sld4": "M0_sld_shell4",
+                "mtheta:sld4": "M_theta_shell4",
+                "mphi:sld4": "M_phi_shell4",
+                "M0:sld_solvent": "M0_sld_solv",
+                "mtheta:sld_solvent": "M_theta_solv",
+                "mphi:sld_solvent": "M_phi_solv",
+                "up:frac_i": "Up_frac_i",
+                "up:frac_f": "Up_frac_f",
+                "up:angle": "Up_theta",
+            }
+        ],
+        "core_shell_bicelle": [
+            "CoreShellBicelleModel",
+            {
+                "phi": "axis_phi",
+                "sld_core": "core_sld",
+                "sld_rim": "rim_sld",
+                "thick_face": "face_thick",
+                "sld_solvent": "solvent_sld",
+                "thick_rim": "rim_thick",
+                "sld_face": "face_sld",
+                "theta": "axis_theta"
+            }
+        ],
+        "core_shell_cylinder": [
+            "CoreShellCylinderModel",
+            {
+                "theta": "axis_theta",
+                "phi": "axis_phi",
+                "sld_shell": "shell_sld",
+                "sld_solvent": "solvent_sld",
+                "sld_core": "core_sld"
+            }
+        ],
+        "core_shell_ellipsoid:1": [
+            "CoreShellEllipsoidModel",
+            {
+                "sld_core": "sld_core",
+                "sld_shell": "sld_shell",
+                "sld_solvent": "sld_solvent",
+                "radius_equat_core": "equat_core",
+                "x_core": "polar_core",
+                "thick_shell": "equat_shell",
+                "x_polar_shell": "polar_shell",
+                "theta": "axis_theta",
+                "phi": "axis_phi",
+            }
+        ],
+        "core_shell_ellipsoid": [
+            "CoreShellEllipsoidXTModel",
+            {
+                "sld_core": "sld_core",
+                "sld_shell": "sld_shell",
+                "sld_solvent": "sld_solvent",
+                "radius_equat_core": "equat_core",
+                "thick_shell": "T_shell",
+                "x_core": "X_core",
+                "x_polar_shell": "XpolarShell",
+                "theta": "axis_theta",
+                "phi": "axis_phi",
+            }
+        ],
+        "core_shell_parallelepiped": [
+            "CSParallelepipedModel",
+            {
+                "sld_core": "sld_pcore",
+                "sld_a": "sld_rimA",
+                "sld_b": "sld_rimB",
+                "sld_c": "sld_rimC",
+                "sld_solvent": "sld_solv",
+                "length_a": "shortA",
+                "length_b": "midB",
+                "length_c": "longC",
+                "thick_rim_a": "rimA",
+                "thick_rim_c": "rimC",
+                "thick_rim_b": "rimB",
+                "theta": "parallel_theta",
+                "phi": "parallel_phi",
+                "psi": "parallel_psi",
+            }
+        ],
+        "core_shell_sphere": [
+            "CoreShellModel",
+            {
+                "sld_core": "core_sld",
+                "sld_shell": "shell_sld",
+                "sld_solvent": "solvent_sld",
+                "M0:sld_core": "M0_sld_core",
+                "mtheta:sld_core": "M_theta_core",
+                "mphi:sld_core": "M_phi_core",
+                "M0:sld_shell": "M0_sld_shell",
+                "mtheta:sld_shell": "M_theta_shell",
+                "mphi:sld_shell": "M_phi_shell",
+                "M0:sld_solvent": "M0_sld_solv",
+                "mtheta:sld_solvent": "M_theta_solv",
+                "mphi:sld_solvent": "M_phi_solv",
+                "up:frac_i": "Up_frac_i",
+                "up:frac_f": "Up_frac_f",
+                "up:angle": "Up_theta"
+            }
+        ],
+        "correlation_length": [
+            "CorrLength",
+            {
+                "porod_scale": "scale_p",
+                "lorentz_scale": "scale_l",
+                "porod_exp": "exponent_p",
+                "lorentz_exp": "exponent_l",
+                "cor_length": "length_l"
+            },
+            "CorrLengthModel"
+        ],
+        "cylinder": [
+            "CylinderModel",
+            {
+                "sld": "sldCyl",
+                "theta": "cyl_theta",
+                "phi": "cyl_phi",
+                "sld_solvent": "sldSolv",
+                "M0:sld": "M0_sld_cyl",
+                "mtheta:sld": "M_theta_cyl",
+                "mphi:sld": "M_phi_cyl",
+                "M0:sld_solvent": "M0_sld_solv",
+                "mtheta:sld_solvent": "M_theta_solv",
+                "mphi:sld_solvent": "M_phi_solv",
+                "up:frac_i": "Up_frac_i",
+                "up:frac_f": "Up_frac_f",
+                "up:angle": "Up_theta"
+            }
+        ],
+        "dab": [
+            "DABModel",
+            {
+                "cor_length": "length"
+            }
+        ],
+        "ellipsoid": [
+            "EllipsoidModel",
+            {
+                "phi": "axis_phi",
+                "radius_equatorial": "radius_b",
+                "sld": "sldEll",
+                "theta": "axis_theta",
+                "radius_polar": "radius_a",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "elliptical_cylinder": [
+            "EllipticalCylinderModel",
+            {
+                "axis_ratio": "r_ratio",
+                "radius_minor": "r_minor",
+                "sld": "sldCyl",
+                "sld_solvent": "sldSolv",
+                "theta": "cyl_theta",
+                "phi": "cyl_phi",
+                "psi": "cyl_psi",
+            }
+        ],
+        "fcc_paracrystal": [
+            "FCCrystalModel",
+            {
+                "sld": "sldSph",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "flexible_cylinder": [
+            "FlexibleCylinderModel",
+            {
+                "sld": "sldCyl",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "flexible_cylinder_elliptical": [
+            "FlexCylEllipXModel",
+            {
+                "sld": "sldCyl",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "fractal": [
+            "FractalModel",
+            {
+                "sld_block": "sldBlock",
+                "radius": "radius",
+                "cor_length": "cor_length",
+                "sld_solvent": "sldSolv",
+                "fractal_dim": "fractal_dim"
+            }
+        ],
+        "fractal_core_shell": [
+            "FractalCoreShell",
+            {
+                "sld_core": "core_sld",
+                "sld_shell": "shell_sld",
+                "sld_solvent": "solvent_sld",
+                "radius": "radius",
+                "thickness": "thickness",
+                "fractal_dim": "frac_dim",
+                "cor_length": "cor_length",
+                "volfraction": "volfraction",
+            },
+            "FractalCoreShellModel"
+        ],
+        "fuzzy_sphere": [
+            "FuzzySphereModel",
+            {
+                "sld": "sldSph",
+                "fuzziness": "fuzziness",
+                "radius": "radius",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "gauss_lorentz_gel": [
+            "GaussLorentzGel",
+            {
+                "gauss_scale": "scale_g",
+                "cor_length_dynamic": "dyn_colength",
+                "cor_length_static": "stat_colength",
+                "background": "background",
+                "lorentz_scale": "scale_l"
+            },
+            "GaussLorentzGelModel"
+        ],
+        "gaussian_peak": [
+            "Peak Gauss Model",
+            {
+                "peak_pos": "q0",
+                "sigma": "B",
+            },
+            "PeakGaussModel",
+        ],
+        "gel_fit": [
+            "GelFitModel",
+            {
+                "rg": "radius",
+                "lorentz_scale": "lScale",
+                "guinier_scale": "gScale",
+                "fractal_dim": "FractalExp",
+                "cor_length": "zeta",
+            }
+        ],
+        "guinier": [
+            "Guinier",
+            {
+                "rg": "rg"
+            },
+            "GuinierModel",
+        ],
+        "guinier_porod": [
+            "GuinierPorod",
+            {
+                "s": "dim",
+                "rg": "rg",
+                "porod_exp": "m",
+                "scale": "scale",
+                "background": "background"
+            },
+            "GuinierPorodModel",
+        ],
+        "hardsphere": [
+            "HardsphereStructure",
+            {
+                "scale": "scale_factor",
+                "radius_effective": "effect_radius",
+            }
+        ],
+        "hayter_msa": [
+            "HayterMSAStructure",
+            {
+                "scale": "scale_factor",
+                "radius_effective": "effect_radius",
+                "volfraction": "volfraction",
+                "charge": "charge",
+                "temperature": "temperature",
+                "concentration_salt": "saltconc",
+                "dielectconst": "dielectconst",
+            }
+        ],
+        "hollow_cylinder": [
+            "HollowCylinderModel",
+            {
+                "sld": "sldCyl",
+                "sld_solvent": "sldSolv",
+                "radius": "core_radius",
+                "thickness": "radius",
+                "length": "length",
+                "theta": "axis_theta",
+                "phi": "axis_phi",
+            }
+        ],
+        "hollow_rectangular_prism": [
+            "RectangularHollowPrismModel",
+            {
+                "sld": "sldPipe",
+                "sld_solvent": "sldSolv",
+                "length_a": "short_side",
+                "b2a_ratio": "b2a_ratio",
+                "c2a_ratio": "c2a_ratio",
+                "thickness": "thickness",
+            }
+        ],
+        "hollow_rectangular_prism_thin_walls": [
+            "RectangularHollowPrismInfThinWallsModel",
+            {
+                "sld": "sldPipe",
+                "sld_solvent": "sldSolv",
+                "length_a": "short_side",
+                "b2a_ratio": "b2a_ratio",
+                "c2a_ratio": "c2a_ratio",
+            }
+        ],
+        "lamellar": [
+            "LamellarModel",
+            {
+                "sld": "sld_bi",
+                "sld_solvent": "sld_sol",
+                "thickness": "bi_thick"
+            }
+        ],
+        "lamellar_hg": [
+            "LamellarFFHGModel",
+            {
+                "sld": "sld_tail",
+                "sld_solvent": "sld_solvent",
+                "sld_head": "sld_head",
+                "length_tail": "t_length",
+                "length_head": "h_thickness"
+            }
+        ],
+        "lamellar_hg_stack_caille": [
+            "LamellarPSHGModel",
+            {
+                "sld": "sld_tail",
+                "sld_head": "sld_head",
+                "sld_solvent": "sld_solvent",
+                "length_tail": "deltaT",
+                "length_head": "deltaH",
+                "d_spacing": "spacing",
+                "Caille_parameter": "caille",
+                "Nlayers": "n_plates",
+            }
+        ],
+        "lamellar_stack_caille": [
+            "LamellarPSModel",
+            {
+                "sld": "sld_bi",
+                "sld_solvent": "sld_sol",
+                "thickness": "delta",
+                "d_spacing": "spacing",
+                "Caille_parameter": "caille",
+                "Nlayers": "n_plates",
+            }
+        ],
+        "lamellar_stack_paracrystal": [
+            "LamellarPCrystalModel",
+            {
+                "sld": "sld_layer",
+                "sld_solvent": "sld_solvent",
+                "thickness": "thickness",
+                "d_spacing": "spacing",
+                "sigma_d": "pd_spacing",
+                "Nlayers": "Nlayers",
+            }
+        ],
+        "line": [
+            "LineModel",
+            {
+                "slope": "B",
+                "scale": None,
+                "background": None,
+                "intercept": "A"
+            }
+        ],
+        "linear_pearls": [
+            "LinearPearlsModel",
+            {
+                "sld": "sld_pearl",
+                "sld_solvent": "sld_solv",
+                "edge_sep": "edge_separation"
+            }
+        ],
+        "lorentz": [
+            "Lorentz",
+            {
+                "cor_length": "length"
+            },
+            "LorentzModel",
+        ],
+        "mass_fractal": [
+            "MassFractalModel",
+            {
+                "cutoff_length": "co_length",
+                "radius": "radius",
+                "fractal_dim_mass": "mass_dim"
+            }
+        ],
+        "mass_surface_fractal": [
+            "MassSurfaceFractal",
+            {
+                "rg_cluster": "cluster_rg",
+                "fractal_dim_mass": "mass_dim",
+                "radius": "radius",
+                "fractal_dim_surf": "surface_dim",
+                "rg_primary": "primary_rg"
+            }
+        ],
+        "mono_gauss_coil": [
+            "Debye",
+            {
+                "rg": "rg",
+                "i_zero": "scale",
+                "background": "background",
+            },
+            "DebyeModel",
+        ],
+        "multilayer_vesicle": [
+            "MultiShellModel",
+            {
+                "radius": "core_radius",
+                "sld_solvent": "core_sld",
+                "n_shells": "n_pairs",
+                "thick_shell": "s_thickness",
+                "sld": "shell_sld",
+                "thick_solvent": "w_thickness",
+            }
+        ],
+        "onion": [
+            "OnionExpShellModel",
+            {
+                "n_shells": "n_shells",
+                "A": "A_shell",
+                "sld_core": "sld_core0",
+                "radius_core": "rad_core0",
+                "sld_solvent": "sld_solv",
+                "thickness": "thick_shell",
+                "sld_in": "sld_in_shell",
+                "sld_out": "sld_out_shell"
+            }
+        ],
+        "parallelepiped": [
+            "ParallelepipedModel",
+            {
+                "phi": "parallel_phi",
+                "psi": "parallel_psi",
+                "sld_solvent": "sldSolv",
+                "length_a": "short_a",
+                "length_b": "short_b",
+                "sld": "sldPipe",
+                "theta": "parallel_theta",
+                "length_c": "long_c",
+                "M0:sld": "M0_sld_pipe",
+                "mtheta:sld": "M_theta_pipe",
+                "mphi:sld": "M_phi_pipe",
+                "M0:sld_solvent": "M0_sld_solv",
+                "mtheta:sld_solvent": "M_theta_solv",
+                "mphi:sld_solvent": "M_phi_solv",
+                "up:frac_i": "Up_frac_i",
+                "up:frac_f": "Up_frac_f",
+                "up:angle": "Up_theta",
+            }
+        ],
+        "peak_lorentz": [
+            "Peak Lorentz Model",
+            {
+                "peak_pos": "q0",
+                "peak_hwhm": "B"
+            },
+            "PeakLorentzModel",
+        ],
+        "pearl_necklace": [
+            "PearlNecklaceModel",
+            {
+                "scale": "scale",
+                "thick_string": "thick_string",
+                "sld_string": "sld_string",
+                "sld_solvent": "sld_solv",
+                "edge_sep": "edge_separation",
+                "num_pearls": "num_pearls",
+                "radius": "radius",
+                "background": "background",
+                "sld": "sld_pearl"
+            }
+        ],
+        "poly_gauss_coil": [
+            "Poly_GaussCoil",
+            {
+                "rg": "rg",
+                "polydispersity": "poly_m",
+                "i_zero": "scale",
+                "background": "background",
+            }
+        ],
+        "polymer_excl_volume": [
+            "PolymerExclVolume",
+            {
+                "rg": "rg",
+                "scale": "scale",
+                "background": "background",
+                "porod_exp": "m"
+            }
+        ],
+        "polymer_micelle": [
+            "MicelleSphCoreModel",
+            {
+                "sld_corona": "rho_corona",
+                "sld_solvent": "rho_solv",
+                "sld_core": "rho_core",
+                "ndensity": "ndensity",
+                "v_core": "v_core",
+                "v_corona": "v_corona",
+                "radius_core": "radius_core",
+                "rg": "radius_gyr",
+                "d_penetration": "d_penetration",
+                "n_aggreg": "n_aggreg",
+            }
+        ],
+        "porod": [
+            "PorodModel",
+            {
+                "scale": "scale",
+                "background": "background"
+            }
+        ],
+        "power_law": [
+            "PowerLawAbsModel",
+            {
+                "scale": "scale",
+                "background": "background",
+                "power": "m"
+            }
+        ],
+        "pringle": [
+            "PringlesModel",
+            {
+                "scale": "scale",
+                "sld_solvent": "sld_solvent",
+                "thickness": "thickness",
+                "beta": "beta",
+                "radius": "radius",
+                "background": "background",
+                "alpha": "alpha",
+                "sld": "sld_pringle"
+            }
+        ],
+        "raspberry": [
+            "RaspBerryModel",
+            {
+                "volfraction_lg": "volf_Lsph",
+                "volfraction_sm": "volf_Ssph",
+                "radius_sm": "radius_Ssph",
+                "radius_lg": "radius_Lsph",
+                "sld_lg": "sld_Lsph",
+                "sld_sm": "sld_Ssph",
+                "sld_solvent": "sld_solv",
+                "surface_fraction": "surfrac_Ssph",
+                "penetration": "delta_Ssph"
+            }
+        ],
+        "rectangular_prism": [
+            "RectangularPrismModel",
+            {
+                "sld": "sldPipe",
+                "length_a": "short_side",
+                "b2a_ratio": "b2a_ratio",
+                "c2a_ratio": "c2a_ratio",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "rpa": [
+            "RPA10Model",
+            {
+                "K12": "Kab", "K13": "Kac", "K14": "Kad",
+                "K23": "Kbc", "K24": "Kbd", "K34": "Kcd",
+                "N1": "Na", "N2": "Nb", "N3": "Nc", "N4": "Nd",
+                "L1": "La", "L2": "Lb", "L3": "Lc", "L4": "Ld",
+                "v1": "va", "v2": "vb", "v3": "vc", "v4": "vd",
+                "b1": "ba", "b2": "bb", "b3": "bc", "b4": "bd",
+                "Phi1": "Phia", "Phi2": "Phib", "Phi3": "Phic", "Phi4": "Phid",
+                "case_num": "lcase_n"
+            }
+        ],
+        "sc_paracrystal": [
+            "SCCrystalModel",
+            {
+                "sld": "sldSph",
+                "sld_solvent": "sldSolv"
+            }
+        ],
+        "sphere": [
+            "SphereModel",
+            {
+                "sld": "sldSph",
+                "radius": "radius",
+                "sld_solvent": "sldSolv",
+                "M0:sld": "M0_sld_sph",
+                "mtheta:sld": "M_theta_sph",
+                "mphi:sld": "M_phi_sph",
+                "M0:sld_solvent": "M0_sld_solv",
+                "mtheta:sld_solvent": "M_theta_solv",
+                "mphi:sld_solvent": "M_phi_solv",
+                "up:frac_i": "Up_frac_i",
+                "up:frac_f": "Up_frac_f",
+                "up:angle": "Up_theta"
+            }
+        ],
+        "spherical_sld": [
+            "SphericalSLDModel",
+            # Be lazy and use a generator expression to define
+            #    sld1: sld_flat0, ...
+            #    thickness1: thick_flat0, ...
+            #    interface1: thick_inter0, ...
+            #    shape1: func_inter0, ...
+            #    nu1: nu_inter0, ...
+            # but override thickness1 => rad_cor0 and sld1 => sld_core0.
+            # Note: explicit key,value pairs given by **{...} override the
+            # keys from the gnerator expression ((k,v) for k,v in seq) when
+            # used as dict((generator), **{...})
+            dict(((field_new+str(index+1), field_old+str(index))
+                  for field_new, field_old in [("sld", "sld_flat"),
+                                               ("thickness", "thick_flat"),
+                                               ("interface", "thick_inter"),
+                                               ("shape", "func_inter"),
+                                               ("nu", "nu_inter"),]
+                  for index in range(11)),
+                 **{
+                     "n_shells": "n_shells",
+                     "n_steps": "npts_inter",
+                     "sld_solvent": "sld_solv",
+                     "thickness1": "rad_core0",
+                     "sld1": "sld_core0",
+                 })
+        ],
+        "squarewell": [
+            "SquareWellStructure",
+            {
+                "scale": "scale_factor",
+                "radius_effective": "effect_radius",
+                "wellwidth": "wellwidth",
+                "welldepth": "welldepth",
+            }
+        ],
+        "stacked_disks": [
+            "StackedDisksModel",
+            {
+                "phi": "axis_phi",
+                "sld_layer": "layer_sld",
+                "sld_core": "core_sld",
+                "theta": "axis_theta",
+                "sld_solvent": "solvent_sld",
+                "n_stacking": "n_stacking",
+                "thick_layer": "layer_thick",
+                "thick_core": "core_thick",
+            }
+        ],
+        "star_polymer": [
+            "StarPolymer",
+            {
+                "arms": "arms",
+                "rg_squared": "R2"
+            }
+        ],
+        "stickyhardsphere": [
+            "StickyHSStructure",
+            {
+                "scale": "scale_factor",
+                "radius_effective": "effect_radius",
+            }
+        ],
+        "surface_fractal": [
+            "SurfaceFractalModel",
+            {
+                "cutoff_length": "co_length",
+                "radius": "radius",
+                "fractal_dim_surf": "surface_dim"
+            }
+        ],
+        "teubner_strey": [
+            "TeubnerStreyModel",
+            {
+                # Note: parameters are completely rewritten in convert.py
+                "volfraction_a": "volfraction_a",
+                "sld_a": "sld_a",
+                "sld_b": "sld_b",
+                "d": "d",
+                "xi": "xi",
+            }
+        ],
+        "triaxial_ellipsoid": [
+            "TriaxialEllipsoidModel",
+            {
+                "phi": "axis_phi",
+                "radius_equat_minor": "semi_axisA",
+                "radius_polar": "semi_axisC",
+                "radius_equat_major": "semi_axisB",
+                "sld_solvent": "sldSolv",
+                "psi": "axis_psi",
+                "sld": "sldEll",
+                "theta": "axis_theta"
+            }
+        ],
+        "two_lorentzian": [
+            "TwoLorentzian",
+            {
+                "lorentz_scale_1": "scale_1",
+                "lorentz_scale_2": "scale_2",
+                "lorentz_exp_1": "exponent_1",
+                "lorentz_exp_2": "exponent_2",
+                "lorentz_length_2": "length_2",
+                "lorentz_length_1": "length_1",
+                "background": "background"
+            },
+            "TwoLorentzianModel",
+        ],
+        "two_power_law": [
+            "TwoPowerLaw",
+            {
+                "coefficent_1": "coef_A",
+                "power_2": "power2",
+                "power_1": "power1",
+                "background": "background",
+                "crossover": "qc"
+            },
+            "TwoPowerLawModel",
+        ],
+        "unified_power_Rg": [
+            "UnifiedPowerRg",
+            dict(((field_new+str(index), field_old+str(index))
+                  for field_new, field_old in [("rg", "Rg"),
+                                               ("power", "power"),
+                                               ("G", "G"),
+                                               ("B", "B"),]
+                  for index in range(11)),
+                 **{
+                     "background": "background",
+                     "scale": "scale",
+                 }),
+            "UnifiedPowerRgModel",
+        ],
+        "vesicle": [
+            "VesicleModel",
+            {
+                "sld": "shell_sld",
+                "sld_solvent": "solv_sld"
+            }
+        ]
     }
 }
Index: sasmodels/convert.py
===================================================================
--- sasmodels/convert.py	(revision 07c8d460b7b27e8016df36dcd00643a649cd4e71)
+++ sasmodels/convert.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -4,5 +4,4 @@
 from __future__ import print_function, division
 
-import re
 import math
 import warnings
@@ -64,18 +63,18 @@
     return [pk*scale for pk in par] if isinstance(par, list) else par*scale
 
-def _is_sld(model_info, id):
+def _is_sld(model_info, par):
     """
     Return True if parameter is a magnetic magnitude or SLD parameter.
     """
-    if id.startswith('M0:'):
+    if par.startswith('M0:'):
         return True
-    if '_pd' in id or '.' in id:
+    if '_pd' in par or '.' in par:
         return False
     for p in model_info.parameters.call_parameters:
-        if p.id == id:
+        if p.id == par:
             return p.type == 'sld'
     # check through kernel parameters in case it is a named as a vector
     for p in model_info.parameters.kernel_parameters:
-        if p.id == id:
+        if p.id == par:
             return p.type == 'sld'
     return False
@@ -88,9 +87,9 @@
     *scale=1e-6*.  For forward conversion use *scale=1e6*.
     """
-    return dict((id, (_rescale(v, scale) if _is_sld(model_info, id) else v))
-                for id, v in pars.items())
-
-
-def _get_translation_table(model_info, version=(3,1,2)):
+    return dict((par, (_rescale(v, scale) if _is_sld(model_info, par) else v))
+                for par, v in pars.items())
+
+
+def _get_translation_table(model_info, version=(3, 1, 2)):
     conv_param = CONVERSION_TABLE.get(version, {}).get(model_info.id, [None, {}])
     translation = conv_param[1].copy()
@@ -130,7 +129,9 @@
     newpars = pars.copy()
     for new, old in mapping.items():
-        if old == new: continue
-        if old is None: continue
-        for underscore, dot in PD_DOT:
+        if old == new:
+            continue
+        if old is None:
+            continue
+        for _, dot in PD_DOT:
             source = old+dot
             if source in newpars:
@@ -159,6 +160,6 @@
     return None
 
-def _hand_convert(name, oldpars, version=(3,1,2)):
-    if version == (3,1,2):
+def _hand_convert(name, oldpars, version=(3, 1, 2)):
+    if version == (3, 1, 2):
         oldpars = _hand_convert_3_1_2_to_4_1(name, oldpars)
     return oldpars
@@ -295,5 +296,5 @@
     return oldpars
 
-def convert_model(name, pars, use_underscore=False, model_version=(3,1,2)):
+def convert_model(name, pars, use_underscore=False, model_version=(3, 1, 2)):
     """
     Convert model from old style parameter names to new style.
@@ -327,5 +328,5 @@
         newpars = _convert_pars(newpars, translation)
         # TODO: Still not convinced this is the best check
-        if not model_info.structure_factor and version == (3,1,2):
+        if not model_info.structure_factor and version == (3, 1, 2):
             newpars = _rescale_sld(model_info, newpars, 1e6)
         newpars.setdefault('scale', 1.0)
@@ -615,9 +616,10 @@
         print("==== %s out ====="%new_name)
         print(str(compare.parlist(model_info, new_pars, True)))
-    assert name==new_name, "%r != %r"%(name, new_name)
+    assert name == new_name, "%r != %r"%(name, new_name)
     for k, v in new_pars.items():
         assert k in pars, "%s: %r appeared from conversion"%(name, k)
         if isinstance(v, float):
-            assert abs(v-pars[k])<=abs(1e-12*v), "%s: %r  %s != %s"%(name, k, v, pars[k])
+            assert abs(v-pars[k]) <= abs(1e-12*v), \
+                "%s: %r  %s != %s"%(name, k, v, pars[k])
         else:
             assert v == pars[k], "%s: %r  %s != %s"%(name, k, v, pars[k])
Index: sasmodels/core.py
===================================================================
--- sasmodels/core.py	(revision 9e771a3757fd7f0b8a68d70e73b5a50617a12ad8)
+++ sasmodels/core.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -10,7 +10,7 @@
 
 import os
+from os.path import basename, join as joinpath
+from glob import glob
 import re
-from os.path import basename, dirname, join as joinpath
-from glob import glob
 
 import numpy as np # type: ignore
@@ -35,8 +35,7 @@
 CUSTOM_MODEL_PATH = os.environ.get('SAS_MODELPATH', "")
 if CUSTOM_MODEL_PATH == "":
-    path = joinpath(os.path.expanduser("~"), ".sasmodels", "custom_models")
-    if not os.path.isdir(path):
-        os.makedirs(path)
-    CUSTOM_MODEL_PATH = path
+    CUSTOM_MODEL_PATH = joinpath(os.path.expanduser("~"), ".sasmodels", "custom_models")
+    if not os.path.isdir(CUSTOM_MODEL_PATH):
+        os.makedirs(CUSTOM_MODEL_PATH)
 
 try:
Index: sasmodels/data.py
===================================================================
--- sasmodels/data.py	(revision e3571cb8ce08562cdc3fe1a49f464432ab679386)
+++ sasmodels/data.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -64,5 +64,5 @@
             data.qmin, data.qmax = data.x.min(), data.x.max()
             data.mask = (np.isnan(data.y) if data.y is not None
-                        else np.zeros_like(data.x, dtype='bool'))
+                         else np.zeros_like(data.x, dtype='bool'))
         elif hasattr(data, 'qx_data'):
             data.mask = ~data.mask
@@ -427,6 +427,6 @@
 
     if getattr(data, 'radial', False):
-        radial_data.x = radial_data.q_data
-        radial_data.y = radial_data.data
+        data.x = data.q_data
+        data.y = data.data
 
     use_data = use_data and data.y is not None
Index: sasmodels/generate.py
===================================================================
--- sasmodels/generate.py	(revision ff104792a8c7664b8c2b98af11a2db58f784b8d1)
+++ sasmodels/generate.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -163,5 +163,5 @@
 
 import sys
-from os.path import abspath, dirname, join as joinpath, exists, isdir, getmtime
+from os.path import abspath, dirname, join as joinpath, exists, getmtime
 import re
 import string
@@ -654,9 +654,8 @@
     line instead.
     """
-    for path, code in sources:
+    for _path, code in sources:
         if _IQXY_PATTERN.search(code):
             return True
-    else:
-        return False
+    return False
 
 
@@ -772,6 +771,6 @@
     # TODO: allow mixed python/opencl kernels?
 
-    ocl = kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)
-    dll = kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)
+    ocl = _kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)
+    dll = _kernels(kernel_code, call_iq, call_iqxy, clear_iqxy, model_info.name)
     result = {
         'dll': '\n'.join(source+dll[0]+dll[1]+dll[2]),
@@ -782,5 +781,5 @@
 
 
-def kernels(kernel, call_iq, call_iqxy, clear_iqxy, name):
+def _kernels(kernel, call_iq, call_iqxy, clear_iqxy, name):
     # type: ([str,str], str, str, str) -> List[str]
     code = kernel[0]
@@ -931,4 +930,5 @@
 
 def make_html(model_info):
+    # type: (ModelInfo) -> str
     """
     Convert model docs directly to html.
@@ -940,4 +940,8 @@
 
 def view_html(model_name):
+    # type: (str) -> None
+    """
+    Load the model definition and view its help.
+    """
     from . import modelinfo
     kernel_module = load_kernel_module(model_name)
@@ -946,4 +950,8 @@
 
 def view_html_from_info(info):
+    # type: (ModelInfo) -> None
+    """
+    View the help for a loaded model definition.
+    """
     from . import rst2html
     url = "file://"+dirname(info.filename)+"/"
@@ -970,5 +978,4 @@
     Program which prints the source produced by the model.
     """
-    import sys
     from .modelinfo import make_model_info
 
Index: sasmodels/modelinfo.py
===================================================================
--- sasmodels/modelinfo.py	(revision 6aee3abf255884200f80256eb642d49c1e9c888e)
+++ sasmodels/modelinfo.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -18,4 +18,5 @@
 try:
     from typing import Tuple, List, Union, Dict, Optional, Any, Callable, Sequence, Set
+    from types import ModuleType
 except ImportError:
     pass
@@ -499,8 +500,6 @@
         for par in self.call_parameters:
             if par.name == key:
-                break
-        else:
-            raise KeyError("unknown parameter %r"%key)
-        return par
+                return par
+        raise KeyError("unknown parameter %r"%key)
 
     def __contains__(self, key):
@@ -508,6 +507,5 @@
             if par.name == key:
                 return True
-        else:
-            return False
+        return False
 
     def _set_vector_lengths(self):
@@ -526,13 +524,7 @@
         """
         # Sort out the length of the vector parameters such as thickness[n]
-
         for p in self.kernel_parameters:
             if p.length_control:
-                for ref in self.kernel_parameters:
-                    if ref.id == p.length_control:
-                        break
-                else:
-                    raise ValueError("no reference variable %r for %s"
-                                     % (p.length_control, p.name))
+                ref = self._get_ref(p)
                 ref.is_control = True
                 ref.polydisperse = False
@@ -542,4 +534,12 @@
                                      % ref.name)
                 p.length = int(high)
+
+    def _get_ref(self, p):
+        # type: (Parameter) -> Parameter
+        for ref in self.kernel_parameters:
+            if ref.id == p.length_control:
+                return ref
+        raise ValueError("no reference variable %r for %s"
+                         % (p.length_control, p.name))
 
     def _get_defaults(self):
@@ -714,4 +714,5 @@
 
 def _find_source_lines(model_info, kernel_module):
+    # type: (ModelInfo, ModuleType) -> None
     """
     Identify the location of the C source inside the model definition file.
@@ -967,4 +968,6 @@
     #: the SESANS correlation function.  Note: not currently implemented.
     sesans = None           # type: Optional[Callable[[np.ndarray], np.ndarray]]
+    #: Returns a random parameter set for the model
+    random = None           # type: Optional[Callable[[], Dict[str, float]]]
 
     # line numbers within the python file for bits of C source, if defined
Index: sasmodels/rst2html.py
===================================================================
--- sasmodels/rst2html.py	(revision dd4d95d06c0fb7308e3d57897c300ec73db2f444)
+++ sasmodels/rst2html.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -211,4 +211,7 @@
     sys.exit(app.exec_())
 
+# Set default html viewer
+view_html = view_html_qtapp
+
 def can_use_qt():
     """
@@ -249,3 +252,2 @@
     import sys
     view_help(sys.argv[1], qt=False)
-
Index: sasmodels/sasview_model.py
===================================================================
--- sasmodels/sasview_model.py	(revision 17db8332295ad79c49eea8f1288153ae3f597b8b)
+++ sasmodels/sasview_model.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -186,7 +186,7 @@
     sys.modules['sas.models'] = sas.sascalc.fit
     sas.models = sas.sascalc.fit
-
     import sas.models
     from sasmodels.conversion_table import CONVERSION_TABLE
+
     for new_name, conversion in CONVERSION_TABLE.get((3, 1, 2), {}).items():
         # CoreShellEllipsoidModel => core_shell_ellipsoid:1
@@ -202,4 +202,7 @@
 def MultiplicationModel(form_factor, structure_factor):
     # type: ("SasviewModel", "SasviewModel") -> "SasviewModel"
+    """
+    Returns a constructed product model from form_factor and structure_factor.
+    """
     model_info = product.make_product_info(form_factor._model_info,
                                            structure_factor._model_info)
Index: sasmodels/special.py
===================================================================
--- sasmodels/special.py	(revision 110f69cfa1143196495c76df1d5cff08c6ce884e)
+++ sasmodels/special.py	(revision e65c3ba5944b729f651cf8747f7b64bed2cbb826)
@@ -192,6 +192,7 @@
 
 """
+# pylint: disable=unused-import
+
 import numpy as np
-import scipy.special
 
 # Functions to add to our standard set
@@ -199,5 +200,4 @@
 
 # C99 standard math library functions
-M_PI, M_PI_2, M_PI_4, M_SQRT1_2, M_E = np.pi, np.pi/2, np.pi/4, np.sqrt(0.5), np.e
 from numpy import exp, log, power as pow, expm1, sqrt
 from numpy import sin, cos, tan, arcsin as asin, arccos as acos, arctan as atan
@@ -207,26 +207,4 @@
 from numpy import NAN, inf as INFINITY
 
-# erf, erfc, tgamma, lgamma  **do not use**
-
-# non-standard constants and functions
-M_PI_180, M_4PI_3 = M_PI/180, 4*M_PI/3
-
-# can't do SINCOS in python; use "s, c = SINCOS(x)" instead
-def SINCOS(x): return sin(x), cos(x)
-
-def square(x): return x*x
-
-def cube(x): return x*x*x
-
-from numpy import sinc as _sinc
-def sas_sinx_x(x): return _sinc(x/M_PI)
-def powr(x, y): return x**y
-def pown(x, n): return x**n
-
-FLOAT_SIZE = 8
-
-def polevl(x, c, n): return np.polyval(c[:n], x)
-def p1evl(x, c, n): return np.polyval(np.hstack(([1.], c))[:n], x)
-
 from scipy.special import gamma as sas_gamma
 from scipy.special import erf as sas_erf
@@ -236,8 +214,54 @@
 from scipy.special import jn as sas_JN
 
+# erf, erfc, tgamma, lgamma  **do not use**
+
+# C99 standard math constants
+M_PI, M_PI_2, M_PI_4, M_SQRT1_2, M_E = np.pi, np.pi/2, np.pi/4, np.sqrt(0.5), np.e
+
+# non-standard constants
+M_PI_180, M_4PI_3 = M_PI/180, 4*M_PI/3
+
+# can't do SINCOS in python; use "s, c = SINCOS(x)" instead
+def SINCOS(x):
+    """return sin(x), cos(x)"""
+    return sin(x), cos(x)
+
+def square(x):
+    """return x^2"""
+    return x*x
+
+def cube(x):
+    """return x^3"""
+    return x*x*x
+
+def sas_sinx_x(x):
+    """return sin(x)/x"""
+    from numpy import sinc as _sinc
+    return _sinc(x/M_PI)
+
+def powr(x, y):
+    """return x^y for x>0"""
+    return x**y
+def pown(x, n):
+    """return x^n for n integer"""
+    return x**n
+
+FLOAT_SIZE = 8
+
+def polevl(x, c, n):
+    """return p(x) for polynomial p of degree n-1 with coefficients c"""
+    return np.polyval(c[:n], x)
+
+def p1evl(x, c, n):
+    """return x^n + p(x) for polynomial p of degree n-1 with coefficients c"""
+    return np.polyval(np.hstack(([1.], c))[:n], x)
+
 def sas_Si(x):
-    return scipy.special.sici(x)[0]
+    """return Si(x)"""
+    from scipy.special import sici
+    return sici(x)[0]
 
 def sas_j1(x):
+    """return j1(x)"""
     if np.isscalar(x):
         retvalue = (sin(x) - x*cos(x))/x**2 if x != 0. else 0.
@@ -246,6 +270,8 @@
             retvalue = (sin(x) - x*cos(x))/x**2
         retvalue[x == 0.] = 0.
+    return retvalue
 
 def sas_3j1x_x(x):
+    """return 3*j1(x)/x"""
     if np.isscalar(x):
         retvalue = 3*(sin(x) - x*cos(x))/x**3 if x != 0. else 1.
@@ -257,4 +283,5 @@
 
 def sas_2J1x_x(x):
+    """return 2*J1(x)/x"""
     if np.isscalar(x):
         retvalue = 2*sas_J1(x)/x if x != 0 else 1.
