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

Class Frozen

xarray/core/utils.py:494–518  ·  view source on GitHub ↗

Wrapper around an object implementing the mapping interface to make it immutable. If you really want to modify the mapping, the mutable version is saved under the `mapping` attribute.

Source from the content-addressed store, hash-verified

492
493
494class Frozen(Mapping[K, V]):
495 """Wrapper around an object implementing the mapping interface to make it
496 immutable. If you really want to modify the mapping, the mutable version is
497 saved under the `mapping` attribute.
498 """
499
500 __slots__ = ("mapping",)
501
502 def __init__(self, mapping: Mapping[K, V]):
503 self.mapping = mapping
504
505 def __getitem__(self, key: K) -> V:
506 return self.mapping[key]
507
508 def __iter__(self) -> Iterator[K]:
509 return iter(self.mapping)
510
511 def __len__(self) -> int:
512 return len(self.mapping)
513
514 def __contains__(self, key: object) -> bool:
515 return key in self.mapping
516
517 def __repr__(self) -> str:
518 return f"{type(self).__name__}({self.mapping!r})"
519
520
521def FrozenDict(*args, **kwargs) -> Frozen:

Callers 15

childrenMethod · 0.90
variablesMethod · 0.90
sizesMethod · 0.90
dtypesMethod · 0.90
variablesMethod · 0.90
dimsMethod · 0.90
chunksizesMethod · 0.90
dtypesMethod · 0.90
dtypesMethod · 0.90
variablesMethod · 0.90
dimsMethod · 0.90
dtypesMethod · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…