libera_utils.scene_id.CalculationSpec#

class libera_utils.scene_id.CalculationSpec(output_var: str, function: Callable, input_vars: list[str], output_datatype: type, dependent_calculations: list[str] | None = None)#

Bases: object

Specification for calculating a derived variable.

Defines the parameters needed to calculate a derived variable from input data, including the calculation function, required inputs, and any dependencies on other calculated variables.

output_var#

Name of the output variable to be created

Type:

str

function#

The function to call for calculation

Type:

Callable

input_vars#

List of input variable names required by the function

Type:

list of str

output_datatype#

Expected data type of the output (e.g., float, int)

Type:

type

dependent_calculations#

List of other calculated variables that must be computed first, or None if no dependencies exist. Default is None.

Type:

list of str or None, optional

Examples

>>> spec = CalculationSpec(
...     output_var="cloud_fraction",
...     function=calculate_cloud_fraction,
...     input_vars=["clear_area"],
...     output_datatype=float
... )
Attributes:
dependent_calculations
__init__(output_var: str, function: Callable, input_vars: list[str], output_datatype: type, dependent_calculations: list[str] | None = None) None#

Attributes