Remove ts from writers#2754
Conversation
| pass | ||
|
|
||
| def _write_next_frame(self, obj): | ||
| try: |
There was a problem hiding this comment.
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.
|
richardjgowers
left a comment
There was a problem hiding this comment.
A few comments but looking good
| *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.
I think we’re meant to keep the old tag and just keep appending new stuff
There was a problem hiding this comment.
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.
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.
Constructing an AtomGroup timestep ain’t free, so maybe use ag.positions to grab the positions etc
There was a problem hiding this comment.
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?
| # Issue 2717 | ||
| obj = obj.atoms | ||
| try: | ||
| obj = obj.atoms |
There was a problem hiding this comment.
I’d hope stuff is type checked by this point
There was a problem hiding this comment.
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?
| Use AtomGroup or Universe as an input instead. | ||
| """ | ||
| # TODO 2.0: Remove Timestep logic | ||
| if isinstance(obj, base.Timestep): |
There was a problem hiding this comment.
Same here, put a type check in base.Write
* Removes deprecated timestep input to writers
Towards #2739
Changes made in this Pull Request:
atomsto XYZWriter (code paths here no longer worked since we removed support for Timestep).To do:
PR Checklist