-
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
ENH: support pathlib in ReaderBase #3935
ENH: support pathlib in ReaderBase #3935
Conversation
* the creation of a `Universe` object involving GROMACS formats should now accept `pathlib` objects as requested in MDAnalysisgh-2497; resolving that issue entirely is a separate matter, this branch focuses only on the GROMACS format and only if you proceed via the public `Universe` creation API * probably could make it work in Cython directly, though I'm not convinced we need to do that for this part of the fix at least, and we probably should still support strings as well of course
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.
Shouldn't this be a ReaderBase thing instead to store self.filename properly?
Codecov ReportBase: 94.36% // Head: 94.36% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## develop #3935 +/- ##
========================================
Coverage 94.36% 94.36%
========================================
Files 194 194
Lines 25109 25115 +6
Branches 3398 3399 +1
========================================
+ Hits 23694 23700 +6
Misses 1366 1366
Partials 49 49
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Seconding this, can this not be dealt with at |
* move the handling of `pathlib` objects upstream to `ReaderBase` based on reviewer feedback * add one more format test related to this
Ok, I moved the patch to I think that's probably good enough for now, but note that:
|
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.
Assuming this passes tests I'm happy for this PR to go through. @tylerjereddy could you raise an issue about the missing bits? Maybe we should move stuff to ProtoReader in the future but it seems fine for this current issue?
Eh, the failure is related--this is the problem with inheritance... I'd just as soon scope this back to GROMACS and move on. I'll see if I can add a shim to fix it though. |
* `NamedStream` gets special treatment (no string coercion) in `ReaderBase`
Ok, I pushed in a commit to shim around our gh-3937 contains the the follow-up reminders I noted above. |
LGTM @tylerjereddy |
Ok, I have approvals from 3 core developers and CI is passing, in it goes. |
the creation of a
Universe
object involving GROMACS formats should now acceptpathlib
objects as requested in Using pathlib Path object #2497; resolving that issue entirely is a separate matter, this branch focuses only on the GROMACS format and only if you proceed via the public
Universe
creation APIprobably could make it work in Cython directly, though I'm not convinced we need to do that for this part of the fix at least, and we probably should still support strings as well of course