1 Allocation

Allocation(**data)

Defines the allocation optimization algorithm options.

1.1 Attributes

Name Type Description
dt (float, optional) The simulated time in seconds between successive allocation calls. If not provided, adaptive timestepping is used. When provided, this acts as a fixed timestep.
reltol_linearization float Relative tolerance for linearization errors of basin profiles and connector node Q(h) relationships (Optional, defaults to 0.01)
dtmin float Minimum allocation timestep in seconds for adaptive timestepping (Optional, defaults to 3600.0)

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.core.Compare object at 0x16e5a45c0>},
        'static': {'diff': <datacompy.core.Compare 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)