Model Module

pySCATMECH.model.DialogGetModel(top)

Opens a dialog box with a selection of Models inheriting top and returns the choice.

Parameters:

top (str) – The top level class from which to choose a child class

Returns:

  • str (The name of the selected child class)

  • Requires

  • ——–

  • tkinter

pySCATMECH.model.DialogGetModelParameters(model)

Opens a dialog box with a selection of Models inheriting top and returns the choice.

Parameters:

model (Model) – The model to fill parameters out with.

Returns:

  • Model

  • The model with new parameters

  • Requires

  • ——–

  • tkinter

class pySCATMECH.model.Model(*args, **kwargs)

Base class for Models.

askParameters()

Queries the user for parameter values. TODO FIX!

getModelName()

Returns the model’s name

getParameter(parameter)

Gets a string corresponding to the value of a model parameter. Arguments: parameter: parameter name as a string Returns: parameter value

getParameterDictionary()

Returns a dictionary of dictionaries for each parameter that includes values, descriptions, and types.

getParameters()

Gets all of the parameters for the model.

Return type:

dict with str keys

printParameters()

Returns a printable string that includes all the parameters, their values, and their descriptions. Recommend surround with print()

setParameter(parameter, value)

Sets a single parameter for the model.

Parameters:
  • parameter (str) – Parameter name as a string. Subparameters must use parameter.subparameter notation.

  • value (float, str, or complex) – Parameter value

setParameters(*args, **kwargs)

Sets one or more parameters for the model.

Parameters:
  • parameter_values (dict) – Argument is a dictionary with with str keys being the parameters and values being the values. None key defines model name.

  • **kwargs – parameters can be set by parameter name, lambda should be replace with wavelength, since lambda is a Python keyword.

Return type:

Model

pySCATMECH.model.chooseModel(model)

Presents user with a choice of models and returns the user’s choice, by name.

pySCATMECH.model.chooseModelAndParameters(model)

Presents user with a choice of models and asks for parameters.

pySCATMECH.model.createDictOfDict(theDict)

Creates a dictionary of dictionaries for a simple dictionary with dot-delimited keys. The result[gparent][parent][child] theDict[“gparent.parent.child”]–>result[“gparent”][“parent”][“child”] theDict[“gparent.parent”]–> result[gparent][parent][None]

pySCATMECH.model.getModelDictionary(model='Model')

Returns a dictionary containing all the models inheriting model and their descriptions.

pySCATMECH.model.strDictOfDict(thedict, indent='', result=None)

Prints a dictionary of dictionaries in a readable format