Skip to content

Releases: PlymouthMarineLaboratory/nctoolkit

v1.3.11

Choose a tag to compare

@robertjwilson robertjwilson released this 01 Nov 17:33

This release make improvements to the nc_plot method. This now covers a larger number of grids, and has been tested to plot all CMIP6 native grids, and likely covers >90% of netCF grids.

v1.3.10

Choose a tag to compare

@robertjwilson robertjwilson released this 23 Oct 08:30

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

Choose a tag to compare

@robertjwilson robertjwilson released this 21 Oct 11:41

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

Choose a tag to compare

@robertjwilson robertjwilson released this 16 Oct 12:43

This release makes nctoolkit compatible with macOS once again.

No other changes apply.

v1.3.7

Choose a tag to compare

@robertjwilson robertjwilson released this 08 Oct 12:06

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

Choose a tag to compare

@robertjwilson robertjwilson released this 30 Sep 08:10

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

Choose a tag to compare

@robertjwilson robertjwilson released this 29 Sep 10:09

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

Choose a tag to compare

@robertjwilson robertjwilson released this 28 Sep 08:49

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. In annual_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, matching get_safe() and
    get_tempdirs().
  • Iterating the shared warnings/safe-file lists used in parallel mode relied
    on a manager-proxy IndexError to signal the end of the list. On Python
    3.12, that exception could form a reference cycle that kept the calling
    frame — and so the DataSet it referenced — alive longer than
    expected, delaying cleanup. A new internal get_warnings() helper, and
    slicing rather than iterating elsewhere, avoid this.
  • generate_grid(): the regular-grid check mixed is False with |, 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-file DataSet is now passed to ncplot as a single
    path rather than a one-item list, for compatibility with ncplot
    versions that cannot handle a list there.

Dependencies

  • Requires ncplot>=0.4.0 (previously >=0.2.8).

v1.3.3

Choose a tag to compare

@robertjwilson robertjwilson released this 24 Sep 08:47

v1.3.3

New

  • DataSet.to_transect() — extracts a straight-line transect between
    two points. It places nsteps evenly spaced points (including both ends)
    along the line between start and end, 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 method defaults to bilinear ("bil") and accepts any of the
    regrid methods ("nn", "bic", "dis", "con", "con2", "laf").
    Invalid start, end or nsteps values raise a clear TypeError or
    ValueError.

Documentation

  • New Gallery section on the website, with worked examples:
    • Working with transects — extract a transect through the Atlantic
      with to_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.
  • to_transect is documented in the API reference, and the cheat sheet has a
    new how-to entry for extracting a straight-line transect.
  • Each pub_plot option in the gallery now shows its accepted values on click.

v1.3.2

Choose a tag to compare

@robertjwilson robertjwilson released this 23 Sep 08:29

v1.3.2

New

  • nc.panel_plot() — draws a grid of pub_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. Set shared_colourbar=False to give each
    panel its own colour scale and colour bar instead. The grid layout
    (nrow/ncol) is chosen automatically if not given.
  • Any panel_plot argument — including the ones it shares with
    pub_plot, such as var, extent, land, colours and limits —
    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 of grid, which now only controls the grid lines.

Fixed

pub_plot:

  • dpi was silently ignored; saved figures always used matplotlib's default
    resolution rather than the requested one.
  • coast=None raised a ValueError instead of turning coastlines off.
  • coast="coarse"/"low"/"intermediate"/"high"/"full" all produced the
    same coastline resolution.
  • A user-supplied projection was silently overridden with Robinson whenever
    the data covered the whole globe.
  • A custom legend was placed beside the colour bar instead of underneath it
    when legend_position="bottom".

panel_plot:

  • out="~/some/path.png" failed with FileNotFoundError; ~ is now
    expanded to the home directory, matching to_nc.

Documentation

  • Every pub_plot parameter 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_plot is 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 varying land, grid, colours
    and limits per panel) and a gallery of pub_plot options.