:py:mod:`mlair.data_handler.abstract_data_handler` ================================================== .. py:module:: mlair.data_handler.abstract_data_handler Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: mlair.data_handler.abstract_data_handler.AbstractDataHandler Attributes ~~~~~~~~~~ .. autoapisummary:: mlair.data_handler.abstract_data_handler.__author__ mlair.data_handler.abstract_data_handler.__date__ .. py:data:: __author__ :annotation: = Lukas Leufen .. py:data:: __date__ :annotation: = 2020-09-21 .. py:class:: AbstractDataHandler(*args, **kwargs) Bases: :py:obj:`object` .. py:attribute:: _requirements :annotation: = [] .. py:attribute:: _store_attributes :annotation: = [] .. py:attribute:: _skip_args :annotation: = ['self'] .. py:method:: build(cls, *args, **kwargs) :classmethod: Return initialised class. .. py:method:: __len__(self, upsampling=False) :abstractmethod: .. py:method:: requirements(cls, skip_args=None) :classmethod: Return requirements and own arguments without duplicates. .. py:method:: own_args(cls, *args) :classmethod: Return all arguments (including kwonlyargs). .. py:method:: super_args(cls) :classmethod: .. py:method:: store_attributes(cls) -> list :classmethod: Let MLAir know that some data should be stored in the data store. This is used for calculations on the train subset that should be applied to validation and test subset. To work properly, add a class variable cls._store_attributes to your data handler. If your custom data handler is constructed on different data handlers (e.g. like the DefaultDataHandler), it is required to overwrite the get_store_attributs method in addition to return attributes from the corresponding subclasses. This is not required, if only attributes from the main class are to be returned. Note, that MLAir will store these attributes with the data handler's identification. This depends on the custom data handler setting. When loading an attribute from the data handler, it is therefore required to extract the right information by using the class identification. In case of the DefaultDataHandler this can be achieved to convert all keys of the attribute to string and compare these with the station parameter. .. py:method:: get_store_attributes(self) Returns all attribute names and values that are indicated by the store_attributes method. .. py:method:: transformation(cls, *args, **kwargs) :classmethod: .. py:method:: apply_transformation(self, data, inverse=False, **kwargs) :abstractmethod: This method must return transformed data. The flag inverse can be used to trigger either transformation or its inverse method. .. py:method:: get_X(self, upsampling=False, as_numpy=False) :abstractmethod: .. py:method:: get_Y(self, upsampling=False, as_numpy=False) :abstractmethod: .. py:method:: get_data(self, upsampling=False, as_numpy=False) .. py:method:: get_coordinates(self) -> Union[None, Dict] Return coordinates as dictionary with keys `lon` and `lat`. .. py:method:: _hash_list(self)