Fitting.models

Data models

class fitting.models.Constraint(*args, **kwargs)

Fitting parameter constraints

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

apply_constraint(fit_problem)

Apply the constraint to a fit problem

get_constraint_function(alternate_name=None)

Generate the constraint function

get_ranges(sample_name='sample', probe_name='probe')

Return the constraint code for the refl1d script

classmethod validate_constraint(constraint_code, variables)

Validate user-submitted constraint code.

class fitting.models.FitProblem(*args, **kwargs)

Reflectivity model

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

delete(*args, **kwargs)

Delete method to clean up related objects

model_to_dicts()

Return a dict with all the data values

show_layers()

Useful method to return the layers as a concise string

class fitting.models.FitterOptions(*args, **kwargs)

Reflectivity model

exception DoesNotExist
exception MultipleObjectsReturned
get_dict()

Return an options dictionary

class fitting.models.ReflectivityLayer(*args, **kwargs)

One layer of a reflectivity model

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

class fitting.models.ReflectivityModel(*args, **kwargs)

Main reflectivity parameters

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

class fitting.models.SavedModelInfo(*args, **kwargs)

Additional information attached to a saved model

exception DoesNotExist
exception MultipleObjectsReturned
class fitting.models.SimultaneousConstraint(*args, **kwargs)

Constraint to tie parameters from two data sets in a simultaneous fit. #TODO: rewrite and merge this with Constraint when we are ready to write it as functions.

exception DoesNotExist
exception MultipleObjectsReturned
classmethod create_from_encoded(fit_problem, par_to, par_from, user)

Create a simultaneous constraint from encoded parameters

encode()

Encode an object into info that can be passed to a template

get_constraint(sample_name='sample')

Return the constraint code for the refl1d script

Example: sample123[‘SiOx’].material.rho = sample345[‘SiOx’].material.rho

class fitting.models.SimultaneousFit(*args, **kwargs)

Top level entry for a simultaneous fit. The FitProblem referenced here is the parent problem with which we can find the related data sets.

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

class fitting.models.SimultaneousModel(*args, **kwargs)

Data sets to be addded to a FitProblem for simultaneous fitting

exception DoesNotExist
exception MultipleObjectsReturned
__str__()

Return str(self).

class fitting.models.UserData(*args, **kwargs)

User data information

exception DoesNotExist
exception MultipleObjectsReturned