Skip to content

Comments

Adding some more astro units#196

Merged
MilesCranmer merged 1 commit intoJuliaPhysics:mainfrom
icweaver:astro
Jan 5, 2026
Merged

Adding some more astro units#196
MilesCranmer merged 1 commit intoJuliaPhysics:mainfrom
icweaver:astro

Conversation

@icweaver
Copy link
Contributor

Following up from #25

Added a few cgs and other units that show up in astro fairly regularly

@github-actions
Copy link
Contributor

Benchmark Results (Julia v1.10)

Time benchmarks
main 87266a1... main / 87266a1...
Quantity/creation/Quantity(x) 2.79 ± 0.01 ns 3.41 ± 0.001 ns 0.82 ± 0.0029
Quantity/creation/Quantity(x, length=y) 3.41 ± 0.01 ns 3.11 ± 0.001 ns 1.1 ± 0.0032
Quantity/with_numbers/*real 3.1 ± 0.01 ns 3.1 ± 0.01 ns 1 ± 0.0046
Quantity/with_numbers/^int 8.05 ± 2.2 ns 8.05 ± 2.2 ns 1 ± 0.38
Quantity/with_numbers/^int * real 8.36 ± 1.9 ns 8.68 ± 2.5 ns 0.963 ± 0.35
Quantity/with_quantity/+y 4.04 ± 0.001 ns 4.04 ± 0.001 ns 1 ± 0.00035
Quantity/with_quantity//y 3.11 ± 0.01 ns 3.42 ± 0.01 ns 0.909 ± 0.004
Quantity/with_self/dimension 3.1 ± 0.01 ns 3.11 ± 0.01 ns 0.997 ± 0.0045
Quantity/with_self/inv 3.11 ± 0.01 ns 3.11 ± 0.001 ns 1 ± 0.0032
Quantity/with_self/ustrip 2.79 ± 0.01 ns 2.79 ± 0.01 ns 1 ± 0.0051
QuantityArray/broadcasting/multi_array_of_quantities 0.14 ± 0.0027 ms 0.143 ± 0.0029 ms 0.983 ± 0.027
QuantityArray/broadcasting/multi_normal_array 0.0529 ± 0.003 ms 0.0558 ± 0.003 ms 0.948 ± 0.075
QuantityArray/broadcasting/multi_quantity_array 0.157 ± 0.0011 ms 0.155 ± 0.00089 ms 1.01 ± 0.0093
QuantityArray/broadcasting/x^2_array_of_quantities 23.2 ± 1.8 μs 25.4 ± 2.7 μs 0.916 ± 0.12
QuantityArray/broadcasting/x^2_normal_array 5.45 ± 0.78 μs 4.77 ± 0.85 μs 1.14 ± 0.26
QuantityArray/broadcasting/x^2_quantity_array 6.91 ± 0.24 μs 6.97 ± 0.31 μs 0.991 ± 0.056
QuantityArray/broadcasting/x^4_array_of_quantities 0.0816 ± 0.00061 ms 0.0815 ± 0.00058 ms 1 ± 0.01
QuantityArray/broadcasting/x^4_normal_array 0.0498 ± 0.00019 ms 0.0498 ± 0.0002 ms 1 ± 0.0056
QuantityArray/broadcasting/x^4_quantity_array 0.053 ± 0.0016 ms 0.05 ± 0.003 ms 1.06 ± 0.072
time_to_load 0.203 ± 0.00089 s 0.204 ± 0.00037 s 0.997 ± 0.0047
Memory benchmarks
main 87266a1... main / 87266a1...
Quantity/creation/Quantity(x) 0 allocs: 0 B 0 allocs: 0 B
Quantity/creation/Quantity(x, length=y) 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/*real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int * real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity/+y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity//y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/dimension 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/inv 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/ustrip 0 allocs: 0 B 0 allocs: 0 B
QuantityArray/broadcasting/multi_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/multi_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/multi_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^2_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^2_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^2_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^4_array_of_quantities 2 allocs: 0.382 MB 2 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^4_normal_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
QuantityArray/broadcasting/x^4_quantity_array 2 allocs: 0.0763 MB 2 allocs: 0.0763 MB 1
time_to_load 0.153 k allocs: 14.5 kB 0.153 k allocs: 14.5 kB 1

@github-actions
Copy link
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main 87266a1... main / 87266a1...
Quantity/creation/Quantity(x) 3.1 ± 0.01 ns 3.1 ± 0.01 ns 1 ± 0.0046
Quantity/creation/Quantity(x, length=y) 4.34 ± 0.01 ns 3.41 ± 0.01 ns 1.27 ± 0.0048
Quantity/with_numbers/*real 3.11 ± 0.01 ns 3.41 ± 0.01 ns 0.912 ± 0.004
Quantity/with_numbers/^int 12.1 ± 1 ns 12.1 ± 0.99 ns 1 ± 0.12
Quantity/with_numbers/^int * real 12.6 ± 1.1 ns 11.8 ± 0.99 ns 1.07 ± 0.13
Quantity/with_quantity/+y 4.85 ± 0.1 ns 4.04 ± 0.001 ns 1.2 ± 0.025
Quantity/with_quantity//y 3.42 ± 0.011 ns 3.42 ± 0.01 ns 1 ± 0.0044
Quantity/with_self/dimension 2.79 ± 0 ns 2.79 ± 0.001 ns 1 ± 0.00036
Quantity/with_self/inv 3.11 ± 0.01 ns 3.42 ± 0.01 ns 0.909 ± 0.004
Quantity/with_self/ustrip 2.79 ± 0 ns 2.79 ± 0 ns 1 ± 0
QuantityArray/broadcasting/multi_array_of_quantities 0.112 ± 0.0047 ms 0.112 ± 0.0042 ms 1 ± 0.056
QuantityArray/broadcasting/multi_normal_array 0.0471 ± 0.00035 ms 0.0471 ± 0.00027 ms 1 ± 0.0094
QuantityArray/broadcasting/multi_quantity_array 0.0501 ± 0.00052 ms 0.056 ± 0.00017 ms 0.895 ± 0.0097
QuantityArray/broadcasting/x^2_array_of_quantities 13.7 ± 2.2 μs 14 ± 2.8 μs 0.978 ± 0.25
QuantityArray/broadcasting/x^2_normal_array 2.11 ± 2.3 μs 2.16 ± 2.1 μs 0.977 ± 1.4
QuantityArray/broadcasting/x^2_quantity_array 3.57 ± 0.43 μs 3.54 ± 0.29 μs 1.01 ± 0.15
QuantityArray/broadcasting/x^4_array_of_quantities 0.0814 ± 0.00064 ms 0.0814 ± 0.00091 ms 1 ± 0.014
QuantityArray/broadcasting/x^4_normal_array 0.0436 ± 0.0002 ms 0.0436 ± 0.00017 ms 1 ± 0.0061
QuantityArray/broadcasting/x^4_quantity_array 0.0437 ± 0.0031 ms 0.0438 ± 0.0093 ms 0.999 ± 0.22
time_to_load 0.19 ± 0.0028 s 0.188 ± 0.0015 s 1.01 ± 0.017
Memory benchmarks
main 87266a1... main / 87266a1...
Quantity/creation/Quantity(x) 0 allocs: 0 B 0 allocs: 0 B
Quantity/creation/Quantity(x, length=y) 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/*real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_numbers/^int * real 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity/+y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_quantity//y 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/dimension 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/inv 0 allocs: 0 B 0 allocs: 0 B
Quantity/with_self/ustrip 0 allocs: 0 B 0 allocs: 0 B
QuantityArray/broadcasting/multi_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/multi_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/multi_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^2_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^2_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^2_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^4_array_of_quantities 3 allocs: 0.382 MB 3 allocs: 0.382 MB 1
QuantityArray/broadcasting/x^4_normal_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
QuantityArray/broadcasting/x^4_quantity_array 3 allocs: 0.0764 MB 3 allocs: 0.0764 MB 1
time_to_load 0.145 k allocs: 11 kB 0.145 k allocs: 11 kB 1

@codecov
Copy link

codecov bot commented Nov 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.14%. Comparing base (dfba00c) to head (87266a1).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #196   +/-   ##
=======================================
  Coverage   99.14%   99.14%           
=======================================
  Files          21       21           
  Lines        1292     1292           
=======================================
  Hits         1281     1281           
  Misses         11       11           

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

@icweaver
Copy link
Contributor Author

icweaver commented Dec 9, 2025

Howdy, would you like to see anything different for this? Happy to make any changes!

@icweaver
Copy link
Contributor Author

Gentle ping @MilesCranmer

@icweaver
Copy link
Contributor Author

icweaver commented Jan 1, 2026

Happy new year! Just checking back in on if anything else is needed for this

@MilesCranmer
Copy link
Member

@codex please review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 🎉

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Member

@MilesCranmer MilesCranmer left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks and sorry for the delayed review.

@MilesCranmer MilesCranmer merged commit 33d2b7d into JuliaPhysics:main Jan 5, 2026
7 checks passed
@icweaver
Copy link
Contributor Author

icweaver commented Jan 5, 2026

No worries, appreciate you taking a look!

@icweaver icweaver deleted the astro branch January 5, 2026 23:57
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