-
Notifications
You must be signed in to change notification settings - Fork 652
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
Move ConverterBase out of coordinates/base.py #4253
Conversation
f = f.upper() | ||
_CONVERTERS[f] = cls | ||
|
||
class ConverterBase(IOBase, metaclass=_Convertermeta): |
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.
We can't just purely move this out of here without some kind of deprecation window.
Could you maybe subclass the ConverterBase here and add a warning in __init_subclass__
?
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.
Unfortunately that leads to a circular reference. Instead I include the code in both base.py
files but have a deprecation warning when the ConverterBase
from coordinates
is subclassed.
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.
This solution works for me and the comments make clear what to do. I also really don't have a more elegant solution.
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.
Ok that makes sense - we definitely need tests to check that each respective subclass does / doesn't raise the warning.
Linter Bot Results:Hi @ianmkenney! Thanks for making this PR. We linted your code and found the following: Some issues were found with the formatting of your code.
Please have a look at the Please note: The |
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## develop #4253 +/- ##
===========================================
- Coverage 93.40% 93.39% -0.01%
===========================================
Files 169 184 +15
Lines 22204 23333 +1129
Branches 4064 4065 +1
===========================================
+ Hits 20740 21793 +1053
- Misses 948 1024 +76
Partials 516 516
☔ View full report in Codecov by Sentry. |
cf324e4
to
16a3b01
Compare
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.
Looks good but needs a test for the deprecation. See other tests that check for the DeprecationWarning
and the specific message.
f = f.upper() | ||
_CONVERTERS[f] = cls | ||
|
||
class ConverterBase(IOBase, metaclass=_Convertermeta): |
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.
This solution works for me and the comments make clear what to do. I also really don't have a more elegant solution.
f = f.upper() | ||
_CONVERTERS[f] = cls | ||
|
||
class ConverterBase(IOBase, metaclass=_Convertermeta): |
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.
Ok that makes sense - we definitely need tests to check that each respective subclass does / doesn't raise the warning.
980bec1
to
a8b3a2b
Compare
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.
Thanks for adding the tests. You addressed everything that I had seen. I think you also addressed all of @IAlibay 's comments but I leave it to him to judge.
I checked the docs and they look fine. I am not 100% convinced that we need a versionadded 2.7.0
for the MDAnalysis.converters.base
docs because it might be a bit confusing as it really had been present since 2.0.0, just not in this place, but I could be convinced either way and leave this to you if you want to add it.
I would assume a |
@ianmkenney @orbeckst - yes my comments have been addressed, but I'm going to keep the block for now because I think we're back in another merge freeze (for non bugfixes). |
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.
lgtm - unblocking now the release is done
Fixes #3404
Changes made in this Pull Request:
PR Checklist
Developers certificate of origin