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

[WIP] Compatibility with QuadGK.jl #41

Closed
wants to merge 3 commits into from
Closed

Conversation

MilesCranmer
Copy link
Member

@MilesCranmer MilesCranmer commented Sep 19, 2023

cc @mikeingold @stevengj

This is a draft PR to modify one(q) to return one(ustrip(q)) rather than a dimensionless quantity, to match the behavior of Unitful.jl.

Fixes #40

@github-actions
Copy link

Benchmark Results

main 303c25b... t[main]/t[303c25b...]
Quantity/creation/Quantity(x) 2.9 ± 0.1 ns 2.9 ± 0.1 ns 1
Quantity/creation/Quantity(x, length=y) 3.3 ± 0.1 ns 3.3 ± 0.1 ns 1
Quantity/with_numbers/*real 3.3 ± 0.1 ns 3.3 ± 0.1 ns 1
Quantity/with_numbers/^int 10.1 ± 2.5 ns 10.1 ± 2.5 ns 1
Quantity/with_numbers/^int * real 10.5 ± 2.4 ns 10.5 ± 2.4 ns 1
Quantity/with_quantity/+y 6 ± 0.1 ns 6 ± 0.1 ns 1
Quantity/with_quantity//y 3.7 ± 0.1 ns 3.7 ± 0.1 ns 1
Quantity/with_self/dimension 1.6 ± 0.1 ns 1.6 ± 0.1 ns 1
Quantity/with_self/inv 3.3 ± 0.4 ns 3.3 ± 0.1 ns 1
Quantity/with_self/ustrip 1.6 ± 0.1 ns 1.6 ± 0.1 ns 1
QuantityArray/broadcasting/multi_array_of_quantities 0.198 ± 0.029 ms 0.197 ± 0.017 ms 1
QuantityArray/broadcasting/multi_normal_array 0.0682 ± 0.0015 ms 0.0683 ± 0.0011 ms 0.999
QuantityArray/broadcasting/multi_quantity_array 0.23 ± 0.0042 ms 0.229 ± 0.0034 ms 1
QuantityArray/broadcasting/x^2_array_of_quantities 0.0419 ± 0.0043 ms 0.0409 ± 0.0047 ms 1.02
QuantityArray/broadcasting/x^2_normal_array 8.5 ± 1.1 μs 8.7 ± 1.2 μs 0.977
QuantityArray/broadcasting/x^2_quantity_array 10 ± 1 μs 9.9 ± 1 μs 1.01
QuantityArray/broadcasting/x^4_array_of_quantities 0.116 ± 0.0045 ms 0.117 ± 0.0052 ms 0.989
QuantityArray/broadcasting/x^4_normal_array 0.0584 ± 0.0007 ms 0.0584 ± 0.0008 ms 1
QuantityArray/broadcasting/x^4_quantity_array 0.082 ± 0.0011 ms 0.0819 ± 0.0009 ms 1
time_to_load 0.17 ± 0.0016 s 0.167 ± 0.00028 s 1.02

Benchmark Plots

A plot of the benchmark results have been uploaded as an artifact to the workflow run for this PR.
Go to "Actions"->"Benchmark a pull request"->[the most recent run]->"Artifacts" (at the bottom).

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.

Quantity currently incompatible with QuadGK
1 participant