Fix/gsd numpy int64 indexing issue 5224#5260
Conversation
There was a problem hiding this comment.
Hello there first time contributor! Welcome to the MDAnalysis community! We ask that all contributors abide by our Code of Conduct and that first time contributors introduce themselves on GitHub Discussions so we can get to know you. You can learn more about participating here. Please also add yourself to package/AUTHORS as part of this PR.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #5260 +/- ##
===========================================
- Coverage 93.82% 93.82% -0.01%
===========================================
Files 180 180
Lines 22476 22477 +1
Branches 3191 3191
===========================================
Hits 21089 21089
- Misses 924 925 +1
Partials 463 463 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
jeremyleung521
left a comment
There was a problem hiding this comment.
Just nitpicky stuff but looks good to me.
| from numpy.testing import assert_almost_equal | ||
|
|
||
| import MDAnalysis as mda | ||
| import numpy as np |
There was a problem hiding this comment.
import numpy should probably be imported above import pytest.
There was a problem hiding this comment.
Actually I'm having doubts, sorry. The code coverage is claiming there is 0% coverage, which means the _read_frame method might not be called in the new test using []. Might be worth double checking that. It's a nested funnel of subclasses so it's a little difficult to track.
having second doubts due to the code coverage failure
b84323f to
b9f22ec
Compare
|
Hi @jeremyleung521 , |
Makes sense! Thanks for testing/looking through it. I'll ping @yuxuanzhuang just in case since he removed the GSD tests but LGTM otherwise now! |
|
@yuxuanzhuang @IAlibay did we remove GSD from standard CI and only run in CRON CI? |
orbeckst
left a comment
There was a problem hiding this comment.
@kunjsinha can you please run your newly added test locally in an environment that contains gsd? Also run it with coverage.
Show how you've been running the test and the output that demonstrates
- test fails WITHOUT your fix
- test passes with your fix
- coverage of your code
(look at pytest and coverage to learn how to do these things)
I'd basically like to see evidence that the tests work when GSD is present, even though we cannot currently verify this in CI. Thank you!
|
@orbeckst I've ran everything locally with Without the fix (commented out With the fix: I used the command For the coverage, i ran
|
Yeah, gsd caused our tests to fail randomly. |
orbeckst
left a comment
There was a problem hiding this comment.
lgtm, thanks for doing the manual test

Fixes #5224
Changes made in this Pull Request:
TypeErrorwhen indexingGSDReadertrajectory withnp.int64frame = int(frame)inGSDReader._read_frametest_gsd_indexing_with_numpy_intintest_gsd.pyLLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.
📚 Documentation preview 📚: https://mdanalysis--5260.org.readthedocs.build/en/5260/