-
Notifications
You must be signed in to change notification settings - Fork 701
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 ts from writers #2754
Remove ts from writers #2754
Conversation
@@ -57,4 +57,9 @@ def __init__(self, filename, **kwargs): | |||
pass | |||
|
|||
def _write_next_frame(self, obj): | |||
try: |
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 went ahead and added this check to the null writer. My understanding is that the null writer should behave like all other writers, so it should complain if we pass it a Timestep. Thoughts anyone?
Sounds sane
…On Sun, Jun 14, 2020 at 16:13, Irfan Alibay ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In package/MDAnalysis/coordinates/null.py
<#2754 (comment)>
:
> @@ -57,4 +57,9 @@ def __init__(self, filename, **kwargs):
pass
def _write_next_frame(self, obj):
+ try:
I went ahead and added this check to the null writer. My understanding is
that the null writer should behave like all other writers, so it should
complain if we pass it a Timestep. Thoughts anyone?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2754 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACGSGB7H37PP2YZLKSKZQLTRWTSIVANCNFSM4N5LZTIQ>
.
|
Codecov Report
@@ Coverage Diff @@
## develop #2754 +/- ##
===========================================
+ Coverage 91.17% 91.19% +0.01%
===========================================
Files 176 176
Lines 23798 23767 -31
Branches 3134 3118 -16
===========================================
- Hits 21699 21674 -25
+ Misses 1476 1473 -3
+ Partials 623 620 -3
Continue to review full report at Codecov.
|
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.
A few comments but looking good
@@ -357,31 +353,24 @@ def write(self, obj): | |||
*resName* and *atomName* are truncated to a maximum of 5 characters | |||
.. versionchanged:: 0.16.0 | |||
`frame` kwarg has been removed | |||
.. deprecated:: 1.0.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.
I think we’re meant to keep the old tag and just keep appending new stuff
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 came up before in: #2494 (comment) and I think the idea at the time was to remove deprecation notices since they get replaced by the versionchanged.
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 am glad that you have a good memory @IAlibay !
I added a section under Writing Documentation: Documenting changes to capture what I believe is our current consensus. It's up for discussion, of course.
@lilyminium I know that the User Guide copied most of the wiki style guide so I created PR MDAnalysis/UserGuide#76 with these changes.
ts = ag | ||
else: | ||
try: | ||
ts = ag.ts |
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.
Constructing an AtomGroup timestep ain’t free, so maybe use ag.positions to grab the positions etc
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.
So from a quick look, I think DCD, TRJ, TRR, TRZ, XTC, XYZ, and chemfiles all do something similar. In the interest of not making this PR too hard to follow, would you be ok if I opened an issue for this and dealt with it in a separate PR?
@@ -307,7 +307,12 @@ def encode_block(self, obj): | |||
obj : AtomGroup or Universe | |||
""" | |||
# Issue 2717 | |||
obj = obj.atoms | |||
try: | |||
obj = obj.atoms |
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’d hope stuff is type checked by this point
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 this is the failure point if you pass a Timestep object to the MOL2Writer. I could move it up to _write_next_frame if you think it's more appropriate?
""" | ||
# TODO 2.0: Remove Timestep logic | ||
if isinstance(obj, base.Timestep): |
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.
Same here, put a type check in base.Write
* Removes deprecated timestep input to writers
Towards #2739
Changes made in this Pull Request:
atoms
to XYZWriter (code paths here no longer worked since we removed support for Timestep).To do:
PR Checklist