Repository navigation
Releases: PlymouthMarineLaboratory/nctoolkit
Release list
v1.3.11
v1.3.10
This release makes some improvements to nctoolkit internals to reduce the likelihood of processes not being fully terminated when nctoolkit crashes. No changes to methods etc. have been made.
v1.3.9
This release makes some improvements to NCToolkit internals to make the package compatible with recent conda forge releases of Climate Data Operators.
v1.3.8
This release makes nctoolkit compatible with macOS once again.
No other changes apply.
v1.3.7
This release makes some improvements to nctooolkit internals. An issue was causing nctoolkit to stall occassionaly when it was called within a parallel processing chain. This release should deal with that problem.
v1.3.6
This is a minor release that fixes issues with the setup files for pip. No changes have been made to the nctoolkit code base.
v1.3.5
This is a minor release that makes some improvements to nctoolkit internals. Some improvements have been made that will reduce the occurrence of temporary files hanging around longer than is needed.
v1.3.4
v1.3.4
This releases makes some internal improvements for nctoolkit to ensure users can switch cleanly between parallel and non-parallel model.
Fixed
- Fixed safe-list handling when switching parallel mode: items were being
removed from a list while looping over it, which skipped every other file.
Whole lists are now moved instead. Inannual_anomaly, this also removed a
workaround loop that is no longer needed, stops the pool before resetting
on failure, keeps results in input-file order rather than completion
order, and re-raises all worker errors instead of swallowing some of them. get_protected()returned the live, shared parallel-mode file list rather
than a copy, so callers could accidentally mutate nctoolkit's internal
bookkeeping. It now returns a snapshot, matchingget_safe()and
get_tempdirs().- Iterating the shared warnings/safe-file lists used in parallel mode relied
on a manager-proxyIndexErrorto signal the end of the list. On Python
3.12, that exception could form a reference cycle that kept the calling
frame — and so theDataSetit referenced — alive longer than
expected, delaying cleanup. A new internalget_warnings()helper, and
slicing rather than iterating elsewhere, avoid this. generate_grid(): the regular-grid check mixedis Falsewith|, which
parsed as a chained comparison and only triggered when both longitude and
latitude were irregular. Grids irregular in a single dimension were
wrongly written out as lon/lat grids; both dimensions are now checked
independently.plot(): a single-fileDataSetis now passed toncplotas a single
path rather than a one-item list, for compatibility withncplot
versions that cannot handle a list there.
Dependencies
- Requires
ncplot>=0.4.0(previously>=0.2.8).
v1.3.3
v1.3.3
New
-
DataSet.to_transect()— extracts a straight-line transect between
two points. It placesnstepsevenly spaced points (including both ends)
along the line betweenstartandend, given as[lon, lat], in lon/lat
space, and regrids the dataset onto them:ds.to_transect(start=[-30, 0], end=[-30, 65], nsteps=66)
The remapping
methoddefaults to bilinear ("bil") and accepts any of the
regridmethods ("nn","bic","dis","con","con2","laf").
Invalidstart,endornstepsvalues raise a clearTypeErroror
ValueError.
Documentation
- New Gallery section on the website, with worked examples:
- Working with transects — extract a transect through the Atlantic
withto_transect, then map it and chart it against latitude and time. - Nitrate from the World Ocean Atlas — a transect down the Atlantic
and a single profile.
- Working with transects — extract a transect through the Atlantic
to_transectis documented in the API reference, and the cheat sheet has a
new how-to entry for extracting a straight-line transect.- Each
pub_plotoption in the gallery now shows its accepted values on click.
v1.3.2
v1.3.2
New
nc.panel_plot()— draws a grid ofpub_plot-style maps from a
dictionary of{title: dataset}. Panels share one colour scale and one
colour bar by default, worked out from the data of every panel together, so
they can be compared directly. Setshared_colourbar=Falseto give each
panel its own colour scale and colour bar instead. The grid layout
(nrow/ncol) is chosen automatically if not given.- Any
panel_plotargument — including the ones it shares with
pub_plot, such asvar,extent,land,coloursandlimits—
can be a single value applied to every panel, or a list with one value per
panel. Colour-bar arguments (colours,norm,limits,robust,
legend,legend_position,breaks,font) must stay single values when
shared_colourbar=True. pub_plot(grid_labels=False)hides the lon/lat labels around the map,
independently ofgrid, which now only controls the grid lines.
Fixed
pub_plot:
dpiwas silently ignored; saved figures always used matplotlib's default
resolution rather than the requested one.coast=Noneraised aValueErrorinstead of turning coastlines off.coast="coarse"/"low"/"intermediate"/"high"/"full"all produced the
same coastline resolution.- A user-supplied
projectionwas silently overridden with Robinson whenever
the data covered the whole globe. - A custom
legendwas placed beside the colour bar instead of underneath it
whenlegend_position="bottom".
panel_plot:
out="~/some/path.png"failed withFileNotFoundError;~is now
expanded to the home directory, matchingto_nc.
Documentation
- Every
pub_plotparameter is now documented in detail, both in the
function's docstring and on the website: accepted formats, valid options
and default behaviour, including previously undocumented arguments
(grid_colour,font,fig/gs,relief). panel_plotis documented on the API reference and on the visualization
guide, with worked examples (a shared seasonal climatology, per-panel
colour bars, and a fine-tuning example varyingland,grid,colours
andlimitsper panel) and a gallery ofpub_plotoptions.