Component Base Class

class tabascal.components.Component[source]

Base class for all tabascal components

build_constants() Dict[str, Any][source]

Return arrays that do not change during the forward pass.

Returns a dict of array_name -> array_value. These will be stored in constants as “_c/<ClassName>/array_name” by Model.__init__.

abstractmethod build_forward() Callable[source]

Build the forward computation function

build_set_params() Callable[source]

Build parameter sampling function (optional)

config_params: Dict[str, Param] = {}

Config parameters this component reads, keyed by their dotted path in the config file. Declared here, next to the code that reads them, so a component and its requirements can never drift apart. Only the components named in model.components contribute to a run’s schema – see tabascal.config_schema.collect_params(). Subclasses extend (and may override) what their base declared; the parameters read outside any component live on tabascal.config.TabConfig.

require_double(config: Any) None[source]

Raise if this requires_double component is run in single precision.

Some components only work in double precision: the SGP4/phase trajectory components (differentiable orbits). Those set requires_double = True and call this at the top of setup so they fail with a clear message under single precision instead of producing silently-wrong fp32 results. Driven by the requires_double flag so it stays in sync with the run-time preflight.

abstractmethod setup(tab_config: Any) None[source]

Initialize component with configuration

validate_state(state: Dict[str, Any]) None[source]

Validate required inputs are present

tabascal.components.axis_extent(x, dx) float[source]

The span of a sampled axis, falling back to its sample spacing.

The default correlation length of a Gaussian-process prior is the extent of the axis it is defined on. A single-sample axis has zero extent, which is not a usable length scale, so the sample spacing (one channel / one integration) stands in for it.