Skip to content

Learn · Tutorial

Learn

These short lessons build an executable scientific statement from finding environmental information to composing and checking an analysis. They use the same reviewed PRISM observations so that source identity remains visible while the analytical object changes.

The throughline is scientific inspectability: rerunnable code is useful, but a reader should also be able to recover which observations entered, what each stage produced, why authored order matters, and what evidence supports the result. Read the research framing, or begin with the lessons below.

Lesson What you will learn
1. Nouns are environmental things Find source-qualified observations
2. Verbs do things Transform an object with explicit parameters
3. Pipes establish order Preserve authored analytical syntax
4. Order can change meaning Distinguish similar-looking questions
5. Compose a question Combine states explicitly
6. Inspect the result Read state, trace, dimensions, units and computation
7. Provenance and source choice Connect a short statement to bounded evidence

Shared setup

For an immediate live-data example, use the quickstart. For these offline lessons, clone the repository and install from its root:

git clone https://github.com/CU-ESIIL/cubedynamics.git
cd cubedynamics
python -m pip install -e ".[vignettes]"

Run this Python setup before any lesson. The fixture contains actual PRISM observations, not generated example measurements.

from pathlib import Path
import xarray as xr
import matplotlib.pyplot as plt
from cubedynamics import data, pipe, verbs as v

path = Path("tests/fixtures/real_data/prism_boulder_january_2024.nc")
with xr.open_dataset(path, engine="scipy") as observed:
    cube = observed["tmax"].load()
assert cube.attrs["units"] == "degC"

The deliberate .load() closes this small local file safely; live or large cubes need not be materialized. See installation options and the fixture's provenance and checks.

After the lessons

  • Library: find a noun and compare source flavors.
  • Documents: look up arguments and contracts.
  • Vignettes: run a complete scientific analysis.

Additional context: cube concepts and core/project boundaries.