torchwrench.extras.hdf.dataset module

class torchwrench.extras.hdf.dataset.HDFDataset(hdf_fpath: str | ~pathlib.Path, *, transform: ~typing.Callable[[__SPHINX_IMMATERIAL_TYPE_VAR__V_T], __SPHINX_IMMATERIAL_TYPE_VAR__V_U] | None = <function identity>, keep_padding: ~typing.Iterable[str] = (), return_added_columns: bool = False, open_hdf: bool = True, cast: ~typing.Literal['to_torch_or_builtin', 'to_torch_or_numpy', 'as_builtin', 'to_numpy_src', 'to_torch_src', 'none'] = 'none', file_kwds: ~typing.Dict[str, ~typing.Any] | None = None)[source]

Bases: Generic[T, U], DatasetSlicer[U]

property added_columns : list[str]

Return the list of columns added by pack_to_hdf function.

property all_columns : list[str]

The name of all columns of the dataset.

at(*args, **kwargs) Any[source]

Deprecated: Use get_item method instead.

property attrs : HDFDatasetAttributes
close(ignore_if_closed: bool = False, remove_file: bool = False) None[source]
property column_names : tuple[str, ...]

The name of each column of the dataset.

get_attrs() HDFDatasetAttributes[source]
get_column_dtype(column_name: str) dtype[source]
get_column_shape(column_name: str) tuple[int, ...][source]
get_columns_shapes() dict[str, tuple[int, ...]][source]
get_hdf_fpath() Path[source]
get_hdf_keys() tuple[str, ...][source]
get_item(index: int, column: None = None) U[source]
get_item(index: Iterable[int] | slice | None, column: str) list
get_item(index: Iterable[int] | slice | None, column: list[str] | None = None) dict[str, list]
get_item(index: Any, column: Any, raw: bool = False) Any
property info : dict[str, Any]

Return the global dataset info.

is_closed() bool[source]
is_open() bool[source]
property item_type : 'dict' | 'tuple'

Return the global dataset info.

property keep_padding : list[str]
keys() tuple[str, ...][source]
property num_columns : int
property num_rows : int
open(ignore_if_opened: bool = False) None[source]
property shape : tuple[int, ...]

The shape of the Clotho dataset.

to_dict(raw: bool = False) dict[str, ndarray][source]
property transform : Callable[[T], U] | None
property user_attrs : Any