What’s New#

v0.0.14 (unreleased)#

New Features#

Breaking changes#

  • Renamed DataTree.lineage to DataTree.parents to match pathlib vocabulary (GH#283, GH#286)

  • Minimum required version of xarray is now 2023.12.0, i.e. the latest version. This is required to prevent recent changes to xarray’s internals from breaking datatree. (GH#293, GH#294) By Tom Nicholas.

  • Change default write mode of DataTree.to_zarr() to 'w-' to match xarray default and prevent accidental directory overwrites. (GH#274, GH#275) By Sam Levang.

Deprecations#

  • Renamed DataTree.lineage to DataTree.parents to match pathlib vocabulary (GH#283, GH#286). lineage is now deprecated and use of parents is encouraged. By Etienne Schalk.

Bug fixes#

Documentation#

Internal Changes#

v0.0.13 (27/10/2023)#

New Features#

Breaking changes#

Bug fixes#

Documentation#

Internal Changes#

  • No longer use the deprecated distutils package.

v0.0.12 (03/07/2023)#

New Features#

Breaking changes#

Deprecations#

Bug fixes#

Documentation#

Internal Changes#

v0.0.11 (01/09/2023)#

Big update with entirely new pages in the docs, new methods (.drop_nodes, .filter, .leaves, .descendants), and bug fixes!

New Features#

Breaking changes#

Deprecations#

Bug fixes#

Documentation#

Internal Changes#

v0.0.10 (12/07/2022)#

Adds accessors and a .pipe() method.

New Features#

Breaking changes#

Deprecations#

Bug fixes#

Documentation#

Internal Changes#

v0.0.9 (07/14/2022)#

New Features#

Breaking changes#

Deprecations#

Bug fixes#

Documentation#

Internal Changes#

v0.0.7 (07/11/2022)#

New Features#

  • Improve the HTML repr by adding tree-style lines connecting groups and sub-groups (GH#109). By Benjamin Woods.

Breaking changes#

  • The DataTree.ds attribute now returns a view onto an immutable Dataset-like object, instead of an actual instance of xarray.Dataset. This make break existing isinstance checks or assert comparisons. (GH#99) By Tom Nicholas.

Deprecations#

Bug fixes#

  • Modifying the contents of a DataTree object via the DataTree.ds attribute is now forbidden, which prevents any possibility of the contents of a DataTree object and its .ds attribute diverging. (GH#38, GH#99) By Tom Nicholas.

  • Fixed a bug so that names of children now always match keys under which parents store them (GH#99). By Tom Nicholas.

Documentation#

  • Added Data Structures page describing the internal structure of a DataTree object, and its relation to xarray.Dataset objects. (GH#103) By Tom Nicholas.

  • API page updated with all the methods that are copied from xarray.Dataset. (GH#41) By Tom Nicholas.

Internal Changes#

  • Refactored DataTree class to store a set of xarray.Variable objects instead of a single xarray.Dataset. This approach means that the DataTree class now effectively copies and extends the internal structure of xarray.Dataset. (GH#41) By Tom Nicholas.

  • Refactored to use intermediate NamedNode class, separating implementation of methods requiring a name attribute from those not requiring it. By Tom Nicholas.

  • Made testing.test_datatree.create_test_datatree into a pytest fixture (GH#107). By Benjamin Woods.

v0.0.6 (06/03/2022)#

Various small bug fixes, in preparation for more significant changes in the next version.

Bug fixes#

v0.0.5 (05/05/2022)#

  • Major refactor of internals, moving from the DataTree.children attribute being a Tuple[DataTree] to being a OrderedDict[str, DataTree]. This was necessary in order to integrate better with xarray’s dictionary-like API, solve several issues, simplify the code internally, remove dependencies, and enable new features. (GH#76) By Tom Nicholas.

New Features#

  • Syntax for accessing nodes now supports file-like paths, including parent nodes via "../", relative paths, the root node via "/", and the current node via ".". (Internally it actually uses pathlib now.) By Tom Nicholas.

  • New path-like API methods, such as .relative_to, .find_common_ancestor, and .same_tree.

  • Some new dictionary-like methods, such as DataTree.get and DataTree.update. (GH#76) By Tom Nicholas.

  • New HTML repr, which will automatically display in a jupyter notebook. (GH#78) By Tom Nicholas.

  • New delitem method so you can delete nodes. (GH#88) By Tom Nicholas.

  • New to_dict method. (GH#82) By Tom Nicholas.

Breaking changes#

  • Node names are now optional, which means that the root of the tree can be unnamed. This has knock-on effects for a lot of the API.

  • The __init__ signature for DataTree has changed, so that name is now an optional kwarg.

  • Files will now be loaded as a slightly different tree, because the root group no longer needs to be given a default name.

  • Removed tag-like access to nodes.

  • Removes the option to delete all data in a node by assigning None to the node (in favour of deleting data by replacing the node’s .ds attribute with an empty Dataset), or to create a new empty node in the same way (in favour of assigning an empty DataTree object instead).

  • Removes the ability to create a new node by assigning a Dataset object to DataTree.__setitem__.

  • Several other minor API changes such as .pathstr -> .path, and from_dict’s dictionary argument now being required. (GH#76) By Tom Nicholas.

Deprecations#

Bug fixes#

Documentation#

  • Quick-overview page updated to match change in path syntax (GH#76) By Tom Nicholas.

Internal Changes#

  • Basically every file was changed in some way to accommodate (GH#76).

  • No longer need the utility functions for string manipulation that were defined in utils.py.

  • A considerable amount of code copied over from the internals of anytree (e.g. in render.py and iterators.py). The Apache license for anytree has now been bundled with datatree. (GH#76). By Tom Nicholas.

v0.0.4 (31/03/2022)#

v0.0.3 (30/03/2022)#

  • First released version available on both pypi (as xarray-datatree)!