ksuit.factory.dataset_factory ============================= .. py:module:: ksuit.factory.dataset_factory Classes ------- .. autoapisummary:: ksuit.factory.dataset_factory.DatasetFactory Module Contents --------------- .. py:class:: DatasetFactory(dataset_wrapper_factory = None) Bases: :py:obj:`ksuit.factory.base.Factory` Base factory. Implements base structures for creating a single object, a list of objects and a dict of objects. The main difference between these methods are the default return values. As python does not like using an empty list/dict as default value for an argument, arguments are by default often None. By differentiating between these three types, one avoids none checks whenever the factory is called. - create: creates an object. - create_list: creates a list of objects. - create_dict: creates a dict of objects. For example, creating a list ``` class Example: def __init__(self, callbacks: list[Callback] | None = None) # automatic none check in create_list (this is how FactoryBase is implemented) self.callbacks = create_list(callbacks) # required none check after creating the list (this is how one could implement it without create_list) self.callbacks = create(callbacks) or [] ``` .. py:attribute:: dataset_wrapper_factory .. py:method:: instantiate(object_config = None, **_) Instantiates the dataset either based on `dataset_config` or from the checkpoint.