diff --git a/cml/shared/request.py b/cml/shared/request.py index 52c3f577f1d24e989bac886767c65b300cf95fa2..18189d60a052abc236acd99df1256d2187effbb4 100644 --- a/cml/shared/request.py +++ b/cml/shared/request.py @@ -1,47 +1,31 @@ from dataclasses import dataclass -from typing import Callable, Iterable +from typing import Iterable from cml.ports.source_adapters import Adapter from cml.ports.ml_adapter import MachineLearningModel from cml.domain.reconstruction import Reconstructor -from cml.domain.data_source import DataSource from cml.domain.construction import Constructor from cml.domain.complexity_reduction import FeatureSelector from cml.domain.deconstruction import Deconstructor +from cml.domain.knowledge import KnowledgeDatabase from cml.shared.settings import ( + GeneralSettings, PreprocessingSettings, BlockProcessingSettings, DeconstructionSettings, ConstructionSettings, FeatureSelectionSettings, - ReconstructionSettings -) + ReconstructionSettings) @dataclass class PreprocessRequest: - source_adapter: Adapter - pre_settings: PreprocessingSettings - block_settings: BlockProcessingSettings - density_estimator: MachineLearningModel - relative_extrema: Callable - - -@dataclass -class KnowledgeSearchRequest: - constructor: Constructor - feature_selector: FeatureSelector - reconstructor: Reconstructor - deconstructor: Deconstructor - data_source: DataSource - stdout: bool - - -@dataclass -class DeconstructionRequest: - source_adapter: Adapter - settings: DeconstructionSettings - knowledge_type: str + source_adapter: object + general_settings: GeneralSettings + preprocessing_settings: PreprocessingSettings + block_processing_settings: BlockProcessingSettings + density_estimator_interface: object + relative_extrema_interface: object @dataclass @@ -65,3 +49,21 @@ class ReconstructionRequest: algorithms: Iterable interface: type mode: str + + +@dataclass +class DeconstructionRequest: + mode: str + source_adapter: Adapter + settings: DeconstructionSettings + knowledge_database: KnowledgeDatabase = None + + +@dataclass +class KnowledgeSearchRequest: + constructor: Constructor + feature_selector: FeatureSelector + reconstructor: Reconstructor + deconstructor: Deconstructor + stdout: bool + parallel: bool