Path¶
- class dsviper.Path(path=None)¶
Bases:
objectConstructs the location of a portion of a value.
Build one with Path() and append components, or start from a static factory: from_field, from_index, from_key, from_position, from_entry, from_element and from_unwrap.
A Path and a PathConst with the same components compare equal: they carry the same path, and only the Path can still be extended.
- static decode(blob: ValueBlob, definitions: DefinitionsConst, *, stream_codec_instancing: StreamCodecInstancing | None = None) Path¶
Return a Path by decoding the blob with Codec.STREAM_BINARY if not specified.
- element(index: int) Path¶
Append an element component at index and return self.
An element addresses a member of a set, which has no key to address it by.
- entry(key: _InputValues) Path¶
Append an entry component for key and return self.
An entry component addresses the key itself, which a key component, addressing the value, cannot reach.
- field(name: str) Path¶
Append a field component for name and return self, addressing that field of a struct.
- static from_position(position: ValueUUId) Path¶
Return a Path of one position component for position.
- index(value: int) Path¶
Append an index component for value and return self, addressing the element at that index of a vector or a tuple.
- key(value: _InputValues) Path¶
Append a key component for value and return self, addressing the value a map holds under that key.
- position(value: ValueUUId) Path¶
Append a position component for value and return self, addressing the element an xarray holds at that position.
- static read(stream_reading: StreamReading, definitions: DefinitionsConst) Path¶
Read and return a Path.
- representation() str¶
Return a string representation.