astrophot.param package#
Submodules#
astrophot.param.module module#
astrophot.param.param module#
- class astrophot.param.param.Param(*args, uncertainty=None, prof=None, **kwargs)[source]#
Bases:
ParamA class that extends the Caskade Param class to include additional functionality. This class is used to define parameters for models in the AstroPhot package.
- property full_shape#
- property initialized#
Check if the parameter is initialized.
- property name_array#
- property prof#
- property uncertainty#
Module contents#
- class astrophot.param.OverrideParam(param: Param, value)[source]#
Bases:
objectContext manager to override a parameter value. Only inside an OverrideParam will the parameter be set to the new value.
- class astrophot.param.Param(*args, uncertainty=None, prof=None, **kwargs)[source]#
Bases:
ParamA class that extends the Caskade Param class to include additional functionality. This class is used to define parameters for models in the AstroPhot package.
- property full_shape#
- property initialized#
Check if the parameter is initialized.
- property name_array#
- property prof#
- property uncertainty#
- class astrophot.param.ValidContext(module: Module)[source]#
Bases:
objectContext manager to set valid values for parameters. Only inside a ValidContext will parameters automatically be assumed valid.
- astrophot.param.forward(method)[source]#
Decorator to define a forward method for a module.
Parameters#
- method: (Callable)
The forward method to be decorated.
Examples#
Standard usage of the forward decorator:
class ExampleSim(Module): def __init__(self, a, b, c): super().__init__("example_sim") self.a = a self.b = Param("b", b) self.c = Param("c", c) @forward def example_func(self, x, b=None): return x + self.a + b E = ExampleSim(a=1, b=None, c=3) print(E.example_func(4, params=[5])) # Output: 10
Returns#
- Callable
The decorated forward method.