sup3r.preprocessing.collections.base.Collection#
- class Collection(containers: List[Container] | List[Sampler] | List[DualSampler])[source]#
Bases:
Container
Object consisting of a set of containers. These objects are distinct from
Sup3rDataset
objects, which also contain multiple data members, because these members are completely independent of each other. They are collected together for the purpose of expanding a training dataset (e.g. BatchHandlers).- Parameters:
data (Union[Sup3rX, Sup3rDataset, Tuple[Sup3rX, …],) – Tuple[Sup3rDataset, …] Can be an
xr.Dataset
, aSup3rX
object, aSup3rDataset
object, or a tuple of such objects.Note
.data
will return aSup3rDataset
object or tuple of such. This is a tuple when the .data attribute belongs to aCollection
object likeBatchHandler
. Otherwise this isSup3rDataset
object, which is either a wrapped 2-tuple or 1-tuple (e.g.len(data) == 2
orlen(data) == 1)
. This is a 2-tuple when.data
belongs to a dual container object likeDualSampler
and a 1-tuple otherwise.
Methods
check_shared_attr
(attr)Check if all containers have the same value for attr.
post_init_log
([args_dict])Log additional arguments after initialization.
wrap
(data)Return a
Sup3rDataset
object or tuple of such.Attributes
Get weights used to sample from different containers based on relative sizes
Return underlying data.
Get all features contained in data.
Get shape of underlying data.
- property data#
Return underlying data.
- Returns:
See also
- property features#
Get all features contained in data.
- property container_weights#
Get weights used to sample from different containers based on relative sizes
Check if all containers have the same value for attr. If they do the collection effectively inherits those attributes.
- post_init_log(args_dict=None)#
Log additional arguments after initialization.
- property shape#
Get shape of underlying data.
- wrap(data)#
Return a
Sup3rDataset
object or tuple of such. This is a tuple when the .data attribute belongs to aCollection
object likeBatchHandler
. Otherwise this isSup3rDataset
object, which is either a wrapped 2-tuple or 1-tuple (e.g.len(data) == 2
orlen(data) == 1)
. This is a 2-tuple when.data
belongs to a dual container object likeDualSampler
and a 1-tuple otherwise.