Nctoolkit

Latest version: v1.1.10

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

Scan your dependencies

Page 10 of 11

0.3.2

This is a quick and minor release to fix a bug in `to_nc` that resulted in files not being saved to the base directory if specified.

Other than code tidying, there are not other changes to the package.

0.3.1

This is a minor release that includes new methods, under-the-hood improvements, minor bug fixes and the removal of deprecated methods. Code written for non-deprecated methods in v0.3.0 will be compatible with v0.3.1.

New methods
----------------------------

New methods are introduced for identifying the first time step when specific numerical thresholds are first exceeded or fallen below etc: `first_above`, `first_below`, `last_above` and `last_below`. The thresholds are either single numbers or can come from a gridded dataset for grid-cell specific thresholds.

Methods to compare a dataset with another dataset or netCDF file have been added: `gt` and `lt`, which stand for ‘greater than’ and ‘less than’.

Method improvements
----------------------------
Users will now be able to recycle the weights calculated when interpolating data. This can enable much faster interpolation of multiple files with the same grid.

There have been some under-the-hood improvements to improve automatic deletion of temporary files when running in parallel.

Bug fixes
----------------------------
`assign` threw an error when an internal CDO function was used more than once. This is now fixed.

Method removals post-deprecation
----------------------------

The temporal methods replaced by tmean etc. have now been removed from the package. So all previous temporal averaging methods of the form `daily_`, `monthly_` and `annual_` can no longer be used.

0.3.0

This is a major release that includes important significant enhancements to nctoolkit's functionality and breaking changes to prior releases.

Variable creation

A new method has been added for creating new variables: `assign`. This operates in a similar way to the `assign` method in pandas, and means users can create new variables using lambda functions. This replaces the `mutate` and `transmute` methods, which were always intended to be place-holders for a more effective method.

Parallel processing

nctoolkit processing chains can now be run in parallel after under-the-hood changes. This means you can wrap a processing chain into a function, and use the multiprocessing package to process files in parallel.

Evaluation is now lazy by default

In previous releases, evaluation was eager, not lazy, by default. From now on, evaluation will be lazy by default, but can be changed using `nc.options(lazy = False)`.

Configuration files

The package now accepts the use of a configuration file, which should be called .nctoolkitrc or nctoolkitrc and be placed in your working directory or home directory. This means arguments sent to options can be set permanently or on a project basis. This makes life easier for people who have a small or shared temporary folder that they do not want to write to.


Datasets now have clearer list-like behaviour

Improvements have been made to datasets to make them behave in a more list-like manner. `data.current` will now return a list, whereas in the past it would return a str representing the file in a single-file dataset. This has enabled improvements to how files in datasets can be handled. You can now create an empty dataset, for cases when you need to progressively build a dataset. Likewise, there is now a `remove` method for removing files from datasets, which goes along with the existing `append` method for appending files.

A potential consequence of this is that code that assumes `data.current` etc. is a str will likely break, as it will now be a list.

Removed methods

`select_` methods, such as `select_years`, have been removed after a few months of deprecation. Use `select` instead.

`write_nc` has been removed after a few months of deprecation. Use `to_nc` instead.

`clip` has been removed after a few months of deprecation. Use `crop` instead.

`release` has been removed after a few months of deprecations. Use `run` instead.

Renamings and deprecations

`cell_areas` renamed to `cell_area`.
`mutate` and `transmute` have been replaced by `assign`. These methods have therefore been deprecated and will be deleted in a couple of months.

`remove_variables` is now replaced by `drop`. `remove_variables` is deprecated.

`compare_all` is now replaced by `compare`. `compare_all` is deprecated.

Bug fixes

An error was being thrown when deleting temp files hanging round from NCO failing to create files. This is now fixed.

0.2.4

This minor release adds new features. Code written for prior releases are compatible with this release.

Improved temporal statistics

Calculating temporal statistics has been streamlined. Temporal methods are now prefixed with the letter t, and accept grouping options. So, for example, `data.tmean(["year", "month"])` will calculate the mean value for each month in each year.

Mild enhancements to methods

The `select` and `shift` methods have been tweaked to make life slightly easier for users, and allow partial matches for args. For example `data.shift(hours = 1)` and `data.shift(hour = 1)` are both valid.

open_url is now able to keep attempting to download files for a set period until complete.

open_thredds now has a wait option to stop

Bug fixes

Issues related to user specified temp folders not being set are now fixed.

Renamings and deprecations

Existing temporal statistics methods, such as mean, max etc., have now been deprecated and the new methods tmean etc. should be used.

`vertical_cum_sum` has been renamed to `vertical_cumsum`. `vertical_cum_sum` is now deprecated.

0.2.3

Plotting improvements

Automatic plotting now relies on the new ncplot package. Plotting is now greatly enhanced and includes automatic coastlines.

Mild enhancements to methods

- Users can now specify the temporary folder to be used by nctoolkit with nctoolkit.options(temp_dir = x)


Deprecations and renaming
- `var` is now called `variance` to be more consistent with python. `var` is deprecated and will be removed early 2021.

bug fixes

- append was not working properly for ensembles. Now fixed

0.2.2

This release has some new methods, a minor bug fix and some enhancements. It is fully compatible with code written for the previous release.
New methods

1. `centre`. This method let's you work out the latitudinal and longitudinal centre.
2. `strip_variable`. This method let's you removed associated variables from variables.
3. `resample_grid`. This method let's you resample grids.
4. `format`. This method let's you change the format of dataset NetCDF files.

Deprecations

`write_nc` has been replaced by `to_nc`. `write_nc` will be replaced in a few months.

Bug fixes

1. `cell_areas` was throwing errors for CDO 1.9.6. This is now fixed.

Enhancements

Improvements have been made to `plot` to improve handling of non-spatial datasets. Plotting development is now separated into a new package ncplot. This will become a dependency in an upcoming version of nctoolkit. Read about it [here](https://github.com/pmlmodelling/ncplot).

Page 10 of 11

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.