pytower.util

class pytower.util.XYZ(*args)[source]
Return type:

XYZ

EPSILON = 1e-10[source]
__eq__(other)[source]

Return self==value.

Parameters:

other (XYZ)

__getitem__(item)[source]

Return self[key].

__hash__ = None[source]
static __new__(cls, *args)[source]
Return type:

XYZ

clamp(min_clamp, max_clamp)[source]
Parameters:
  • min_clamp (XYZ)

  • max_clamp (XYZ)

distance(other)[source]
Parameters:

other (XYZ)

static fold(func, *args, acc=None)[source]
Parameters:
static max(*args)[source]

Return the maximum along a given axis.

Refer to numpy.amax for full documentation.

See also

numpy.amax

equivalent function

Parameters:

args (XYZ)

static min(*args)[source]

Return the minimum along a given axis.

Refer to numpy.amin for full documentation.

See also

numpy.amin

equivalent function

Parameters:

args (XYZ)

norm()[source]
normalize()[source]
py_dtype[source]

alias of float

to_dict()[source]
property x[source]
property y[source]
property z[source]
class pytower.util.XYZInt(*args)[source]
Return type:

XYZ

py_dtype[source]

alias of int

class pytower.util.XYZW(*args)[source]
Return type:

XYZW

static __new__(cls, *args)[source]
Return type:

XYZW

to_dict()[source]
property w[source]
pytower.util.dict_walk(data, func)[source]
Parameters:
pytower.util.not_none(obj)[source]
Return type:

TypeVar(T)

Parameters:

obj (T | None)

pytower.util.read_bytearray(fd, buf_size)[source]
Return type:

bytearray

Parameters:
  • fd (BytesIO)

  • buf_size (int)

pytower.util.run_if_not_none(func, data)[source]
pytower.util.xyz(*args, length=3)[source]
Return type:

XYZ

pytower.util.xyz_to_string(data)[source]
Parameters:

data (ndarray)

pytower.util.xyzint(*args)[source]