Documents · Verb reference
collect_blocks
Collect block signatures into one block collection.
Callable type: Grammar verb / pipe stage · Browse: Spatial and alignment
Usage
from cubedynamics import verbs as v
v.collect_blocks(*others, block_dim='block', join='outer')
Arguments
| Argument | Meaning | Default |
|---|---|---|
| others | See implementation docstring below; no parameter-specific description supplied. | forwarded arguments |
| block_dim | See implementation docstring below; no parameter-specific description supplied. | 'block' |
| join | See implementation docstring below; no parameter-specific description supplied. | 'outer' |
Accepts
Consult the input parameters and implementation notes below. This namespace also includes direct helpers, not only pipe factories.
Returns
The public docstring does not specify a return contract. Do not assume a pipe-ready return; consult the linked implementation.
Order / grammar behavior
A pipe passes the preceding result to the next callable. Confirm that the previous step's dimensions and semantic state satisfy the input contract. Reductions can remove dimensions; plotting may produce side effects.
Minimal example
Run from the repository root after python -m pip install -e '.[vignettes]'. Uses the checked observational PRISM fixture; no network is required.
from pathlib import Path
import xarray as xr
import matplotlib.pyplot as plt
from cubedynamics import pipe, verbs as v
# Frozen, reviewed PRISM observations; run from the repository root.
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"
west = (pipe(cube.isel(x=slice(0, 12))) | v.block_signature(block_id="west")).unwrap()
east = (pipe(cube.isel(x=slice(12, None))) | v.block_signature(block_id="east")).unwrap()
result = (pipe(west) | v.collect_blocks(east)).unwrap()
result["tmax"].plot.line(x="time", hue="block")
plt.show()
Works with
Use only the input types documented by this callable; not every helper accepts every noun or VirtualCube.
See also
Implementation notes
No additional implementation notes in the current docstring.
Implementation source. Signatures and descriptions on this page are generated from this checkout, not hand-maintained copies.