You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When pastas loads time series settings contained in a StressModel, it checks whether the length of the list of settings is >1, and if that is not the case it squeezes the output by selecting the only entry in that list. This causes issues in WellModel when there are multiple stresses but the settings is a single dictionary. There was logic for extending the settings as a list of dict with length 1 if it did not match the number of stresses, but not for a single dictionary.
@pytest.mark.dependency()@pytest.mark.xfail(reason="settings not parsed correctly in pastas")deftest_write_yaml_minimal_nearest(request, pstore):
depends(
request,
[
f"test_load_yaml_rechargemodel[{pstore.type}]",
f"test_load_yaml_stressmodel[{pstore.type}]",
f"test_load_yaml_wellmodel[{pstore.type}]",
],
)
ml=pstore.models["my_third_model"]
pstore.yaml.export_model(ml, minimal_yaml=True, use_nearest=True)
Expected behavior
Deal with settings as a dictionary, automatically extend settings to apply for all time series. Easy fix by also checking if settings is a dictionary and applying it to all stresses. In WellModel.__init__ ():
Additional context
I'm not sure if this bug every bothers pastas scripts directly but it occurs with the pastastore YAML interface. Related to changes for #411 .
The text was updated successfully, but these errors were encountered:
Describe the bug
When pastas loads time series settings contained in a StressModel, it checks whether the length of the list of settings is >1, and if that is not the case it squeezes the output by selecting the only entry in that list. This causes issues in WellModel when there are multiple stresses but the settings is a single dictionary. There was logic for extending the settings as a list of dict with length 1 if it did not match the number of stresses, but not for a single dictionary.
Code to reproduce
See XFAIL test in pastastore:
https://github.com/pastas/pastastore/blob/d5ab8e4f07c4d134621848fe8b9c2b4a76f6bdb3/tests/test_004_yaml.py#L128-L141
Expected behavior
Deal with settings as a dictionary, automatically extend settings to apply for all time series. Easy fix by also checking if settings is a dictionary and applying it to all stresses. In
WellModel.__init__ ()
:Python package version
pastas 0.23.0
Additional context
I'm not sure if this bug every bothers pastas scripts directly but it occurs with the pastastore YAML interface. Related to changes for #411 .
The text was updated successfully, but these errors were encountered: