MCPcopy
hub / github.com/pydata/xarray / get_all_dims

Method get_all_dims

xarray/core/indexes.py:1845–1866  ·  view source on GitHub ↗

Return all dimensions shared by an index. Parameters ---------- key : hashable Index key. errors : {"raise", "ignore"}, default: "raise" If "raise", raises a ValueError if `key` is not in indexes. If "ignore", an empty tuple is ret

(
        self, key: Hashable, errors: ErrorOptions = "raise"
    )

Source from the content-addressed store, hash-verified

1843 return {k: self._variables[k] for k in all_coord_names}
1844
1845 def get_all_dims(
1846 self, key: Hashable, errors: ErrorOptions = "raise"
1847 ) -> Mapping[Hashable, int]:
1848 """Return all dimensions shared by an index.
1849
1850 Parameters
1851 ----------
1852 key : hashable
1853 Index key.
1854 errors : {"raise", "ignore"}, default: "raise"
1855 If "raise", raises a ValueError if `key` is not in indexes.
1856 If "ignore", an empty tuple is returned instead.
1857
1858 Returns
1859 -------
1860 dims : dict
1861 A dictionary of all dimensions shared by an index.
1862
1863 """
1864 from xarray.core.variable import calculate_dimensions
1865
1866 return calculate_dimensions(self.get_all_coords(key, errors=errors))
1867
1868 def group_by_index(
1869 self,

Callers 2

padMethod · 0.80
test_get_all_dimsMethod · 0.80

Calls 2

get_all_coordsMethod · 0.95
calculate_dimensionsFunction · 0.90

Tested by 1

test_get_all_dimsMethod · 0.64