Skip to content

Update to_polycollection(), to_linecollection and create Matplotlib Visualization Guide - #844

Merged
philipc2 merged 18 commits into
mainfrom
philipc2/mpl
Jul 17, 2024
Merged

philipc2 merged 18 commits into
mainfrom
philipc2/mpl

Conversation

@philipc2

@philipc2 philipc2 commented Jul 9, 2024 •

Copy link
Copy Markdown
Member

Closes #430, #839

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@philipc2 philipc2 linked an issue Jul 9, 2024 that may be closed by this pull request
@philipc2 philipc2 self-assigned this Jul 17, 2024
@philipc2 philipc2 added the run-benchmark Run ASV benchmark workflow label Jul 17, 2024
@github-actions

github-actions Bot commented Jul 17, 2024 •

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [b986ef3] After [94c1471] Ratio Benchmark (Parameter)
- 388M 347M 0.9 mpas_ocean.Integrate.peakmem_integrate('480km')
- 11.5±0.02s 349±1ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
- 11.4±0.07s 347±1ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
- 11.5±0.02s 353±7ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
- 737±6ms 21.8±0.2ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
- 729±4ms 22.1±0.2ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
- 730±4ms 22.1±0.3ms 0.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')

Benchmarks that have stayed the same:

Change Before [b986ef3] After [94c1471] Ratio Benchmark (Parameter)
242M 242M 1 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
303M 303M 1 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
321M 308M 0.96 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
318M 304M 0.95 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
14.1±0.05s 13.9±0.03s 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
2.06±0s 2.08±0.01s 1.01 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
19.6±0.1s 19.6±0.1s 1 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
74.0±0.8ms 73.3±0.8ms 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.64±0.01s 1.67±0.03s 1.02 import.Imports.timeraw_import_uxarray
373M 393M 1.05 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', False)
352M 382M 1.09 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('120km', True)
323M 355M 1.1 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', False)
322M 354M 1.1 mpas_ocean.GeoDataFrame.peakmem_to_geodataframe('480km', True)
1.18±0s 1.21±0s 1.03 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
56.0±0.8ms 56.7±0.3ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
95.5±1ms 94.4±0.3ms 0.99 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
5.32±0.09ms 5.31±0.1ms 1 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
258M 259M 1 mpas_ocean.Gradient.peakmem_gradient('120km')
236M 236M 1 mpas_ocean.Gradient.peakmem_gradient('480km')
2.71±0.03ms 2.67±0.02ms 0.99 mpas_ocean.Gradient.time_gradient('120km')
286±3μs 284±2μs 0.99 mpas_ocean.Gradient.time_gradient('480km')
175±0.8ms 177±2ms 1.01 mpas_ocean.Integrate.time_integrate('120km')
11.9±0.08ms 12.0±0.05ms 1.01 mpas_ocean.Integrate.time_integrate('480km')
234M 232M 0.99 quad_hexagon.QuadHexagon.peakmem_open_dataset
231M 231M 1 quad_hexagon.QuadHexagon.peakmem_open_grid
6.64±0.06ms 6.73±0.1ms 1.01 quad_hexagon.QuadHexagon.time_open_dataset
5.63±0.02ms 5.68±0.03ms 1.01 quad_hexagon.QuadHexagon.time_open_grid

Benchmarks that have got worse:

Change Before [b986ef3] After [94c1471] Ratio Benchmark (Parameter)
+ 5.85±0.08μs 1.73±0.02ms 295.81 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
+ 5.38±0.05μs 497±10μs 92.32 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
+ 323M 364M 1.13 mpas_ocean.Integrate.peakmem_integrate('120km')

@rajeeja rajeeja left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for putting this together.
We can handle the set backend etc. in future PRs.

@philipc2
philipc2 merged commit 0cbbc92 into main Jul 17, 2024
@erogluorhan
erogluorhan deleted the philipc2/mpl branch December 2, 2024 16:25
@cmdupuis3 cmdupuis3 mentioned this pull request Nov 13, 2026
7 tasks done
cmdupuis3 added a commit that referenced this pull request Nov 13, 2026
The PR benchmark workflow failed in Setup with "Could not find 'conda' in
PATH": asv.conf.json uses environment_type "conda", so asv shells out to a
conda executable, which micromamba does not provide. `mamba` in create-args
used to pull conda in, but mamba 2.x is a standalone binary that no longer
depends on it. mamba itself was only needed while environment_type was
"mamba" (#831, switched back to "conda" in #844); asv 0.6.6 has no mamba
backend.

Install `conda` instead of `mamba`, and drop `python-build`: asv builds the
wheel in its own env, where the asv.conf.json matrix provides it.

asv's faster "rattler" backend was considered, but it passes the
`nodefaults` entry of ci/environment.yml to the solver as a real channel and
fails fetching conda.anaconda.org/nodefaults. `nodefaults` stays: it is what
keeps uxarray_build defined by the repo alone, not by a user's .condarc.

Also:
- ci.yml link-check and upstream-dev-ci.yml set up with micromamba but ran
  `conda list`, which micromamba cannot satisfy; use `micromamba list`.
- asv.conf.json: list the environment types asv 0.6.6 actually has.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
erogluorhan pushed a commit that referenced this pull request Nov 13, 2026
The PR benchmark workflow failed in Setup with "Could not find 'conda' in
PATH": asv.conf.json uses environment_type "conda", so asv shells out to a
conda executable, which micromamba does not provide. `mamba` in create-args
used to pull conda in, but mamba 2.x is a standalone binary that no longer
depends on it. mamba itself was only needed while environment_type was
"mamba" (#831, switched back to "conda" in #844); asv 0.6.6 has no mamba
backend.

Install `conda` instead of `mamba`, and drop `python-build`: asv builds the
wheel in its own env, where the asv.conf.json matrix provides it.

asv's faster "rattler" backend was considered, but it passes the
`nodefaults` entry of ci/environment.yml to the solver as a real channel and
fails fetching conda.anaconda.org/nodefaults. `nodefaults` stays: it is what
keeps uxarray_build defined by the repo alone, not by a user's .condarc.

Also:
- ci.yml link-check and upstream-dev-ci.yml set up with micromamba but ran
  `conda list`, which micromamba cannot satisfy; use `micromamba list`.
- asv.conf.json: list the environment types asv 0.6.6 actually has.

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-benchmark Run ASV benchmark workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revisit Matplotlib Support for Plotting Matplotlib Visualization Usage Example

2 participants