SymbolicML / DynamicQuantities.jl

Efficient and type-stable physical quantities in Julia
https://symbolicml.org/DynamicQuantities.jl/dev/
Apache License 2.0
120 stars 15 forks source link

Add Molar units (`M`) #128

Closed TorkelE closed 3 months ago

TorkelE commented 3 months ago

Not 100% sure what is required to implement a new unit, but my impression is that this is the approach? Please tell me if I should add something.

github-actions[bot] commented 3 months ago

Benchmark Results

main fd7ef9bc5861ba... main/fd7ef9bc5861ba...
Quantity/creation/Quantity(x) 3.72 ± 0.01 ns 2.79 ± 0 ns 1.33
Quantity/creation/Quantity(x, length=y) 3.41 ± 0.01 ns 3.42 ± 0.01 ns 0.997
Quantity/with_numbers/*real 3.11 ± 0.01 ns 3.11 ± 0.01 ns 1
Quantity/with_numbers/^int 8.05 ± 1.8 ns 8.37 ± 2.2 ns 0.963
Quantity/with_numbers/^int * real 8.36 ± 1.9 ns 8.05 ± 1.8 ns 1.04
Quantity/with_quantity/+y 4.04 ± 0.01 ns 4.04 ± 0.001 ns 1
Quantity/with_quantity//y 3.11 ± 0.001 ns 3.11 ± 0.001 ns 1
Quantity/with_self/dimension 3.1 ± 0.01 ns 2.79 ± 0.009 ns 1.11
Quantity/with_self/inv 3.11 ± 0.001 ns 4.02 ± 0.92 ns 0.773
Quantity/with_self/ustrip 2.79 ± 0.009 ns 2.79 ± 0.01 ns 1
QuantityArray/broadcasting/multi_array_of_quantities 0.145 ± 0.00056 ms 0.147 ± 0.00045 ms 0.985
QuantityArray/broadcasting/multi_normal_array 0.0528 ± 0.00015 ms 0.0498 ± 0.00015 ms 1.06
QuantityArray/broadcasting/multi_quantity_array 0.158 ± 0.00038 ms 0.155 ± 0.00063 ms 1.02
QuantityArray/broadcasting/x^2_array_of_quantities 25.5 ± 2.1 μs 25.6 ± 2.2 μs 0.998
QuantityArray/broadcasting/x^2_normal_array 4.61 ± 1.1 μs 4.39 ± 1.2 μs 1.05
QuantityArray/broadcasting/x^2_quantity_array 7.06 ± 0.38 μs 7 ± 0.33 μs 1.01
QuantityArray/broadcasting/x^4_array_of_quantities 0.0786 ± 0.00049 ms 0.0786 ± 0.00047 ms 1
QuantityArray/broadcasting/x^4_normal_array 0.0498 ± 0.00017 ms 0.0497 ± 0.00015 ms 1
QuantityArray/broadcasting/x^4_quantity_array 0.05 ± 0.00015 ms 0.0499 ± 0.00014 ms 1
time_to_load 0.127 ± 0.0002 s 0.128 ± 0.00043 s 0.996

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