Skip to content

feat: add THz - #221

Merged
MilesCranmer merged 1 commit into
JuliaPhysics:mainfrom
icweaver:thz
May 16, 2026
Merged

MilesCranmer merged 1 commit into
JuliaPhysics:mainfrom
icweaver:thz

Conversation

@icweaver

Copy link
Copy Markdown
Contributor

Howdy, we needed this unit for an astropy tutorial on analyzing spectra that we are translating for our learn.JuliaAstro site. Would it be ok if we add this?

@github-actions

Copy link
Copy Markdown
Contributor

Benchmark Results (Julia v1.10)

Time benchmarks
main a52c29c... main / a52c29c...
Quantity/creation/Quantity(x) 2.31 ± 0.016 ns 2.31 ± 0.008 ns 1 ± 0.0077
Quantity/creation/Quantity(x, length=y) 2.33 ± 0.28 ns 2.33 ± 0.018 ns 1 ± 0.12
Quantity/with_numbers/*real 2.6 ± 0.001 ns 2.6 ± 0.001 ns 1 ± 0.00054
Quantity/with_numbers/^int 7.48 ± 2 ns 7.49 ± 2 ns 0.999 ± 0.38
Quantity/with_numbers/^int * real 7.77 ± 2.3 ns 7.77 ± 2.3 ns 1 ± 0.42
Quantity/with_quantity/+y 4.03 ± 0.014 ns 3.78 ± 0.03 ns 1.07 ± 0.0092
Quantity/with_quantity//y 2.6 ± 0.002 ns 2.6 ± 0.002 ns 1 ± 0.0011
Quantity/with_self/dimension 2.31 ± 0.001 ns 2.31 ± 0.015 ns 1 ± 0.0065
Quantity/with_self/inv 2.32 ± 0.001 ns 2.31 ± 0.002 ns 1 ± 0.00097
Quantity/with_self/ustrip 2.04 ± 0.004 ns 2.04 ± 0.003 ns 1 ± 0.0024
QuantityArray/broadcasting/multi_array_of_quantities 0.159 ± 0.0082 ms 0.159 ± 0.023 ms 0.999 ± 0.15
QuantityArray/broadcasting/multi_normal_array 0.0505 ± 0.0029 ms 0.0506 ± 0.0034 ms 0.999 ± 0.088
QuantityArray/broadcasting/multi_quantity_array 0.167 ± 0.014 ms 0.17 ± 0.015 ms 0.981 ± 0.12
QuantityArray/broadcasting/x^2_array_of_quantities 0.0423 ± 0.0041 ms 0.038 ± 0.0034 ms 1.11 ± 0.15
QuantityArray/broadcasting/x^2_normal_array 9.17 ± 1.4 μs 8.26 ± 1.3 μs 1.11 ± 0.24
QuantityArray/broadcasting/x^2_quantity_array 9.37 ± 1.3 μs 10.6 ± 1.6 μs 0.887 ± 0.18
QuantityArray/broadcasting/x^4_array_of_quantities 0.0981 ± 0.0062 ms 0.0971 ± 0.0087 ms 1.01 ± 0.11
QuantityArray/broadcasting/x^4_normal_array 0.0498 ± 0.0012 ms 0.0494 ± 0.0012 ms 1.01 ± 0.034
QuantityArray/broadcasting/x^4_quantity_array 0.05 ± 0.0013 ms 0.0499 ± 0.0013 ms 1 ± 0.037
time_to_load 0.21 ± 0.00039 s 0.201 ± 0.0033 s 1.05 ± 0.017
Memory benchmarks
main a52c29c... main / a52c29c...
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
Copy Markdown
Contributor

Benchmark Results (Julia v1)

Time benchmarks
main a52c29c... main / a52c29c...
Quantity/creation/Quantity(x) 3.42 ± 0.001 ns 2.79 ± 0.92 ns 1.22 ± 0.4
Quantity/creation/Quantity(x, length=y) 3.42 ± 0.001 ns 3.1 ± 0.01 ns 1.1 ± 0.0036
Quantity/with_numbers/*real 12.8 ± 0.01 ns 3.41 ± 0.01 ns 3.76 ± 0.011
Quantity/with_numbers/^int 22.9 ± 1.4 ns 12.1 ± 1 ns 1.9 ± 0.19
Quantity/with_numbers/^int * real 22.9 ± 1.3 ns 12.3 ± 1 ns 1.87 ± 0.19
Quantity/with_quantity/+y 4.05 ± 0.039 ns 4.04 ± 0.001 ns 1 ± 0.0097
Quantity/with_quantity//y 3.42 ± 0.01 ns 3.1 ± 0.01 ns 1.1 ± 0.0048
Quantity/with_self/dimension 2.79 ± 0.01 ns 3.1 ± 0.01 ns 0.9 ± 0.0043
Quantity/with_self/inv 3.11 ± 0.01 ns 3.41 ± 0.01 ns 0.912 ± 0.004
Quantity/with_self/ustrip 2.79 ± 0.009 ns 2.79 ± 0.91 ns 1 ± 0.33
QuantityArray/broadcasting/multi_array_of_quantities 0.109 ± 0.0011 ms 0.109 ± 0.0032 ms 1 ± 0.031
QuantityArray/broadcasting/multi_normal_array 0.0471 ± 0.00031 ms 0.0471 ± 0.00025 ms 1 ± 0.0085
QuantityArray/broadcasting/multi_quantity_array 0.0561 ± 0.00021 ms 0.0561 ± 0.00022 ms 1 ± 0.0054
QuantityArray/broadcasting/x^2_array_of_quantities 22.6 ± 7.6 μs 23.4 ± 7.8 μs 0.968 ± 0.46
QuantityArray/broadcasting/x^2_normal_array 2.04 ± 1.3 μs 2.24 ± 1.4 μs 0.911 ± 0.83
QuantityArray/broadcasting/x^2_quantity_array 3.55 ± 0.18 μs 6.56 ± 0.13 μs 0.54 ± 0.03
QuantityArray/broadcasting/x^4_array_of_quantities 0.0813 ± 0.0039 ms 0.0814 ± 0.0031 ms 0.998 ± 0.061
QuantityArray/broadcasting/x^4_normal_array 0.0436 ± 0.00013 ms 0.0436 ± 0.00016 ms 1 ± 0.0047
QuantityArray/broadcasting/x^4_quantity_array 0.0529 ± 0.009 ms 0.0468 ± 0.00019 ms 1.13 ± 0.19
time_to_load 0.188 ± 0.0016 s 0.185 ± 0.0013 s 1.02 ± 0.011
Memory benchmarks
main a52c29c... main / a52c29c...
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

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.16%. Comparing base (262b163) to head (a52c29c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #221   +/-   ##
=======================================
  Coverage   99.16%   99.16%           
=======================================
  Files          23       23           
  Lines        1320     1320           
=======================================
  Hits         1309     1309           
  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.

@MilesCranmer
MilesCranmer merged commit 94c7ff8 into JuliaPhysics:main May 16, 2026
7 checks passed
@icweaver

Copy link
Copy Markdown
Contributor Author

thx!

@icweaver
icweaver deleted the thz branch May 16, 2026 16:00
github-actions Bot referenced this pull request May 19, 2026
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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