1 Logging

Logging()

Defines the logging behavior of the core.

1.1 Attributes

Name Type Description
verbosity Verbosity The verbosity of the logging: debug/info/warn/error (Optional, defaults to info)

1.2 Methods

Name Description
diff Compare two instances of a BaseModel.
model_dump

1.2.1 diff

Logging.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.1.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.2 model_dump

Logging.model_dump(**kwargs)