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] Make array handling in converts as generic as possible #2756

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

asinghvi17
Copy link
Member

Description

Fixes #2753

Allows OffsetArrays, and generally any array which overloads Base.axes, to be plotted with the correct indices by any SurfaceLike or VolumeLike plot. Changes here might conflict with #2573 so we could merge after or into that PR.

Type of change

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Add converts for PointBased functions when only one array is provided
  • Added an entry in NEWS.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

@MakieBot
Copy link
Collaborator

MakieBot commented Mar 14, 2023

Compile Times benchmark

Note, that these numbers may fluctuate on the CI servers, so take them with a grain of salt. All benchmark results are based on the mean time and negative percent mean faster than the base branch. Note, that GLMakie + WGLMakie run on an emulated GPU, so the runtime benchmark is much slower. Results are from running:

using_time = @ctime using Backend
# Compile time
create_time = @ctime fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @ctime Makie.colorbuffer(display(fig))
# Runtime
create_time = @benchmark fig = scatter(1:4; color=1:4, colormap=:turbo, markersize=20, visible=true)
display_time = @benchmark Makie.colorbuffer(display(fig))
using create display create display
GLMakie 14.15s (13.78, 14.44) 0.22+- 1.32s (1.29, 1.36) 0.02+- 904.43ms (881.70, 975.84) 32.15+- 14.33ms (13.74, 14.96) 0.44+- 165.33ms (161.68, 169.09) 2.43+-
master 13.96s (13.60, 14.29) 0.24+- 1.37s (1.30, 1.40) 0.04+- 855.01ms (821.57, 883.57) 21.00+- 14.01ms (13.78, 14.19) 0.17+- 167.06ms (164.83, 169.34) 1.73+-
evaluation +1.33%, 0.19s invariant (0.80d, 0.16p, 0.23std) -4.00%, -0.05s faster ✓ (-1.68d, 0.01p, 0.03std) +5.46%, 49.42ms slower❌ (1.82d, 0.01p, 26.58std) +2.27%, 0.32ms invariant (0.97d, 0.11p, 0.31std) -1.05%, -1.73ms invariant (-0.82d, 0.15p, 2.08std)
CairoMakie 11.70s (11.54, 11.96) 0.16+- 1.28s (1.27, 1.31) 0.01+- 269.32ms (262.30, 277.32) 5.85+- 15.11ms (14.93, 15.28) 0.14+- 8.25ms (8.03, 8.45) 0.18+-
master 11.87s (11.45, 12.25) 0.27+- 1.28s (1.24, 1.33) 0.03+- 265.84ms (256.70, 272.28) 5.23+- 15.50ms (15.13, 15.85) 0.27+- 8.33ms (8.20, 8.47) 0.10+-
evaluation -1.42%, -0.17s invariant (-0.75d, 0.19p, 0.22std) +0.22%, 0.0s invariant (0.11d, 0.84p, 0.02std) +1.29%, 3.47ms invariant (0.63d, 0.26p, 5.54std) -2.56%, -0.39ms faster ✓ (-1.81d, 0.01p, 0.20std) -1.07%, -0.09ms invariant (-0.61d, 0.28p, 0.14std)
WGLMakie 16.98s (16.61, 17.79) 0.45+- 1.55s (1.48, 1.58) 0.03+- 16.14s (15.56, 17.21) 0.54+- 21.26ms (19.64, 24.85) 1.70+- 1.54s (1.39, 1.79) 0.14+-
master 16.78s (15.58, 18.03) 0.78+- 1.60s (1.56, 1.66) 0.03+- 15.92s (15.12, 16.41) 0.49+- 21.98ms (19.57, 25.77) 2.11+- 1.54s (1.44, 1.67) 0.09+-
evaluation +1.20%, 0.2s invariant (0.32d, 0.56p, 0.62std) -3.05%, -0.05s faster ✓ (-1.40d, 0.02p, 0.03std) +1.40%, 0.23s invariant (0.44d, 0.43p, 0.52std) -3.37%, -0.72ms invariant (-0.37d, 0.50p, 1.91std) +0.60%, 0.01s invariant (0.08d, 0.89p, 0.11std)

src/conversions.jl Outdated Show resolved Hide resolved
@SimonDanisch SimonDanisch marked this pull request as ready for review July 20, 2023 16:21
@SimonDanisch
Copy link
Member

I think we can merge this, but should add a test first!

@SimonDanisch
Copy link
Member

Ok, added some tests and cleaned it up... But I think we need to make this a breaking change.
the 0..n doesn't make any sense with axes/firstindex, and we might want to rethink that...

@github-actions
Copy link
Contributor

Missing reference images

Found 1 new images without existing references.
Upload new reference images before merging this PR.

@SimonDanisch SimonDanisch added the breaking a PR with breaking changes label Jul 22, 2023
@SimonDanisch SimonDanisch mentioned this pull request Aug 1, 2023
16 tasks
@asinghvi17
Copy link
Member Author

This is still unmerged AFAIK. Should we target breaking-0.21 for this? If so I can clean up the implementation and remove the Float32 converts.

CC @SimonDanisch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking a PR with breaking changes
Projects
Status: Work in progress
Development

Successfully merging this pull request may close these issues.

Generic AbstractArray plotting?
4 participants