Info: Zenodo’s user support line is staffed on regular business days between Dec 23 and Jan 5. Response times may be slightly longer than normal.

There is a newer version of the record available.

Published February 2, 2021 | Version v0.3.0
Software Open

pmlmodelling/nctoolkit: v0.3.0

Creators

  • 1. Plymouth Marine Laboratory

Description

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.

Files

pmlmodelling/nctoolkit-v0.3.0.zip

Files (213.7 MB)

Name Size Download all
md5:98da58e0fc9c7110595e6cf11b3920f8
213.7 MB Preview Download

Additional details

Related works

Funding

The UK Earth system modelling project. NE/N018036/1
UK Research and Innovation
Marine LTSS: Climate Linked Atlantic Sector Science NE/R015953/1
UK Research and Innovation