ValueXArray

class dsviper.ValueXArray

Bases: object

A class used to represent a value of type xarray<element_type>. Seamless with a Python seq[object].

Or use Value.create(type_xarray [, initial_value]).

END = 00000000-0000-0000-0000-000000000000
append(value: _InputValues) ValueUUId

Append value to the end.

at(position: ValueUUId, *, encoded: bool = True) _OutputValues | None

Return the element at the position or None.

static cast(value: Value) ValueXArray

Return a xarray<element_type> or raise.

copy() ValueXArray

Return a deep copy.

static create_position() ValueUUId

Create and return a position.

description(*, namespace: NameSpace | None = None) str

Return the description.

disable_position(position: ValueUUId) None

Disable the position.

extend(values: Sequence | ValueVector) ValueUUId

Extend by appending the values.

has_position(position: ValueUUId) bool

Return True if the position exists.

hash() int

Return the hash value.

index(position: ValueUUId) int | None

Return the index of the position.

insert(before_position: ValueUUId, value: _InputValues, new_position: ValueUUId | None = None) ValueUUId

Insert the value before_position and return the new position. Use new_position if specified, else a new position is created.

insert_position(before_position: ValueUUId, new_position: ValueUUId) None

Insert before_position a new_position.

items(*, encoded: bool = True) list[tuple[ValueUUId, Value]]

Return the list of (position, value) pairs. With encoded=True (default) a scalar value is a Python native; with encoded=False it is a typed Value.

position(index: int) ValueUUId | None

Return the position for the index or None.

position_of(value: _InputValues) ValueUUId | None

Return the position of the value or None.

positions() list[ValueUUId]

Return the list of positions.

rebuild_from(source: ValueXArray, elements: Sequence[tuple[ValueUUId, _InputValues]]) None

Rebuild self ATOMICALLY from another XArray’s position layout (positions and deleted positions, copied opaquely from source) together with elements — a sequence of (position, value) pairs. The whole target state is installed in a single step, so self never passes through a partial state (no foreign-typed values, no positions without values). This is the trans-definitions (de)serialization of an XArray: source’s layout verbatim, elements provided already re-mapped to self’s domain.

remove(position: ValueUUId) None

Remove the element at the position.

representation() str

Return the representation.

set(position: ValueUUId, value: _InputValues)

Set the value at the position.

to_vector() ValueVector

Convert to a vector<element_type>.

type() Type

Return the type.

type_code() str

Return the type code.

type_xarray() TypeXArray

Return the type xarray<element_type>.