Nctoolkit

Latest version: v1.1.10

Safety actively analyzes 629765 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 11

0.4.5

This is a minor release.

A couple of improvements have been made to the `matchpoint` methods.

This release is largely being made to deal with the fact that the readthedocs failed to produce the docs for version 0.4.4.

0.4.4

A minor release with enhancements.

This version introduces a new class called `Matchpoint` which will allow automated matchups between netCDF files and point observations in pandas dataframes. This class is created using ``nc.open_matchpoint``. Matchups are generated by using the ``add_data``, ``add_points``, ``add_depths``, and ``matchup`` methods.

For datasets, ``ds`` now provides a more informative summary of dataset contents.

The ``split`` method now automatically sorts the files, so that they are sorted by date when temporal splitting occurs.

The methods ``surface``, ``merge_time`` and ``tvariance have been removed after periods of deprecation. Use ``top``, ``merge`` and ``tvar`` instead.

0.4.3

This is a release with some new methods, improvements to internals and some bug fixes. Code written for previous 0.4x versions of nctoolkit will be compatible.

This version will be compatible with CDO versions 2.0.5x.

A new function ``open_geotiff`` will allow GeoTiff files to be opened. This is a wrapper around rioxarray, which will convert the GeoTiff to NetCDF. It will require rioxarray to be installed.

A new method ``surface_mask`` has been added to enable identifying top levels with data in cases when there are missing values in the actual top level.

A new method ``is_corrupt`` has been added. This can identify whether NetCDF files are likely to be corrupt. Under-the hood, methods will now suggest running ``is_corrupt`` when system errors imply the files are corrupt.

The methods ``to_xarray`` and ``to_dataframe`` no long accept the `cdo_times` argument, as this has essentially been redundant for a few nctoolkit versions.

The ``plot`` method now lets users send kwargs to hvplot to make customizations, such as log-scales an option. This will require the latest version of ncplot.

The ``select`` method now lets user select days of month, using ``ds.select(day = 1)``.

The ``split`` method now allows splitting by timestep using ``split("timestep")``.

0.4.2

This is a minor release that includes a couple of method enhancements.

You can now save plots as html file using the `out` argument. An example of how to do this is as follows:

ds.plot(out = "foo.nc")

The `nc_command` method now automatically uses multiple cores when these are set by `nc.options`. Previously it could not run in parallel on multi-file datasets.

0.4.1

This is a minor release focusing on improving nctoolkit internals.

New methods and improvements

A new method, called ``check`` is introduced that can be used to troubleshoot data problems and to ensure there are no obvious data issues (such as a lack of CF-compliance).

Users can now access dataset calendars using ``ds.calendar``.

The ``drop`` method now lets you remove time steps using the ``times`` argument.

The dataset attribute `variables_detailed` is now removed after being replaced by `contents` in version 0.3.9.

Some coding improvements have enhanced the performance of the ``add``, ``subtract`` etc. methods.

Support for older versions of CDO

This version will recommend a CDO version of at least 1.9.7, because ensuring nctoolkit compatibility with earlier versions was becoming difficult and likely of little need to users.



Bug fixes

The methods ``multiply`` etc. failed when datasets did not have time as a dimension in version 0.4.0. This is now fixed. Previously, `ds.contents` always returned None for the number of time steps. Now fixed.

0.4.0

This is a major release that features some breaking changes.

Methods for adding, subtracting, multipling and dividing datasets from each other will be enhanced. Until now these methods used a simplistic approach where values from matching time steps were added to each other, etc. So if you are subtracting a 12 time step file from a dataset, only the first 12 time steps were subtracted from. However, often this is not what you want. For example, you might want to subtract data from a file which contains montly values for each year.

This version of nctoolkit updates these methods so that it can automatically figure out, in most cases, what kind of addition etc. it should carry out. For example, if you have a dataset which has monthly values for each year from 1950 to 1999, and use ``subtract`` to subtract the values from a file which contains annual means for each year from 1950, it will subtract the annual mean for 1950 from each month in 1950 and the the annual mean for 1951 from each month in 1951, and so on.

Users are now able to specify the numeric precision of datasets using ``ds.set_precision``. By default, nctoolkit uses the underlying netCDF files's data type. This is normally not a problem. However, when the data type is integer, this can cause problems. ``nc.open_data`` has been updated with this issue in mind. It will now warn users when the data type of the netCDF is integer, and it will suggest switching to float 'F64' or 'F32'.

The ``drop`` method has been enhanced. It now accepts day, month and year as arguments to enable dropping specific time periods. For example ``ds.drop(month = 2, day = 29)`` will remove leap days. Code written to use the old ``drop`` method will now fail, as keywords are now required.

The method ``surface`` has now been renamed ``top`` for consistency with ``bottom``. ``surface`` is deprecated and will be removed in a few months.

The ``split`` method now allows users to split datasets into multiple files by variable.

``ds.times`` now returns a datetime object, not a str as before.

Page 8 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.