-
Notifications
You must be signed in to change notification settings - Fork 667
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 flag registry #782
Comments
Hopefully we can just replace where flags offered options with a kwarg to the function |
Yes, I hope so, too, but I didn't want to be overly prescriptive without properly reviewing the code in detail. |
Do we want to go through a transition phase with deprecation warnings? Or do we want to brutally remove the flags? I would go for the deprecation warnings. For a version or two, the flag replacement could be mirrors to the flags by default. The flags mechanism could then remain available, but with a deprecation warning. I do not know if these flags are actually used; I never used them, but they control some critical mechanisms such as using periodic boundary conditions or not. |
On 18 Mar, 2016, at 17:16, Jonathan Barnoud wrote:
If it's not difficult then slap on these deprecation warnings as soon as you can. If you get them into 0.15.0 then we can drop them in 0.16.0....
Yes, that was just a very, very horrible idea then. It makes it difficult to get reproducible behavior; I just hope most people never found out about it. Much better to use something like #759 . |
So here's a list of existing flags
We could add these all as kwargs to Universe init and make them boolean properties of Universe to recreate the behaviour. So u = mda.Universe(top, trj, length_unit='mile')
# OR
u.length_unit = 'mile'
# OR maybe
u.settings.length_unit = 'mile' These would allow you to define the default behaviour. |
I would like to get this done in 0.16.0 (so we don't have to write flags into the new system only to kill them), so maybe we need to push out some more deprecations in a 0.15.1 once we've decided what the new form is. |
My take on the current flags:
Any not needed should be effectively fixed at the current default. EDITS:
|
I would not deprecate. Instead, add a fake |
I did use the |
Thanks, I updated the list. |
I'm moving this to another milestone. 0.16.0 has enough breaking changes as it is. |
- closes #1383 - included deprecations: - #1373 Timeseries (targeted for 0.17) Note that the deprecation for core.Timeseries will always show up; this is deliberate so that users WILL see it as it will be gone in the next release! - #1377 Quick selectors (target 1.0) - #782 flags (target 1.0) - updated CHANGELOG
So for this to be completed, we need to add the kwargs for KDTree and periodic to |
If I follow well, The easiest way I see to implement these keywords would be to add them in I can implement this solution; but I would like to hear if you have better implementation ideas. |
- closes #1383 - included deprecations: - #1373 Timeseries (targeted for 0.17) Note that the deprecation for core.Timeseries will always show up; this is deliberate so that users WILL see it as it will be gone in the next release! - #1377 Quick selectors (target 1.0) - #782 flags (target 1.0) - updated CHANGELOG
- closes #1383 - included deprecations: - #1373 Timeseries (targeted for 0.17) Note that the deprecation for core.Timeseries will always show up; this is deliberate so that users WILL see it as it will be gone in the next release! - #1377 Quick selectors (target 1.0) - #782 flags (target 1.0) - updated CHANGELOG
What does remain to be done here after #2056? |
Sorry I have my own answer: actually removing the registry. I should not ask question before finishing my coffee. |
tl;dr: Get rid of MDAnalysis.core.flags and replace with the lightest solution possible
The flag registry in MDAnalysis.core.flags (in
MDAnalysis/core/__init__.py
) determines global behavior. In principle, these flags can be changed by the user but in practice this seems to be rarely done. In any case, changes are not persistent and have to be changed for a new python session manually by setting the flag.Action: remove MDAnalysis.core.flags
As discussed in #315 we decided that the flag registry in the current form does not serve a useful purpose and is too complicated for what it accomplishes. It should be reduced to the smallest and simplest data structure that is necessary, such as a simple dictionary or variables at the module level.
In particular there is currently no expectation that the user should be able to change any parameters in MDAnalysis that change the global behavior (such as changing the base units) because it adds additional assumptions to code and reduces portability.
Impact
Flags are used throughout the code to set defaults, e.g., in the readers and writers and some of the selections. All of this has to be changed.
Issues are marked with label Component-Configuration. In particular
The text was updated successfully, but these errors were encountered: