-
Notifications
You must be signed in to change notification settings - Fork 658
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
Add AtomGroup stub, fixes #1067 #1070
Conversation
Universe = deprecate_class(universe.Universe, | ||
"MDAnalysis.core.AtomGroup.Universe has been removed." | ||
"Please use MDAnalaysis.core.universe.Universe." | ||
"This stub will be removed in 1.0") |
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.
Any suggestions if the message is OK?
I've been thinking we should move common things to the top namespace, so On Tue, 8 Nov 2016, 9:40 p.m. Max Linke, [email protected] wrote:
|
How would that help with the deprecation warnings I introduced here? If one uses |
For the error messages, you should just recommend the top namespace On Tue, 8 Nov 2016, 9:45 p.m. Max Linke, [email protected] wrote:
|
Good idea I can do that for the universe. For the others we don't have top name space imports. So I would leave the others as they are right now. |
def test_usage_warning(): | ||
with warnings.catch_warnings(record=True) as warn: | ||
warnings.simplefilter('always') | ||
mda.core.AtomGroup.Universe(PSF, DCD) |
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.
How can I initialize the other classes to trigger a warning?
Would using a naked AtomGroup still work like it did before 0.16.0? |
The new signature for Group is |
How would I initialize an Atomgroup in 0.15.0? My current solution won't work at all if I can't make the classes in |
It would have been |
@richardjgowers Thanks for the changes. I'll do some final clean up on the weekend. |
Yeah I can't see a way for (single) Atom, Res and Seg to work, so they On Fri, 11 Nov 2016, 4:10 p.m. Max Linke, [email protected] wrote:
|
Wouldn't |
Any class used from this module will raise a warning. The classes work without needed to be specially imported.
0e9b036
to
a7860bc
Compare
@richardjgowers I see now what you mean with the Atom/Residue/Segment classes. I don't think there is a nice way to enable the use. I don't even know how to add a nice error message that catches all relevant cases. So assuming that no one used single Atoms a lot I would leave it as is now. The most important classes are covered. |
* Add AtomGroup stub Any class used from this module will raise a warning. The classes work without needed to be specially imported. * fix Universe Warning Message * update changelog * add test for deprecation warning * Added compatibility for old AtomGroup init methods * Added tests for deprecated Group init methods
* Completes MDAnalysis#1070 and moves us towards v1.0 MDAnalysis#2443 * Removed AtomGroup stubs. * Removed unnecessary import from groups.py * Removes deprecation test * Update CHANGELOG
Fixes #1067
Changes made in this Pull Request:
Any class used from this module will raise a warning. The classes work
without needed to be specially imported. This should work best for other other.
I would also like that a warning is raised when someone calls
from MDAnalysis.core import AtomGroup
but I think that might be impossible.PR Checklist
[ ] Docs?