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

Fix behavior of complex #92

Merged
merged 5 commits into from
Nov 30, 2023
Merged

Fix behavior of complex #92

merged 5 commits into from
Nov 30, 2023

Conversation

MilesCranmer
Copy link
Member

@MilesCranmer MilesCranmer commented Nov 26, 2023

  • complex(0.5u"km", 0.1u"km") -> quantity storing a complex number with length units
  • complex(0.5, Quantity(0.1)) -> quantity storing a complex number, no units
  • complex(0.5u"km", 0.1) -> DimensionError

Copy link
Contributor

github-actions bot commented Nov 26, 2023

Benchmark Results

main fa076ea... t[main]/t[fa076ea...]
Quantity/creation/Quantity(x) 3.1 ± 0.01 ns 3.1 ± 0.01 ns 1
Quantity/creation/Quantity(x, length=y) 3.11 ± 0.001 ns 3.11 ± 0.001 ns 1
Quantity/with_numbers/*real 3.1 ± 0.01 ns 3.11 ± 0.01 ns 0.997
Quantity/with_numbers/^int 8.36 ± 2.5 ns 8.36 ± 2.5 ns 1
Quantity/with_numbers/^int * real 8.37 ± 2.5 ns 8.38 ± 2.5 ns 0.999
Quantity/with_quantity/+y 5.27 ± 0.01 ns 5.27 ± 0.01 ns 1
Quantity/with_quantity//y 3.11 ± 0.001 ns 3.11 ± 0.001 ns 1
Quantity/with_self/dimension 1.56 ± 0.01 ns 1.55 ± 0.01 ns 1.01
Quantity/with_self/inv 3.11 ± 0.011 ns 3.11 ± 0.01 ns 1
Quantity/with_self/ustrip 1.55 ± 0.01 ns 1.55 ± 0.01 ns 1
QuantityArray/broadcasting/multi_array_of_quantities 0.15 ± 0.14 ms 0.149 ± 0.14 ms 1
QuantityArray/broadcasting/multi_normal_array 0.0498 ± 0.00022 ms 0.0498 ± 0.00023 ms 1
QuantityArray/broadcasting/multi_quantity_array 0.158 ± 0.00083 ms 0.158 ± 0.00086 ms 1
QuantityArray/broadcasting/x^2_array_of_quantities 27.6 ± 2.9 μs 26.4 ± 2.5 μs 1.05
QuantityArray/broadcasting/x^2_normal_array 5.8 ± 0.93 μs 4.87 ± 1.2 μs 1.19
QuantityArray/broadcasting/x^2_quantity_array 7.03 ± 0.28 μs 6.92 ± 0.28 μs 1.02
QuantityArray/broadcasting/x^4_array_of_quantities 0.0787 ± 0.00058 ms 0.0786 ± 0.00049 ms 1
QuantityArray/broadcasting/x^4_normal_array 0.0499 ± 0.00019 ms 0.0498 ± 0.00017 ms 1
QuantityArray/broadcasting/x^4_quantity_array 0.0591 ± 0.00017 ms 0.0592 ± 0.0002 ms 0.999
time_to_load 0.237 ± 0.00066 s 0.238 ± 0.0008 s 0.995

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

@SymbolicML SymbolicML deleted a comment from sweep-ai bot Nov 26, 2023
@MilesCranmer MilesCranmer changed the title [WIP] Fix behavior of complex numbers Fix behavior of complex Nov 30, 2023
@MilesCranmer MilesCranmer merged commit 2c94e59 into main Nov 30, 2023
5 checks passed
@MilesCranmer MilesCranmer deleted the fix-complex branch November 30, 2023 13:19
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.

1 participant