Skip to content

Adding beginner friendly explanations on the Docs - #1607

Open
dylannelson wants to merge 7 commits into
mainfrom
dylannelson/docs_updates
Open

Adding beginner friendly explanations on the Docs#1607
dylannelson wants to merge 7 commits into
mainfrom
dylannelson/docs_updates

Conversation

@dylannelson

@dylannelson dylannelson commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Closes #1582

Overview

While reading through the docs, there was a few ideas I reviewed that could be useful to new users. I was able to implement a few and test the changes

1) More examples/distinctions between unstructured vs structured grids

  • Created a whole new page, now in uxarray\docs\user-guide\unstructured-grids.rst
  • Created or located 5 new images
  • Added connections so this page appears in other lists and taskbars

2) Updating Tutorials and Videos Page

  • Added content to docs/tutorials.rst
  • Added 2 new links to 2 videos from 2024
  • Added brief context for each of the 3 links now on the page

3) More distinct defintions for UxDataAray vs UxDataset

PR Checklist

Documentation

  • New images for various pages
  • Created a new page for defining unstructured vs structured grids
  • Minor tweaks to styling across a few pages
  • Added videos to the Tutorials and Videos page with added context

@dylannelson dylannelson self-assigned this Jul 22, 2026
@dylannelson dylannelson added documentation Improvements or additions to documentation run-benchmark Run ASV benchmark workflow labels Jul 22, 2026
@dylannelson dylannelson linked an issue Jul 22, 2026 that may be closed by this pull request
@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

@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [058a991] After [0bbab8e] Ratio Benchmark (Parameter)
- 517M 336M 0.65 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
- 634M 335M 0.53 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
- 19.9±0.05ms 21.7±0.1μs 0.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
- 4.44±0.04ms 9.03±0.09μs 0.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
* failed 921±70ns n/a geometry_kernels.AccucrossKernels.time_accucross
* failed 2.28±0.02μs n/a geometry_kernels.AccucrossKernels.time_accucross_pair
* failed 284±6ns n/a geometry_kernels.EFTPrimitives.time_acc_sqrt_re
* failed 264±2ns n/a geometry_kernels.EFTPrimitives.time_diff_of_products
* failed 224±1ns n/a geometry_kernels.EFTPrimitives.time_two_prod
* failed 227±2ns n/a geometry_kernels.EFTPrimitives.time_two_sum
* failed 1.19±0.01μs n/a geometry_kernels.GCAConstLatIntersection.time_accux_constlat_kernel
* failed 803±1ns n/a geometry_kernels.GCAConstLatIntersection.time_gca_const_lat_intersection
* failed 1.68±0.01μs n/a geometry_kernels.GCAConstLatIntersection.time_try_gca_const_lat_intersection
* failed 1.31±0.01μs n/a geometry_kernels.GCAGCAIntersection.time_accux_gca_kernel
* failed 1.15±0.01μs n/a geometry_kernels.GCAGCAIntersection.time_gca_gca_intersection
* failed 1.92±0.07μs n/a geometry_kernels.GCAGCAIntersection.time_try_gca_gca_intersection
* failed 50.9±1μs n/a geometry_kernels.OrientPredicates.time_on_minor_arc
* failed 477±5ns n/a geometry_kernels.OrientPredicates.time_orient3d_on_sphere
* failed 2.97±0.1ms n/a geometry_samebody.SameBodyConstLat.time_accux_dispatch
* failed 1.18±0.02ms n/a geometry_samebody.SameBodyConstLat.time_accux_kernel
* failed 1.81±0.01ms n/a geometry_samebody.SameBodyConstLat.time_fp64_dispatch
* failed 139±0.1μs n/a geometry_samebody.SameBodyConstLat.time_fp64_kernel
* failed 39.5±0.2ms n/a geometry_samebody_gcagca.SameBodyGcaGca.time_accux_dispatch
* failed 11.0±0.07ms n/a geometry_samebody_gcagca.SameBodyGcaGca.time_accux_kernel
* failed 35.3±0.1ms n/a geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_dispatch
* failed 5.22±0.08ms n/a geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_kernel
- 711±5μs 13.6±0.3μs 0.02 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
- 543±8μs 13.4±0.1μs 0.02 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
- 5.03±0.1ms 4.48±0.02ms 0.89 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('120km')
- 3.80±0.08ms 3.24±0.05ms 0.85 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('480km')
- 447M 330M 0.74 mpas_ocean.Gradient.peakmem_gradient('480km')
- 4.76±0.06ms 4.29±0.04ms 0.90 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
- 30.6±0.2ms 27.6±0.2ms 0.90 mpas_ocean.ZonalAverage.time_zonal_average('120km')

Benchmarks that have stayed the same:

Change Before [058a991] After [0bbab8e] Ratio Benchmark (Parameter)
10.0±0.1μs 10.1±0.2μs 1.00 bench_connectivity.Connectivity.time_edge_face('120km')
10.2±0.1μs 10.4±0.1μs 1.02 bench_connectivity.Connectivity.time_edge_face('480km')
10.2±0.08μs 9.93±0.2μs 0.97 bench_connectivity.Connectivity.time_edge_node('120km')
10.3±0.3μs 10.3±0.1μs 1.00 bench_connectivity.Connectivity.time_edge_node('480km')
9.99±0.1μs 10.4±0.1μs 1.04 bench_connectivity.Connectivity.time_face_edge('120km')
10.4±0.05μs 10.1±0.2μs 0.98 bench_connectivity.Connectivity.time_face_edge('480km')
10.1±0.2μs 10.1±0.1μs 1.00 bench_connectivity.Connectivity.time_face_face('120km')
10.2±0.05μs 10.2±0.1μs 1.00 bench_connectivity.Connectivity.time_face_face('480km')
20.6±0.3μs 21.0±0.5μs 1.02 bench_connectivity.Connectivity.time_face_node('120km')
21.1±0.4μs 20.6±0.3μs 0.98 bench_connectivity.Connectivity.time_face_node('480km')
9.97±0.09μs 10.0±0.07μs 1.01 bench_connectivity.Connectivity.time_node_edge('120km')
10.6±0.1μs 10.1±0.2μs 0.96 bench_connectivity.Connectivity.time_node_edge('480km')
10.1±0.02μs 10.0±0.05μs 0.99 bench_connectivity.Connectivity.time_node_face('120km')
10.2±0.09μs 10.2±0.04μs 0.99 bench_connectivity.Connectivity.time_node_face('480km')
333M 334M 1.00 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
362M 365M 1.01 face_bounds.FaceBounds.peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
26.9±0.1ms 12.1±0.1ms ~0.45 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
1.99±0.01ms 1.91±0.1ms 0.96 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
945±4ns 955±20ns 1.01 mpas_ocean.CheckNorm.time_check_norm('120km')
863±7ns 859±8ns 1.00 mpas_ocean.CheckNorm.time_check_norm('480km')
826±4ms 813±7ms 0.98 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
50.4±0.4ms 50.6±0.2ms 1.00 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
3.56±0.05s 3.59±0.02s 1.01 mpas_ocean.ConstructFaceLatLon.time_welzl('120km')
229±0.6ms 226±0.5ms 0.99 mpas_ocean.ConstructFaceLatLon.time_welzl('480km')
13.7±0.05ms 14.0±0.3ms 1.02 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')
938±10μs 924±5μs 0.98 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
10.0±0.9ms 10.00±0.9ms 1.00 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
729±30μs 676±10μs 0.93 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
696±0.9ms 682±2ms 0.98 mpas_ocean.CrossSections.time_const_lat('120km', 1)
350±2ms 346±1ms 0.99 mpas_ocean.CrossSections.time_const_lat('120km', 2)
182±2ms 177±0.4ms 0.97 mpas_ocean.CrossSections.time_const_lat('120km', 4)
516±1ms 513±3ms 0.99 mpas_ocean.CrossSections.time_const_lat('480km', 1)
263±1ms 257±2ms 0.98 mpas_ocean.CrossSections.time_const_lat('480km', 2)
134±0.1ms 133±0.4ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 4)
32.6±0.4ms 32.1±0.3ms 0.98 mpas_ocean.DualMesh.time_dual_mesh_construction('120km')
3.35±0.04ms 3.37±0.1ms 1.01 mpas_ocean.DualMesh.time_dual_mesh_construction('480km')
876±20ms 855±2ms 0.98 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
53.2±1ms 53.3±1ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
75.6±0.2ms 75.3±0.2ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
6.15±0.1ms 6.00±0.09ms 0.98 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
349M 351M 1.01 mpas_ocean.Gradient.peakmem_gradient('120km')
256±0.5ms 255±0.6ms 1.00 mpas_ocean.Gradient.time_gradient('120km')
17.6±0.5ms 17.4±0.1ms 0.99 mpas_ocean.Gradient.time_gradient('480km')
295±3μs 299±2μs 1.01 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
110±0.2μs 111±0.5μs 1.01 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
200±1μs 198±0.8μs 0.99 mpas_ocean.Integrate.time_integrate('120km')
177±1μs 177±0.6μs 1.00 mpas_ocean.Integrate.time_integrate('480km')
168±1ms 171±2ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
169±0.5ms 168±0.6ms 0.99 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
171±1ms 171±0.7ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
13.5±0.09ms 13.5±0.3ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
13.4±0.1ms 13.2±0.1ms 0.99 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
13.4±0.2ms 13.6±0.3ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
285±0.9μs 287±2μs 1.00 mpas_ocean.PointInPolygon.time_face_search_lonlat('120km')
288±1μs 293±7μs 1.01 mpas_ocean.PointInPolygon.time_face_search_lonlat('480km')
271±2μs 271±3μs 1.00 mpas_ocean.PointInPolygon.time_face_search_xyz('120km')
275±1μs 271±1μs 0.98 mpas_ocean.PointInPolygon.time_face_search_xyz('480km')
243±2ms 240±0.4ms 0.99 mpas_ocean.RemapDownsample.time_bilinear_remapping
260±1ms 259±2ms 0.99 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
1.29±0s 1.28±0s 1.00 mpas_ocean.RemapUpsample.time_bilinear_remapping
37.4±0.5ms 37.3±0.5ms 1.00 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping
10.4±0.1ms 10.4±0.2ms 1.00 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
7.17±0.04ms 6.05±0.1ms ~0.84 mpas_ocean.ZonalAverage.time_zonal_average('480km')
7.14±0.2ms 7.24±0.08ms 1.01 quad_hexagon.QuadHexagon.time_open_dataset
6.24±0.2ms 6.20±0.4ms 0.99 quad_hexagon.QuadHexagon.time_open_grid

Benchmarks that have got worse:

Change Before [058a991] After [0bbab8e] Ratio Benchmark (Parameter)
+ 537±5ms 752±4ms 1.4 import.Imports.timeraw_import_uxarray
+ 298M 350M 1.17 mpas_ocean.Integrate.peakmem_integrate('120km')
+ 278M 329M 1.19 mpas_ocean.Integrate.peakmem_integrate('480km')
+ 273M 325M 1.19 quad_hexagon.QuadHexagon.peakmem_open_dataset
+ 272M 324M 1.19 quad_hexagon.QuadHexagon.peakmem_open_grid

@Sevans711 Sevans711 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thank you for proposing and creating these additions to the docs pages! Overall, these all look like good changes which can help new users understand uxarray more easily.

I have a few miscellaneous questions / suggestions / requests:

  1. For the iso_grid.png, can the image be shrunk to be smaller without losing too much image quality? The docs are currently roughly 28 MB, so it's not a huge deal to add 1.5 MB, but if it wouldn't make the image too blurry it could be nice to reduce file size further.
  2. This phrasing was a bit confusing for me "Grid points store information about which faces, edges, and nodes they are connected to…" What are "grid points"? Additionally, it is not the grid points themselves which store such information, but rather the information is stored in the underlying uxarray.Grid object, if that makes sense?
  3. The unstructured_grid.png diagram bottom row was a bit confusing, in particular, why is there more empty space between hexagons there than above? In the structured_grid.png I can interpret the empty space between faces as being placed there for visual emphasis, to help talk about the different faces. I could interpret it that way for the unstructured_grid.png too if the empty space was consistent, but now that it is inconsistent I am not sure what to think.
  4. Optional suggestion: add a non-hexagon face in the unstructured_grid diagram to emphasize that "number of nodes per face" can also vary.
  5. Claims at the bottom of the new unstructured-grids.html about unstructured grids granting efficiency improvements are nice, and okay to move forward as-is, but may be more convincing with links to any relevant publications or resources providing direct evidence for unstructured grids' improvements over structured grids in practice. Maybe @erogluorhan and @rajeeja could provide suggestions about that?
  6. In data-structures.ipynb, maybe use the spelling "UxDataArray" instead of "Data Array"? Additionally, maybe edit the description of uxarray.UxDataArray to not call itself a data variable? It could say something like "A single array of data residing on the faces, nodes, or edges of a grid, along with the underlying Grid object."
  7. It looks like you tried to change the color for Yes and No cells in grid-formats.rst, but the tables still render with the same exact colors when I viewed them. Is this intentional?
  8. Can you explicitly clarify which changes solve which parts of issue #1582? For example, Point (2) of that issue refers to user-guide/representation, but I noticed none of the changes here touch that file. Is point (2) solved elsewhere, or still needs to be solved before that issue could be closed as completed?

@dylannelson

Copy link
Copy Markdown
Collaborator Author

@Sevans711 Good notes! And thank you for the through read!

  1. Good idea, I can compress it a bit and see how it looks, I'll include that next
  2. Yeah I struggled a bit when trying to find the best words to convey the ideas in a more approachable way as opposed to using too many terms. In retrospect "grid points" should likely be replaced by "Faces". For the 2nd point where data is stored, I was trying to visualize/explain it in a way that was more along the lines how objects in OOP and networks are explained/visualized. Like how each object has a set of variables, references, and properties that can be used to connect to others. I'll make a few revisions to make the distinction more clear
  3. @erogluorhan and I just talked about the graphs and I'll make a few tweaks regarding that and a few other things
  4. same as above
  5. Good idea for sure. If we could get some specific examples that would be great.
  6. I'll change it to UxDataArray. For the second suggestion, that sounds like it may be a bit hard to digest. That level of specificity may also be more valuable later on in the page where it goes into more detail here. I was trying to imagine it as how one might describe a series vs dataframe in pandas, where a Dataframe holds all your variables in your dataset, each in a Series, and each series is one individual variable. (Connecting the two definitions in an easy way when they are first introduced) This could make sense to people who only have excel experience, only understand what a dataset is, etc. And the more fine details come later on the page for those that need it
  7. It wasn't intentional, what's the best way to check how it rendered before pushing the changes? (the bot above made a link here. Is there anything you do to make a live preview? I have vscode extensions for live preview of html and markdown projects, but haven't tried with rst.
  8. I had been keeping track of all my changes and suggestions in a Doc outside of github as it got long and I wanted the extra formatting, and I let them get out of sync. I'll update both and send the doc to you directly

Comment thread docs/user-guide/unstructured-grids.rst
@Sevans711

Copy link
Copy Markdown
Collaborator

Thank you for your detailed reply @dylannelson, the ideas here sound good, and I will take a closer look again once the changes are ready! In the meantime, following up on a few of those points:

  • (6) Avoiding being too specific too early definitely makes sense. Maybe worthwhile also to skim xarray's descriptions of DataArray and Dataset for clear/concise phrasing ideas? (Though, feel free to ignore it if it doesn't actually help).
  • (7) For a live preview, the easiest option is definitely to just click whatever link gets produced after you push them. Though, you could also consider installing sphinx and telling it to build the docs on your machine. If you end up trying that, let's message separately about it if you get stuck, and leave a note here afterwards to clarify the steps you used, for future reference to anyone else following this conversation.
  • (8) Sounds good! Just adding a quick note, even with updating the original issue and sending along the doc, I think my original comment here still stands, as it will be easier to review if you can describe at least one way in which each point from the original issue has been addressed.

@erogluorhan erogluorhan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is going great! I've added a few inline comments, and they refer to another document from our cookbooks. Once you review it, and if you want to modify anything in your comparison file here, once you're done with that, I can give another review on that file. Also:

  • If possible, add some randomness and break the symmetry in unstructured_grid.png‎, at least removing one of the two pentagons?

Comment thread docs/user-guide/unstructured-grids.rst

================================
Structured vs Unstructured Grids
================================

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

For this section and others in the rest of this file, you may want to check out this section from our UXarray Cookbook: https://projectpythia.org/unstructured-grid-viz-cookbook/notebooks/foundations/unstructured-grids/#structured-vs-unstructured-grids since a lot of text there can be reused here. However, it touched code etc. which may not be needed here.

Comment thread docs/getting-started/unstructured-grids.rst Outdated
Comment thread docs/user-guide/unstructured-grids.rst
:width: 300
:align: center
:alt: A structured grid with a regular, matrix-like arrangement of cells

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

While it is technically not false/impossible to define cells being centered on a particular (lon,lat) pair, grid cells in structured grids are defined with their boundary longitudes and latitudes as follows:

Image

So, rather than identifying cell centers with lon, lat pairs, maybe draw a diagram similar to the above but with only nine cells, tag the constant lon and lat lines instead of cell centers, and rephrase the text in this section accordingly?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I think I was able to capture everything here in my last push, let me know if it captures the vision you had. Tried to keep the same styling as before, fairly minimal and as much glance value as possible

Comment thread docs/getting-started/unstructured-grids.rst Outdated
Comment thread docs/getting-started/unstructured-grids.rst Outdated
Comment thread docs/getting-started/unstructured-grids.rst Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation run-benchmark Run ASV benchmark workflow

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding beginner friendly explanations on the Docs

4 participants