narupatools.util.properties

Generate properties without having to write getter and setter.

Functions

auto

Convert an empty annotated function into a property.

boolean

get_converter

integer

number

numpy

Property internally stored as a NumPy array.

string

to_bool

Property stored as a bool.

to_float

Property stored as a float.

to_int

Property stored as an int.

to_list

to_property

to_serializable

to_str

Property stored as a string.

to_unit_quaternion

unit_quaternion

narupatools.util.properties.auto(f: Callable)Any

Convert an empty annotated function into a property.

narupatools.util.properties.boolean(f: Callable)_TValue
narupatools.util.properties.get_converter(annot)
narupatools.util.properties.integer(f: Callable)_TValue
narupatools.util.properties.number(f: Callable)_TValue
narupatools.util.properties.numpy(*, dtype: Union[numpy.dtype, None, type, numpy.typing._dtype_like._SupportsDType[numpy.dtype], str, Tuple[Any, int], Tuple[Any, Union[SupportsIndex, Sequence[SupportsIndex]]], List[Any], numpy.typing._dtype_like._DTypeDict, Tuple[Any, Any]], shape: Tuple[Optional[int]])Callable[[Any], numpy.ndarray]

Property internally stored as a NumPy array.

narupatools.util.properties.string(f: Callable)_TValue
narupatools.util.properties.to_bool(value: Any)bool

Property stored as a bool.

narupatools.util.properties.to_float(value: Any)float

Property stored as a float.

narupatools.util.properties.to_int(value: Any)int

Property stored as an int.

narupatools.util.properties.to_list(item_converter)
narupatools.util.properties.to_property(converter: Callable[[Any], _TValue])Callable[[Callable], _TValue]
narupatools.util.properties.to_serializable(serializable_type)
narupatools.util.properties.to_str(value: Any)str

Property stored as a string.

narupatools.util.properties.to_unit_quaternion(value: Any)quaternion.quaternion
narupatools.util.properties.unit_quaternion(f: Callable)_TValue