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

Add support for dynamical simulation unit systems (G=1 or other value) #225

Merged
merged 14 commits into from
Oct 17, 2024

Conversation

adrn
Copy link
Contributor

@adrn adrn commented Oct 16, 2024

This is to add support for unit systems where only two of three of {length, mass, time} units need to be specified because the value of G is set to 1 (or some other value). This is analogous to Gala's SimulationUnitSystem.

For the value of G, I was originally planning to accept unxt.Quantity | float | int. But I think this needs to be a concrete value as the computed units need to be passed to unxt.units(), which under the hood calls astropy.units.Unit. So the current approach accepts astropy.units.Quantity | float | int, but now I'm thinking that this should instead require only float | int because it doesn't really make sense to allow someone to pass in a unit-ful G. That would also simplify some logic here. Thoughts?

@adrn adrn added this to the v0.18.x milestone Oct 16, 2024
Copy link

codecov bot commented Oct 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.11%. Comparing base (31f7560) to head (a73f9e1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
+ Coverage   96.03%   96.11%   +0.07%     
==========================================
  Files          41       41              
  Lines        1565     1596      +31     
==========================================
+ Hits         1503     1534      +31     
  Misses         62       62              

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

src/unxt/_src/units/system/core.py Show resolved Hide resolved
src/unxt/_src/units/system/core.py Outdated Show resolved Hide resolved
Copy link
Contributor

@nstarman nstarman left a comment

Choose a reason for hiding this comment

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

It all looks good! My only thing is it feels like we can shorten the names.

src/unxt/_src/units/system/core.py Outdated Show resolved Hide resolved
@nstarman nstarman merged commit f28bdfd into GalacticDynamics:main Oct 17, 2024
16 checks passed
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