Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove StressModel2 #406

Merged

Conversation

raoulcollenteur
Copy link
Member

@raoulcollenteur raoulcollenteur commented Aug 16, 2022

Short Description

Remove StressModel2 as decided per issue #363.

Checklist before PR can be merged:

@raoulcollenteur raoulcollenteur added this to the 0.22.0 milestone Aug 16, 2022
@raoulcollenteur raoulcollenteur self-assigned this Aug 16, 2022
@raoulcollenteur raoulcollenteur linked an issue Aug 16, 2022 that may be closed by this pull request
@raoulcollenteur
Copy link
Member Author

Should we throw an error message in pastas/io/base.py when loading a file which still has StressModel2? And then for Pastas v.0.22.0 make sure that people can load and save the .pas-file to the new format.

if ts["stressmodel"] == "StressModel2": 
    warning("StressModel2 is removed since Pastas 0.22.0. Make sure to save this file 
                     using v0.22.0 as this file will not work in ")
    ts["stressmodel"] = "RechargeModel"
    ts["recharge"] = "Linear"
    ts["prec"] = ts["stress"][0]
    ts["evap"] = ts["stress"][1]

@raoulcollenteur
Copy link
Member Author

The above method actually works well, I tested using the following code using notebook 8_threshold_nonlinear.ipynb.

ml = pt.io.load('data_notebook_8/B28H1804_2.pas')
ml.to_file("test.pas")
ml1 = pt.io.load('test.pas')
pt.plots.compare([ml, ml1])

B28H1808_2.pas.zip old pas-file for future reference. I updated the old pas-file to the newer version now.

PR should be good to go now I think. Can you have a look @rubencalje ?

@raoulcollenteur raoulcollenteur merged commit 67c0671 into dev Aug 17, 2022
@raoulcollenteur raoulcollenteur deleted the 363-deprecate-stressmodel2-in-v0210-remove-in-v0220 branch August 17, 2022 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Deprecate StressModel2 in v0.21.0, remove in v0.23.0
2 participants