Skip to content

Commit 6cab6f8

Browse files
committed
remove content about non-inherited coords for a follow-up PR
1 parent d2918bb commit 6cab6f8

File tree

1 file changed

+0
-55
lines changed

1 file changed

+0
-55
lines changed

doc/user-guide/hierarchical-data.rst

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -798,58 +798,3 @@ We can also still perform all the same operations on the whole tree:
798798
dt.std(dim="time")
799799
800800
(TODO: The second one fails due to https://github.com/pydata/xarray/issues/8949)
801-
802-
.. _overriding-inherited-coordinates:
803-
804-
Overriding Inherited Coordinates
805-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
806-
807-
We can override inherited coordinates with newly-defined ones on child nodes, as long as those newly-defined coordinates also align with the parent nodes.
808-
809-
You may want to do this if some child dataset follows the same pattern as its siblings but contains different specific values of a coordinate.
810-
811-
Let's image we had three different datasets, on two different lat-lon grids:
812-
813-
.. ipython:: python
814-
815-
lon1, lat1 = np.meshgrid(np.linspace(-20, 20, 5), np.linspace(0, 30, 4))
816-
grid1 = xr.Coordinates({'lat': lat1, 'lon': lon1})
817-
818-
# a different grid with the same sizes
819-
lon2 = lat1 + (lat1 / 10)
820-
lat2 = lon1 + (lon1 / 10)
821-
grid1 = xr.Coordinates({'lat': lat2, 'lon': lon2})
822-
823-
# model_ds1 = xr.Dataset()
824-
# model_ds2 = xr.Dataset()
825-
# model_ds3 = xr.Dataset()
826-
827-
We could arrange these in a datatree
828-
829-
.. ipython:: python
830-
831-
dt = xr.DataTree.from_dict(
832-
{
833-
"/": Dataset(coords=grid1),
834-
"model1": None,
835-
"model2": None,
836-
"model3": Dataset(coords=grid2),
837-
}
838-
)
839-
dt
840-
841-
However in this you could also have reprented this without overriding, by using an extra layer of nodes in the tree:
842-
843-
844-
.. _overriding-inherited-coordinates:
845-
846-
Non-Inherited Coordinates
847-
~~~~~~~~~~~~~~~~~~~~~~~~~
848-
849-
Only coordinates which are backed by an index are inherited. This is because index-backed coordinates can be efficiently de-duplicated between parents and children, preventing ambiguity
850-
851-
852-
853-
EXAMPLE OF INHERITING FROM A GRANDPARENT?
854-
855-
EXPLAIN DEDUPLICATION?

0 commit comments

Comments
 (0)