Skip to content
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

pin distopia<0.3.0 #4740

Merged
merged 2 commits into from
Oct 19, 2024
Merged

pin distopia<0.3.0 #4740

merged 2 commits into from
Oct 19, 2024

Conversation

orbeckst
Copy link
Member

@orbeckst orbeckst commented Oct 18, 2024

Fixes #4739

Changes made in this Pull Request:

  • temporarily restrict distopia in CI to >=0.2.0,<0.3.0 until MDAnalysis has caught up with distopia API changes
  • updated CHANGELOG
  • version check in code

PR Checklist

  • Tests?
  • Docs?
  • CHANGELOG updated?
  • Issue raised/referenced?

Developers certificate of origin


📚 Documentation preview 📚: https://mdanalysis--4740.org.readthedocs.build/en/4740/

Copy link

codecov bot commented Oct 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.58%. Comparing base (48e9e01) to head (6adbf74).
Report is 59 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4740      +/-   ##
===========================================
- Coverage    93.60%   93.58%   -0.02%     
===========================================
  Files          173      185      +12     
  Lines        21464    22536    +1072     
  Branches      2993     2994       +1     
===========================================
+ Hits         20091    21090     +999     
- Misses         929     1002      +73     
  Partials       444      444              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@orbeckst orbeckst requested review from IAlibay and hmacdope October 18, 2024 23:27
@@ -78,6 +78,7 @@ Enhancements
DOI 10.1021/acs.jpcb.7b11988. (Issue #2039, PR #4524)

Changes
* only use distopia < 0.3.0 due to API changes (Issue #4739)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we would normally make a CHANGELOG entry but in this case I would recommend to do so because there is not other part in the user-visible code base that knows about this requirement. If someone installs distopia by themselves, they will see failures.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now they will (hopefully) a warning

../package/MDAnalysis/lib/_distopia.py:45
  ~/MDAnalysis/mdanalysis/package/MDAnalysis/lib/_distopia.py:45: RuntimeWarning: Install 'distopia>=0.2.0,<0.3.0' to be used with this release of MDAnalysis. Your installed version of distopia >=0.3.0 will NOT be used.
    warnings.warn("Install 'distopia>=0.2.0,<0.3.0' to be used with this release "

- fix  #4739
- temporarily restrict distopia to >=0.2.0,<0.3.0 until MDAnalysis has
  caught up with distopia API changes
- updated CHANGELOG
Copy link
Member

@hmacdope hmacdope left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM @orbeckst, thanks for fixing.

@hmacdope
Copy link
Member

Merge when ready

@orbeckst
Copy link
Member Author

Let's hold on merging. I think @IAlibay also wanted a version check in the code and I agree as this will at least catch the issue with users installing distopia >= 0.3.0. Given the loose coupling between MDA and distopia, it seems necessary and you can then recycle it immediately for PR #4734 .

@pep8speaks
Copy link

pep8speaks commented Oct 19, 2024

Hello @orbeckst! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2024-10-19 01:11:18 UTC

- only enable HAS_DISTOPIA if the appropriate version of distopia is installed
- issue RuntimeWarning if incorrect version present
- added test
@hmacdope
Copy link
Member

I will make a patch release for distopia that has __version__, sorry thats my bad.

@orbeckst
Copy link
Member Author

I tested locally with distopia==0.2.0 and distopia=0.3.0 and the code behaves as it should: it fails for neither but warns for 0.3.0 and falls back to HAS_DISTOPIA=False.

# check for compatibility: currently needs to be >=0.2.0,<0.3.0 (issue
# #4740) No distopia.__version__ available so we have to do some probing.
needed_funcs = ['calc_bonds_no_box_float', 'calc_bonds_ortho_float']
has_distopia_020 = all([hasattr(distopia, func) for func in needed_funcs])
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no distopia.__version__ attribute that I could check so I am explicitly probing for the functions we need.

@hmacdope is there a better way to get the version of the installed distopia package?

Copy link
Member

@hmacdope hmacdope Oct 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ See comment above, I will make a patch release, I accidentally removed __version__

@@ -788,9 +790,10 @@ def test_pbc_wrong_wassenaar_distance(self, backend):
# expected.
assert np.linalg.norm(point_a - point_b) != dist[0, 0]

@pytest.mark.parametrize("box",

@pytest.mark.parametrize("box",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pep8 fix

Copy link
Member

@IAlibay IAlibay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @orbeckst !

@orbeckst
Copy link
Member Author

I'll merge with the clunky version probe to move things along and if needed we improve when there's a distopia 0.3.1.

@orbeckst orbeckst self-assigned this Oct 19, 2024
@orbeckst orbeckst merged commit caa04ec into develop Oct 19, 2024
23 of 24 checks passed
@orbeckst orbeckst deleted the pin-distopia branch October 19, 2024 02:24
@orbeckst orbeckst mentioned this pull request Oct 19, 2024
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pin to distopia < 0.3 ahead of v2.8.0 release
4 participants