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

Updates to trait systems #29

Merged
merged 7 commits into from
Aug 17, 2024
Merged

Updates to trait systems #29

merged 7 commits into from
Aug 17, 2024

Conversation

denehoffman
Copy link
Owner

This update update the Field trait by removing the nalgebra::RealField subtrait. This also allows for the removal of f-prefixed math methods. Rather than deprecate a ton of methods, I've chosen to just remove them, making this a rather breaking update (although I doubt anyone is using this crate so this is mostly just documentation for my own sake). A similar process was carried out in ganesh, so that has also been updated.

Other changes

  • Adds some macros (convert!, convert_vec!, and convert_array!) to make it easier to convert raw values to generics.
  • Adds Event::eps_mag() for getting the magnitude of the EPS vector and a new trait UnitVector which provides a method unit() that is implemented for nalgebra::Vector3 to quickly get a unit vector without needing RealField's normalize() method.

Additionally, I have removed the f-prefixed mathematical functions, since the only conflicts were with the `nalgebra` implementations. From now on, we will prefer using `num` traits and building in additional functionality. This also adds several convenience methods for getting the magnitude of EPS and normalized `Vector3` fields using the new `unit` method to avoid requiring `RealField` for this very simple operation. Additionally, several macros are added to make conversion from raw values easier. In the future, trait implementations might be added as well to provide shortcuts to these methods, but that is a WIP.
@denehoffman denehoffman merged commit ba0401b into main Aug 17, 2024
15 checks passed
@denehoffman denehoffman deleted the development branch August 17, 2024 23:59
Copy link

codecov bot commented Aug 18, 2024

Codecov Report

Attention: Patch coverage is 26.29870% with 227 lines in your changes missing coverage. Please review.

Project coverage is 18.95%. Comparing base (87294ea) to head (b49f649).
Report is 10 commits behind head on main.

Files Patch % Lines
crates/rustitude-gluex/src/sdmes.rs 0.00% 59 Missing ⚠️
crates/rustitude-gluex/src/utils.rs 29.16% 34 Missing ⚠️
crates/rustitude-gluex/src/polarization.rs 0.00% 32 Missing ⚠️
crates/rustitude-core/src/dataset.rs 7.69% 24 Missing ⚠️
crates/rustitude-gluex/src/dalitz.rs 0.00% 24 Missing ⚠️
crates/rustitude-gluex/src/harmonics.rs 25.92% 20 Missing ⚠️
crates/rustitude-gluex/src/resonances.rs 68.57% 11 Missing ⚠️
crates/rustitude-core/src/manager.rs 20.00% 8 Missing ⚠️
crates/rustitude-core/src/four_momentum.rs 77.77% 6 Missing ⚠️
crates/rustitude-core/src/amplitude.rs 16.66% 5 Missing ⚠️
... and 2 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #29      +/-   ##
==========================================
- Coverage   19.22%   18.95%   -0.28%     
==========================================
  Files          22       22              
  Lines        4223     4121     -102     
==========================================
- Hits          812      781      -31     
+ Misses       3411     3340      -71     

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

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.

1 participant