Skip to content

Conversation

@ollyfutur
Copy link
Contributor

Hello,

Binary operations on two Grid objects with different edges parameters should raise a TypeError as stated in the docstring of Grid.check_compatible.

This pull request implements the expected behavior, and also allows operations with non-Grid objects that are broadcastable to the Grids shape, such as numpy.ndarray. This is why I removed the test

            data['grid'].check_compatible("foo")

since the string "foo" is broadcastable to any array shape, it does not raise in check_compatible (an error will probably be raised downstream anyways for any such operation).

I also modified the docstrings accordingly and added a couple of tests.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.70%. Comparing base (8b55865) to head (0186a70).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #142      +/-   ##
==========================================
+ Coverage   87.60%   87.70%   +0.09%     
==========================================
  Files           5        5              
  Lines         742      748       +6     
  Branches       96       97       +1     
==========================================
+ Hits          650      656       +6     
  Misses         56       56              
  Partials       36       36              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

Looking all good.

Please also

  • add yourself to AUTHORS
  • update CHANGES

@orbeckst orbeckst self-assigned this Dec 9, 2025
@ollyfutur ollyfutur requested a review from orbeckst December 9, 2025 10:24
- bumped next release to 1.1.0 because this PR contains enhancements
- sorted entries for CHANGELOG
Copy link
Member

@orbeckst orbeckst left a comment

Choose a reason for hiding this comment

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

All looking good, thank you for your contribution.

This will go into a new 1.1.0 release.

@orbeckst orbeckst merged commit ac91fef into MDAnalysis:master Dec 9, 2025
10 checks passed
@orbeckst
Copy link
Member

orbeckst commented Dec 9, 2025

Thank you @ollyfutur !

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.

2 participants