*************** Base Components *************** .. note:: In object-oriented programming, the open–closed principle states software entities *(classes, modules, functions, etc.)* should be open for extension, but closed for modification. Such an entity can allow its behaviour to be extended without modifying its source code. The base components are dedicated to performing one specific task and don't know anything about the context. They save the metadata and implements only one method. This approach ensures that they are flexible and can easily adapt. All components inherit from the abstract base class **BaseComponent** since they share the same properties (**DRY**). Moreover, the inherited components are abstract as well (**Open-Closed**) and can be customized. .. figure:: ../figures/design/base_components.svg :width: 100% BaseComponent ============= .. note:: Don't repeat yourself (DRY, or sometimes do not repeat yourself) is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy. .. autoclass:: autom8qc.core.components.BaseComponent :show-inheritance: :noindex: .. autofunction:: autom8qc.core.components.BaseComponent.check_metadata :noindex: QAQCTest ======== .. figure:: ../figures/design/design_test.svg :width: 100% .. autoclass:: autom8qc.qaqc.base.QAQCTest :show-inheritance: :noindex: .. autofunction:: autom8qc.qaqc.base.QAQCTest.perform :noindex: **Example:** :class:`autom8qc.qaqc.flatline.FlatLineTest` BaseMapper ========== .. autoclass:: autom8qc.mappers.base.BaseMapper :show-inheritance: :noindex: .. autofunction:: autom8qc.mappers.base.BaseMapper.map :noindex: **Example:** :class:`autom8qc.mappers.validities.StandardValidityMapper` BaseFunction ============ .. autoclass:: autom8qc.functions.base.BaseFunction :show-inheritance: :noindex: .. autofunction:: autom8qc.functions.base.BaseFunction.apply :noindex: **Example:** :class:`autom8qc.functions.interpolation.FillValidityGapsFunction` BaseRule ======== .. autoclass:: autom8qc.rules.base.BaseRule :show-inheritance: :noindex: .. autofunction:: autom8qc.rules.base.BaseRule.apply :noindex: **Example:** :class:`autom8qc.rules.frequency.LowerFrequencyRule` BaseMeasure =========== .. autoclass:: autom8qc.measures.base.BaseMeasure :show-inheritance: :noindex: .. autofunction:: autom8qc.measures.base.BaseMeasure.apply :noindex: **Example:** :class:`autom8qc.measures.probabilities.MeanMeasure`