pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.56k stars 1.07k forks source link

Auto-complete datatree paths containing . or ../ #9440

Open eni-awowale opened 1 week ago

eni-awowale commented 1 week ago

What is your issue?

Copying over from https://github.com/xarray-contrib/datatree/issues/189

Feature Request: Some form of path auto-completion

The more I play with datatree, the more I realize the huge potential of this package. Amazing work @TomNicholas.

I have been using dt for CMIP6 analysis and one of the things that is still fairly slow for me is to navigate into different specific leaves of the tree. Having some sort of incremental auto-complete of the path like this:

dt.['model/<click tab> --> dt.['model/experiment_a/]

similar to what happens in the bash shell with tab completion would be an absolute killer feature. Most users already know how to navigate this (from their terminal). For massive trees this would speed up the workflow tremendously.

On the other hand I have no idea how complex this is to implement. Just wanted to suggest this feature.

TomNicholas commented 1 week ago

To clarify what's said in https://github.com/xarray-contrib/datatree/issues/189 - autocompletion is already implemented, what is not implemented is autocompletion of any path containing a . or ../.

In other words this issue now tracks this ToDo in the code:

https://github.com/pydata/xarray/blob/a74a60508edd844ef425637f27598f1d8c5385a2/xarray/core/datatree.py#L678