Skip to content

Add tutorial API for example datasets#1502

Draft
alioacar wants to merge 2 commits intoUXARRAY:mainfrom
alioacar:fix-1496
Draft

Add tutorial API for example datasets#1502
alioacar wants to merge 2 commits intoUXARRAY:mainfrom
alioacar:fix-1496

Conversation

@alioacar
Copy link
Copy Markdown

@alioacar alioacar commented Apr 29, 2026

Closes #1496

This is a draft PR for early feedback on the tutorial dataset API. My plan is to continue updating the rest of the user guide notebooks to use the tutorial helpers

Overview

  • Add a new ux.tutorial API for loading built-in sample datasets from the existing test/meshfiles directory (following @erogluorhan's suggestion)
  • Add a tutorial dataset registry under uxarray/tutorial/
  • Add tests covering the new tutorial helpers
  • Update the first user guide notebooks to demonstrate the tutorial API

Expected Usage

import uxarray as ux

# tutorial dataset usage
uxds = ux.tutorial.open_dataset("quad-hexagon")
uxgrid = ux.tutorial.open_grid("outCSne30")

# tutorial dataset usage with multiple data files
uxds_multi = ux.tutorial.open_mfdataset("quad-hexagon-random")

# regular usage with user-provided files remains unchanged
grid_path = "/path/to/grid.nc"
data_path = "/path/to/data.nc"
data_paths = ["/path/to/data1.nc", "/path/to/data2.nc"]

uxds = ux.open_dataset(grid_path, data_path)
uxds_multi = ux.open_mfdataset(grid_path, data_paths)

PR Checklist

General

  • An issue is linked created and linked
  • Filled out Overview and Expected Usage (if applicable) sections

Testing

  • Adequate tests are created if there is new functionality
  • Tests cover all possible logical paths in your function
  • Tests are not too basic (such as simply calling a function and nothing else)

Documentation

  • Docstrings have been added to all new functions
  • Update api.rst

Examples

  • Clear the output of all cells before committing

@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

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.

Add a tutorial dataset loader

1 participant