-
Notifications
You must be signed in to change notification settings - Fork 72
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
Do not add NoiseModel to Model-class by default anymore #678
Conversation
Based on proposal from @raoulcollenteur in issue #667
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
where necessary to get same output
Should we merge this for 1.4 or wait one version? Giving a warning early about this future change might be good? |
I agree, an early warning is good. I am in favor of merging before the next version. |
This is a big change (although I am all for it). As this will give different results with the default values for many models, I think it warrants a major version number change. Should we go to 2.0 for this? |
Perhaps a global "I got it, don't keep warning me" option would be nice to include, to avoid repeating the warning so often people stop reading it? |
Any thought on how to implement this? You want to give this warning once after the first solve after a Pastas import? |
Maybe a global boolean setting that is flipped after one solve call? And can be turned off manually as well? And turning it off would then mean your code includes something like |
People can just set |
I found this on stackoverflow so that you can raise warnings and log them without duplicating the message: logging.captureWarnings(True) |
Related to the comment above: this works for me in #700 to raise a FutureWarning in the logger: from logging import captureWarnings, getLogger
from warnings import warn
captureWarnings(True)
logger = getLogger(__name__)
warnings_logger = getLogger("py.warnings")
logger.addHandler(warnings_logger)
warn(
"Type Your Message Here",
category=FutureWarning,
) |
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
For version 2.0, I think the default should be to add a NoiseModel like adding a stress model. That way different noise models can be added. So my suggestion for version 2.0 is that ml.solve can not add a noise model. Come to think of it, this may have been the original implementation of a noise model in the first versions of pastas. |
@rubencalje, can you implement the same for ml = Model(noisemodel=True) and set the default to False? Then no noisemodel is silently added by default anymore and users have to be explicit there as well. |
I can do that, but I think we then need to change the default behavior of the noise-parameter in ml.solve() to: if you have added a noisemodel, solve with noise = True, and if you have not added a noisemodel, solve with noise = False. We then remove the warning implemented now, and add a similar warning to the |
And change ml.solve(noise=True) to ml = ps.Model(noisemodel=True) in many examples.
plus add warning to top of docs plus add warning on import
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesYou may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation |
This PR is ready for review again. |
I made some changes to the messages that I think will inform the user a bit better. |
And saved before version 1.5
…stas into prepare_noise_is_false
Made a change so that loading of pas-files from versions before 1.5 that were solved with ml.solve(noise=False) can be loaded and will give the same results, by removing the noisemodel from these models. PR can be merged. |
I added a few words and the Github issue with clarification.
Before putting this in dev, I think @martinvonk and @OnnoEbbens should merge their PRs (#732 and #729) in this PR first. |
change capslock to only capital for first letter
Changes NoiseModel -> ArNoiseModel ArmaModel -> ArmaNoiseModel
Co-authored-by: Raoul Collenteur <raoulcollenteur@gmail.com> Co-authored-by: Davíd Brakenhoff <d.brakenhoff@artesia-water.nl>
…he future With permission of @martinvonk !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is ready to go.
Big but important step forward.
Short Description
This Pull Request does not add a noisemodel to the Model class by default anymore.
See issue #735 for more information.
Checklist before PR can be merged: