mario.CoreModel.is_balanced#
- CoreModel.is_balanced(method, data_set='baseline', margin=0.05, as_dataframe=False)#
Check whether a scenario is balanced under a chosen criterion.
- Parameters:
method – Balance criterion. Accepted values are
"flows","coefficients"and"prices".data_set – Scenario to test.
margin – Allowed tolerance around the expected balance condition.
as_dataframe – When
True, return the imbalance table instead of printing it.
- Returns:
Truewhen balanced,Falsewhen imbalances are found, or the imbalance dataframe whenas_dataframe=True.- Return type:
bool | pandas.DataFrame