profiles.base.derived_profile#
- profiles.base.derived_profile(name: str | None = None) classmethod [source]#
Mark a class method as a derived profile generator.
Derived profiles define secondary symbolic profiles (e.g., gradients, potentials) associated with this class. When decorated, the method is automatically registered at class construction and the profile can be instantiated on demand via
get_derived_profile()
.The decorated method must be a
@classmethod
with the following signature:@classmethod def my_derived( cls, *variable_symbols, **parameter_symbols ): return ( symbolic_func, units_func, variables, parameters, )
The method must return a tuple:
symbolic_func(*variable_symbols, **parameter_symbols)
— Callable generating a SymPy expressionunits_func(*variable_units, **parameter_units)
— Callable computing units with unytvariables
— List of str, independent variables for the derived profileparameters
— Dict of str: default parameters for the derived profile
- Parameters:
name (
str
, optional) – A custom name for the derived profile. Defaults to the method name.- Returns:
The decorated classmethod, with registration metadata.
- Return type:
classmethod
Notes
Use
get_derived_profile()
to access an instantiated version.
- Raises:
TypeError – If applied to a method that is not a @classmethod.