Skip to content

Make Orbit propkw equality and hashing consistent - #140

Merged
SuperdoerTrav merged 2 commits into
llnl:mainfrom
sylvesterkaczmarek:fix/orbit-equality-hash
Sep 19, 2026
Merged

SuperdoerTrav merged 2 commits into
llnl:mainfrom
sylvesterkaczmarek:fix/orbit-equality-hash

Conversation

@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor

Summary

Make Orbit equality and hashing consistent for propagation keyword mappings.

Changes

  • Require matching propkw key sets before comparing values.
  • Return NotImplemented when comparing an Orbit with an unrelated type.
  • Hash propkw entries in sorted-key order so insertion order does not affect identity.
  • Canonicalise scalar and array propkw values before hashing, allowing ordinary scalar values such as area=2.0.
  • Add regression coverage for asymmetric key sets, reversed comparisons, reordered mappings, and scalar hashing.

Testing

  • python3 -m py_compile ssapy/orbit.py tests/test_orbit.py
  • git diff --check

The local environment does not have the SSAPy pytest dependency stack installed, so the repository CI will provide the full test run.

Fixes #139

@codecov-commenter

codecov-commenter commented Aug 29, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.39%. Comparing base (a895a5b) to head (b2a03f7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage   97.39%   97.39%           
=======================================
  Files          17       17           
  Lines        5820     5829    +9     
=======================================
+ Hits         5668     5677    +9     
  Misses        152      152           
Flag Coverage Δ
unittests 97.39% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
ssapy/orbit.py 98.93% <100.00%> (+0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@SuperdoerTrav
SuperdoerTrav merged commit 0352e70 into llnl:main Sep 19, 2026
5 checks passed
@sylvesterkaczmarek

Copy link
Copy Markdown
Contributor Author

Thank you for merging this. I really appreciate it, and I’m glad to keep contributing to SSAPy.

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.

Orbit equality and hashing are inconsistent for propkw mappings

3 participants