Upgrading from 0.5 to 0.6
0.6.0 is a breaking release. Most old names still work for one release: they warn
(DeprecationWarning) and are removed in 0.7.0. The changes below are grouped by
what you have to do.
The verbs
A mooring is processed from its *.mooring.yaml, wherever that file is; its
folder can have any name, and every file is named from name:.
import oceanarray as oa
yaml_path = "proc/dune2_1_2026/dune2_1_2026.mooring.yaml"
oa.run(yaml_path, raw_dir="raw/", report=True) # stages 1-3, stack, grid, report
oa.process(yaml_path, stages=3) # stages only
oa.report(yaml_path, pdf=True) # the report only
runcarries on past a failed instrument by default (keep_going=True) and records what it left out in the stack and grid.keep_going=False(CLI--strict) stops at the first failure.runrebuilds the stack from the stage-3 files, so its stages run through stage 3:run(yaml_path, stages=(2, 3))orrun(yaml_path, from_stage=2)(CLI--stage 2 3or--from 2).stages=2alone is refused. Run one stage on its own withprocess(yaml_path, stages=N).Renamed CLI flags, accepted with a note until 0.7.0:
--serial→--only,--dt→--dt-seconds,process --report→--summary,plot --downsample→--downsample-seconds,export --overwrite→--force,stamp --stage→--declare,plot --var_y/--var_color→--var-y/--var-color; the short-i,-s,-g,-Aonreport→--instruments,--stack,--grid,--all.animate -ois now the output directory (--outputnames one GIF).run(..., stack_stage=2)(CLI--stack-stage 2) stacks the stage-2 files for a quick look at sea: no QC flags, no interpolated pressure, no magnetic declination — the report says so in amber.runrebuilds the stack and grid every time. A stack or grid that no longer matches its stage files is renamed<name>_stack.stale.nc/<name>_grid.stale.nc(one copy, replaced by the next rename).The stack and grid settings can live in the description, in
stack:(dt_seconds) andgrid:(pmin,pmax,dp) blocks.The stack’s default time step is now 3600 s (was 60 s). A mooring stacked at 60 s before (MIXSED,
odb2026) setsstack: {dt_seconds: 60}in its mooring YAML. Every instrument is now placed by its nearest sample within ±dt/2 (a slow one is no longer interpolated in time), and the time axis starts on a whole multiple of the step. A sample exactly half a step from two steps now fills the later one only (before: both), so a sparse or phase-offset instrument can show an empty boundary step where an older stack had a value.Every stage-3, stack and grid file carries
data_mode = "P"(provisional).The grid report’s Overflow section is now off by default; turn it on with a
report_sectionsblock (report_sections: {grid: [overflow]}) in the mooring YAML. An overflow mooring whose YAML does not set it loses the section — add the block to each overflow mooring’s YAML to keep it.
Renamed names (removed in 0.7.0)
Each old name warns and calls the new one.
Old |
Use instead |
|---|---|
|
xarray’s DataArray.plot.pcolormesh (or .plot.contourf) on the grid variable |
|
|
|
|
|
oceanarray.process(yaml_path, stages=1), or oceanarray.stage1 on datasets |
|
oceanarray.process(yaml_path, stages=2), or oceanarray.stage2 on datasets |
|
oceanarray.process(yaml_path, stages=3), or oceanarray.stage3 on datasets |
|
oceanarray.run(yaml_path, stages=3), or oceanarray.stack on datasets |
|
oceanarray.run(yaml_path, stages=3), or oceanarray.grid on a stack |
|
|
|
|
|
|
|
|
The old call form oceanarray.process(name, stage, proc_dir=...) (all five stages,
returns a bool) also warns and is removed in 0.7.0: pass the *.mooring.yaml.
Removed in 0.6.0
The plotting functions that return a Figure are renamed
draw_<what>, with no alias:plot_knockdown_pressure/_hab/_anomaly/_displacement,plot_clock_offset_check,plot_temperature_trajectory,plot_speed_boxplot,plot_multi_aquadopp_trajectories,plot_hodograph,plot_aquadopp_speed_profile,plot_adcp_trajectories,plot_trajectory,plot_microcat_raw,plot_aquadopp_raw,plot_mooring_timeseriesbecomedraw_*;draw_isopycnal_ts_fig,draw_overflow_temperature_figanddraw_grid_figbecomedraw_isopycnal_ts,draw_overflow_temperatureanddraw_grid.oceanarray.pipeline.units.canonicalise_units— useto_canonical_units.oceanarray.pipeline.units.format_units— useoceanarray.config.unit_tables.unit_label.oceanarray.config.parameters.UNIT_ALIASESandVARIABLE_UNIT_ALIASES— useoceanarray.config.unit_tables.TABLES.TimeGriddingProcessor,time_gridding_mooringandprocess_multiple_moorings_time_gridding(with their low-pass, de-tiding and band-pass filters) — the stack is the one way to put a mooring on a common time axis.
Moved modules (no alias)
Nothing outside oceanarray imported these, so they moved without a shim.
oceanarray.processors is now oceanarray.pipeline (every
oceanarray.processors.* import becomes oceanarray.pipeline.*), and
oceanarray.tools, oceanarray.utilities, oceanarray.pipeline.helpers
and oceanarray.legacy.tools are gone. oceanarray.tools.readers moved to the
oceanarray.readers package (read_oceansites, read_rodb,
load_nortek_csv; readers.read picks the format).
Old |
New |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
removed ( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Other changes
A stage file made under a different mooring name is refused. Reading a stage file whose
mooring_namediffers from the description’sname:by more than case raises; reprocess it from stage 1. A case-only difference is corrected.Stacking no longer reads ``sample_interval_seconds``. Each instrument’s sampling interval is detected from its time stamps.
Stack and grid files change. Besides the hourly default above, a
clampADCP whose height is given only ashab_bottom/hab_topis now placed by itsorientationand stacked (before: silently left out). Rebuild stacks and grids with 0.6.QC override blocks are checked. A
qc_ranges,qc_spike,tilt_qcorqc_flat_lineblock with an unknown field, a span that is not two increasing numbers, a threshold that is not a number, or a new variable without afail_spanis refused byloadand is an ERROR inoceanarray validate(before: dropped, and QC ran with the defaults). Runoceanarray validateon each description.An orientation needs its hab key. An instrument with
orientation: upand nohab_top(ordownand nohab_bottom), and nohab, is refused byloadand is an ERROR inoceanarray validate. Add the missing key.The writer does not overwrite.
oceanarray.writers.write(ds, path)refuses an existing file unlessoverwrite=Trueand returns the path written.Exit codes.
oceanarray runandprocessexit 0 when they finish with instruments left out (before: 1);--strictstops at the first failure with exit 1. A usage error exits 2.Output names come from the description’s
name:, not the folder’s name.current_directioncarriesstandard_name = "sea_water_velocity_to_direction"(CF deprecateddirection_of_sea_water_velocity).Stage files without a
processing_stagemarker are read with a warning until 0.7.0; mark them once withoceanarray stamp FILE... --declare N.Logging replaces the ``log_fn`` callback. The transforms (
to_canonical_units,interpolate_pressure, the ADCP-QC functions, …) log through theoceanarraylogger hierarchy. Alog_fn=argument still works but warns and is removed in 0.7.0; configure logging instead (the CLI does this —-q/-vset the level).oceanarray.logger.enable_logging/disable_loggingare likewise deprecated — setlogging.getLogger("oceanarray").disabledor uselogging.disable.