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

Basic Makie.jl support #165

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Basic Makie.jl support #165

wants to merge 9 commits into from

Conversation

icweaver
Copy link

@icweaver icweaver commented Mar 9, 2025

Closes #164

Demo

using DynamicQuantities, GLMakie

fig = Figure()

y = 60:10:100

scatter(fig[1, 1], y * u"m")
scatter(fig[1, 2], QuantityArray(y, u"m"))
scatter(fig[2, 1], y * u"kg", y * u"m")
scatter(fig[2, 2], y * us"m/s/Hz")

fig

example

Makie TODO

  • Heatmap
  • Image
  • Rich strings? see, e.g., untitful impl
  • affine units?

Package TODO

Copy link
Contributor

github-actions bot commented Mar 9, 2025

Benchmark Results

main e1637d3... main / e1637d3...
Quantity/creation/Quantity(x) 3.1 ± 0.01 ns 4.02 ± 0.01 ns 0.773
Quantity/creation/Quantity(x, length=y) 3.73 ± 0.01 ns 3.43 ± 0.01 ns 1.09
Quantity/with_numbers/*real 3.11 ± 0.01 ns 3.11 ± 0.001 ns 1
Quantity/with_numbers/^int 8.68 ± 1.6 ns 8.67 ± 1.6 ns 1
Quantity/with_numbers/^int * real 8.98 ± 1.6 ns 8.98 ± 1.6 ns 1
Quantity/with_quantity/+y 4.35 ± 0.009 ns 4.35 ± 0.009 ns 1
Quantity/with_quantity//y 3.42 ± 0.011 ns 3.11 ± 0.001 ns 1.1
Quantity/with_self/dimension 2.79 ± 0 ns 3.12 ± 0.01 ns 0.894
Quantity/with_self/inv 3.11 ± 0.01 ns 3.11 ± 0.001 ns 1
Quantity/with_self/ustrip 3.71 ± 0.92 ns 2.79 ± 0.01 ns 1.33
QuantityArray/broadcasting/multi_array_of_quantities 0.0876 ± 0.0091 ms 0.0876 ± 0.0033 ms 1
QuantityArray/broadcasting/multi_normal_array 0.0497 ± 0.00035 ms 0.0528 ± 0.00033 ms 0.942
QuantityArray/broadcasting/multi_quantity_array 0.0534 ± 0.0031 ms 0.0592 ± 0.0059 ms 0.903
QuantityArray/broadcasting/x^2_array_of_quantities 12.8 ± 1.7 μs 13 ± 1.6 μs 0.986
QuantityArray/broadcasting/x^2_normal_array 2.03 ± 0.46 μs 2.05 ± 0.95 μs 0.991
QuantityArray/broadcasting/x^2_quantity_array 3.79 ± 0.3 μs 3.47 ± 0.18 μs 1.09
QuantityArray/broadcasting/x^4_array_of_quantities 0.0814 ± 0.00077 ms 0.0814 ± 0.00063 ms 1
QuantityArray/broadcasting/x^4_normal_array 0.0466 ± 0.0031 ms 0.0497 ± 0.0029 ms 0.938
QuantityArray/broadcasting/x^4_quantity_array 0.0498 ± 0.0032 ms 0.0499 ± 0.00047 ms 0.998
time_to_load 0.195 ± 0.0015 s 0.196 ± 0.00095 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).

@icweaver
Copy link
Author

Just saw this really cool update from Julius on the AoG side of things!

MakieOrg/AlgebraOfGraphics.jl#619

https://aog.makie.org/v0.9.6/examples/scales/units#units

This also looks to address MakieOrg/Makie.jl#3890 in one fell swoop

@MilesCranmer
Copy link
Member

Cool!

Let me know (by tagging me) when you're ready for review

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.

Potential Makie.jl support?
2 participants