Tom Nicholas

Results 182 issues of Tom Nicholas

Follows on from #180 - [ ] Closes #xxxx - [ ] Tests added - [ ] Passes `pre-commit run --all-files` - [ ] New functions/methods are listed in `api.rst`...

documentation

Broadens the types that getitem and setitem methods accept to include anything that follows the `os.PathLike` protocol. It's possible there are some additional edge cases here that we should forbid,...

So far datatree appears to have got away with cheekily importing and using many private xarray internals, but soon things will start breaking. @andersy005 is hard at work refactoring xarray...

WIP sketch of a new `dt.reorder` method - [x] Closes #186, using suggestion (3) in https://github.com/xarray-contrib/datatree/issues/254#issuecomment-1665946112 - [x] Tests added - [x] Passes `pre-commit run --all-files` - [x] New functions/methods...

enhancement

_Raised by @observingClouds in https://github.com/xarray-contrib/datatree/issues/254#issue-1835784457_ Currently, I use the @map_over_subtree decorator, which also has some limitations as the function does not know its tree origin ([as noted in the code](https://github.com/xarray-contrib/datatree/blob/696cec9e6288ba9e8c473cd1ba527122edef2b1c/datatree/datatree.py#L1219C38-L1219C38))...

enhancement
design question

@andersy005, @jbusecke and I noticed that for big trees (hundreds or thousands of nodes) the HTML repr can become very slow to render, potentially locking up your jupyter notebook. We...

html repr

We might be able to use the [`walk_up` parameter added to `pathlib.PurePath.relative_to` in python 3.12](https://github.com/xarray-contrib/datatree/blob/68a658ffc8779ee7daed21433e6d4719c2b57eac/datatree/treenode.py#L611) to simplify some internal logic for handling relative tree paths. Only relevant if we can...

It would be cool to be able to visualize the structure of the tree as a diagram, similar to how you can [visualize dask graphs](https://docs.dask.org/en/stable/graphviz.html). What would be even cooler...

enhancement

I've routinely wanted something that says select these variable names from all nodes. This is way too much typing for that: ``` python dailies.map_over_subtree(lambda n: n[["KT", "eps", "chi"]]) ``` Perhaps...

good first issue

Multiple people have requested methods for collapsing children or subtrees into single nodes. Following on from [our discourse discussion](https://discourse.pangeo.io/t/xarray-and-collections-of-forecasts/3054/6?u=tomnicholas) @abkfenris @patrickcgray Also see https://github.com/pydata/xarray/issues/3996#issuecomment-1373993285 @rabernat @ --- How about an...

enhancement
good first issue