Attention
This repository has been archived. Please use xarray.DataTree instead.
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 matchxarray
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#
Keep attributes on nodes containing no data in
map_over_subtree()
. (GH#278, GH#279) By Sam Levang.
Documentation#
Use
napoleon
instead ofnumpydoc
to align with xarray documentation (GH#284, GH#298). By Etienne Schalk.
Internal Changes#
v0.0.13 (27/10/2023)#
New Features#
New
DataTree.match()
method for glob-like pattern matching of node paths. (GH#267) By Tom Nicholas.New
DataTree.is_hollow()
property for checking if data is only contained at the leaf nodes. (GH#272) By Tom Nicholas.Indicate which node caused the problem if error encountered while applying user function using
map_over_subtree()
(GH#190, GH#264). Only works when using python 3.11 or later. By Tom Nicholas.
Breaking changes#
Nodes containing only attributes but no data are now ignored by
map_over_subtree()
(GH#262, GH#263) By Tom Nicholas.Disallow altering of given dataset inside function called by
map_over_subtree()
(GH#269, reverts part of GH#194). By Tom Nicholas.
Bug fixes#
Fix unittests on i386. (GH#249) By Antonio Valentino.
Ensure nodepath class is compatible with python 3.12 (GH#260) By Max Grover.
Documentation#
Added new sections to page on
Working with Hierarchical Data
(GH#180) By Tom Nicholas.
Internal Changes#
No longer use the deprecated distutils package.
v0.0.12 (03/07/2023)#
New Features#
Added a
DataTree.level()
,DataTree.depth()
, andDataTree.width()
property (GH#208). By Tom Nicholas.Allow dot-style (or “attribute-like”) access to child nodes and variables, with ipython autocomplete. (GH#189, GH#98) By Tom Nicholas.
Breaking changes#
Deprecations#
Dropped support for python 3.8 (GH#212, GH#214) By Tom Nicholas.
Bug fixes#
Allow for altering of given dataset inside function called by
map_over_subtree()
(GH#188, GH#194). By Tom Nicholas.copy subtrees without creating ancestor nodes (GH#201) By Justus Magin.
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#
Added a
DataTree.drop_nodes()
method (GH#161, GH#175). By Tom Nicholas.New, more specific exception types for tree-related errors (GH#169). By Tom Nicholas.
Added a new
DataTree.descendants()
property (GH#170). By Tom Nicholas.Added a
DataTree.leaves()
property (GH#177). By Tom Nicholas.Added a
DataTree.filter()
method (GH#184). By Tom Nicholas.
Breaking changes#
DataTree.copy()
copy method now only copies the subtree, not the parent nodes (GH#171). By Tom Nicholas.Grafting a subtree onto another tree now leaves name of original subtree object unchanged (GH#116, GH#172, GH#178). By Tom Nicholas.
Changed the
DataTree.assign()
method to just work on the local node (GH#181). By Tom Nicholas.
Deprecations#
Bug fixes#
Fix bug with
DataTree.relative_to()
method (GH#133, GH#160). By Tom Nicholas.Fix links to API docs in all documentation (GH#183). By Tom Nicholas.
Documentation#
Changed docs theme to match xarray’s main documentation. (GH#173) By Tom Nicholas.
Added
Terminology
page. (GH#174) By Tom Nicholas.Added page on
Working with Hierarchical Data
(GH#179) By Tom Nicholas.Added context content to
Index
page (GH#182) By Tom Nicholas.Updated the README (GH#187) By Tom Nicholas.
Internal Changes#
v0.0.10 (12/07/2022)#
Adds accessors and a .pipe() method.
New Features#
Add the ability to register accessors on
DataTree
objects, by usingregister_datatree_accessor
. (GH#144) By Tom Nicholas.Allow method chaining with a new
DataTree.pipe()
method (GH#151, GH#156). By Justus Magin.
Breaking changes#
Deprecations#
Bug fixes#
Allow
Datatree
objects as values inDataTree.from_dict()
(GH#159). By Justus Magin.
Documentation#
Added
Reading and Writing Files
page. (GH#158) By Tom Nicholas.
Internal Changes#
Avoid reading from same file twice with fsspec3 (GH#130) By William Roberts.
v0.0.9 (07/14/2022)#
New Features#
Breaking changes#
Deprecations#
Bug fixes#
Documentation#
Switch docs theme (GH#123). By JuliusBusecke.
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 ofxarray.Dataset
. This make break existingisinstance
checks orassert
comparisons. (GH#99) By Tom Nicholas.
Deprecations#
Bug fixes#
Modifying the contents of a
DataTree
object via theDataTree.ds
attribute is now forbidden, which prevents any possibility of the contents of aDataTree
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 aDataTree
object, and its relation toxarray.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 ofxarray.Variable
objects instead of a singlexarray.Dataset
. This approach means that theDataTree
class now effectively copies and extends the internal structure ofxarray.Dataset
. (GH#41) By Tom Nicholas.Refactored to use intermediate
NamedNode
class, separating implementation of methods requiring aname
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#
Fixed bug with checking that assigning parent or new children did not create a loop in the tree (GH#105) By Tom Nicholas.
Do not call
__exit__
on Zarr store when opening (GH#90) By Matt McCormick.Fix netCDF encoding for compression (GH#95) By Joe Hamman.
Added validity checking for node names (GH#106) By Tom Nicholas.
v0.0.5 (05/05/2022)#
Major refactor of internals, moving from the
DataTree.children
attribute being aTuple[DataTree]
to being aOrderedDict[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 usespathlib
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
andDataTree.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 forDataTree
has changed, so thatname
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 toDataTree.__setitem__
.Several other minor API changes such as
.pathstr
->.path
, andfrom_dict
’s dictionary argument now being required. (GH#76) By Tom Nicholas.
Deprecations#
No longer depends on the anytree library (GH#76) By Tom Nicholas.
Bug fixes#
Fixed indentation issue with the string repr (GH#86) By Tom Nicholas.
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
anditerators.py
). The Apache license for anytree has now been bundled with datatree. (GH#76). By Tom Nicholas.
v0.0.4 (31/03/2022)#
Ensure you get the pretty tree-like string representation by default in ipython (GH#73). By Tom Nicholas.
Now available on conda-forge (as xarray-datatree)! (GH#71) By Anderson Banihirwe.
Allow for python 3.8 (GH#70). By Don Setiawan.
v0.0.3 (30/03/2022)#
First released version available on both pypi (as xarray-datatree)!