dca.dataclass_array#

dataclass_array.dataclass_array(*, broadcast: bool = False, cast_dtype: bool = False, cast_list: bool = True) Callable[[type[dataclass_array.array_dataclass._DcT]], type[dataclass_array.array_dataclass._DcT]][source]#

Optional decorator to customize dca.DataclassArray params.

Usage:

@dca.dataclass_array()
class MyDataclass(dca.DataclassArray):
  ...

This decorator has to be added in addition of inheriting from dca.DataclassArray.

Parameters:
  • broadcast – If True, enable input broadcasting

  • cast_dtype – If True, auto-cast inputs dtype

  • cast_list – If True, auto-cast lists to xnp.ndarray

Returns:

The decorator which will apply the options to the dataclass

Return type:

decorator