Skip to content

Fix rotation matrix is None#300

Merged
jan-janssen merged 2 commits intomainfrom
rotation
Jan 24, 2026
Merged

Fix rotation matrix is None#300
jan-janssen merged 2 commits intomainfrom
rotation

Conversation

@jan-janssen
Copy link
Copy Markdown
Member

@jan-janssen jan-janssen commented Jan 24, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of pressure tensor transformation by adding validation to prevent errors when rotation matrix is unavailable. The system now gracefully processes this scenario.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jan 24, 2026

📝 Walkthrough

Walkthrough

A guard condition is added to the _pressure_to_lammps function to check that rotation_matrix is not None before using it. This defensive check prevents potential errors when the parameter is missing while preserving existing logic.

Changes

Cohort / File(s) Summary
Rotation Matrix Guard
src/pyiron_lammps/compatibility/calculate.py
Added None check for rotation_matrix parameter in _pressure_to_lammps function to prevent evaluating rotation-based pressure tensor transformation when the matrix is absent

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit hops through code so bright,
Adding guards to keep things right—
No more None shall cause a fright,
When rotation's missing from sight! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly addresses the main change: adding a guard to handle when rotation_matrix is None in the _pressure_to_lammps function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.33%. Comparing base (de41322) to head (43263f7).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #300   +/-   ##
=======================================
  Coverage   82.33%   82.33%           
=======================================
  Files          11       11           
  Lines        1155     1155           
=======================================
  Hits          951      951           
  Misses        204      204           

☔ 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.

@jan-janssen jan-janssen merged commit 06ab1f2 into main Jan 24, 2026
21 checks passed
@jan-janssen jan-janssen deleted the rotation branch January 24, 2026 23:18
@coderabbitai coderabbitai bot mentioned this pull request Jan 25, 2026
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