Core Module - Base Classes and Main Functions

This module holds the base level classes for the pymodelfit data fitting/modeling framework. This is seperated from the implementations of specific models, which can be found in the builtins module.

Class Inheritance Diagram

pymodelfit.core includes a number of classes that are primarily inteded to be subclassed by particular models. The relationship between these classes is shown in the below diagram.

Inheritance diagram of pymodelfit.core

Module Reference


ModelTypeError(message) This exception indicates a problem with the value of the input
ParametricModel The superclass of all models with parameters.
AutoParamsMeta(name, bases, dct) Metaclass used to auto-generate parameters from the FunctionModel.f()
InputCoordinateTransformer This mixin class (i.e.
FunctionModel A base class for models that use a single function to map a
CompositeModel([models, operation, ...]) This model contains a group of FunctionModel objects joined by
FunctionModel1D This class is the base for 1-dimensional models that are implemented as python functions.
FunctionModel1DAuto A FunctionModel1D that infers the parameters from the f()
DatacentricModel1D A FunctionModel1D that requires data to compute its value.
DatacentricModel1DAuto A DatacentricModel1D that infers the parameters from the f()
CompositeModel1D(*args, **kwargs) This model is a composite model of FunctionModel1D models with a few
FunctionModel2DScalar This class is a FunctionModel that maps a two-dimensional input to a
FunctionModel2DScalarAuto A FunctionModel2DScalar that has its parameters automatically
FunctionModel2DScalarDeformedRadial(rmodel) A FunctionModel2DScalar with a profile that is flattened along an axis
FunctionModel2DScalarSeperable(rmodel[, ...]) A FunctionModel2DScalar that is seperable and follows a radial and
CompositeModel2DScalar(*args, **kwargs) This model is a composite model of FunctionModel2DScalar models.
ModelSequence(models[, extraparams, ...]) A group of models with attached parameters that can be used to infer the parameter values at an arbitrary point in the space defined by the models.


register_model(model[, name, overwrite]) Registers a model at the module package level for get_model_class() and :func`list_model`.
list_models([include, exclude, baseclass, ...]) Lists the registered model objects in the package, possibly subject to constraints.
get_model_class(model[, baseclass]) Returns the class object for the requested model in the model registry
get_model_instance(model[, baseclass, ...]) Returns an instance of the supplied model - if the input is actually an instance of a model, the same instance will be passed in - otherwise, a new instance will be created.
offset_model(model[, offsetparname, offsetval]) A convinience to generate a CompositeModel with an additive offset
scale_model(model[, scaleparname, scaleval]) A convinience function to generate a CompositeModel with a scaling
scale_and_offset_model(model[, ...]) A convinience function to generate a CompositeModel with a multiplicative
intersect_models(m1, m2[, bounds, nsample, ...]) Determine the points where two models intersect.

Table Of Contents

Previous topic

Interactive Curve Fitting – GUI Tools

Next topic


This Page