1 Allocation

Allocation(**data)

Defines the allocation optimization algorithm options.

1.1 Attributes

Name Type Description
intervention_interval float Interval in seconds at which allocation results are passed to the physical layer, representing human intervention (Optional, defaults to 86400.0)
dt (float, optional) Fixed allocation timestep in seconds within an intervention interval. If not provided, adaptive timestepping is used. Values above intervention_interval are reduced to it.
dtmin float Minimum allocation timestep in seconds for adaptive timestepping (Optional, defaults to 3600.0). Values above intervention_interval are reduced to it.
dtmax float Maximum allocation timestep in seconds for adaptive timestepping (Optional, defaults to 86400.0). Values above intervention_interval are reduced to it.
route_priority RoutePriority The default route priority per node type

1.2 Methods

Name Description
check_parent
diff Compare two instances of a BaseModel.
model_dump

1.2.1 check_parent

Allocation.check_parent()

1.2.2 diff

Allocation.diff(other, ignore_meta=False)

Compare two instances of a BaseModel.

** Warning: This method is experimental and is likely to change. **

If they are equal, return None. Otherwise, return a nested dictionary with the differences. When the differences are not a DataFrame (like the toml config), the dict has self and other as key. For DataFrames we return a dict with diff as key, and a datacompy Comparison object.

When ignore_meta is set to True, the meta_* columns in the DataFrames are ignored. Note that in that case the key will still be returned and the value will be None.

1.2.2.1 Examples

>>> nbasic == basic
False
>>> x = nbasic.diff(basic)
{'basin': {'node': {'diff': <datacompy.pandas.PandasCompare object at 0x16e5a45c0>},
        'static': {'diff': <datacompy.pandas.PandasCompare object at 0x16eb90080>}},
'solver': {'saveat': {'other': 86400.0, 'self': 0.0}}}
>>> x["basin"]["static"]["diff"].report()
DataComPy Comparison
--------------------
...

1.2.3 model_dump

Allocation.model_dump(**kwargs)