Skip to content

Commit

Permalink
rename DataManager -> FileSystemManager
Browse files Browse the repository at this point in the history
  • Loading branch information
MorrisNein committed Jun 1, 2023
1 parent b89fd9a commit 404a5a5
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions experiments/fedot_warm_start/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from sklearn.model_selection import StratifiedKFold
from tqdm import tqdm

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import OpenMLDataset, DatasetData
from meta_automl.data_preparation.datasets_loaders import OpenMLDatasetsLoader
from meta_automl.data_preparation.datasets_train_test_split import openml_datasets_train_test_split
Expand Down Expand Up @@ -61,7 +61,7 @@
time_now = datetime.now()
time_now_iso = time_now.isoformat(timespec="minutes")
time_now_for_path = time_now_iso.replace(":", ".")
save_dir = DataManager.get_data_dir(). \
save_dir = FileSystemManager.get_data_dir(). \
joinpath('experiments').joinpath('fedot_warm_start').joinpath(f'run_{time_now_for_path}')
save_dir.mkdir(parents=True)
log_file = save_dir.joinpath('log.txt')
Expand Down
4 changes: 2 additions & 2 deletions meta_automl/data_preparation/dataset/file_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import pickle
from pathlib import Path

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import DatasetBase
from meta_automl.data_preparation.dataset.dataset_base import DatasetData

Expand All @@ -17,7 +17,7 @@ class FileDataset(DatasetBase):

@property
def cache_path(self) -> Path:
return DataManager.get_dataset_cache_path(self.id_, self.source_name)
return FileSystemManager.get_dataset_cache_path(self.id_, self.source_name)

def get_data(self) -> DatasetData:
if not self.cache_path.exists():
Expand Down
4 changes: 2 additions & 2 deletions meta_automl/data_preparation/dataset/openml_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

import openml

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import DatasetBase
from meta_automl.data_preparation.dataset.dataset_base import DatasetData

OpenMLDatasetIDType = int
openml_cache_path = str(DataManager.get_data_dir().joinpath('openml_cache'))
openml_cache_path = str(FileSystemManager.get_data_dir().joinpath('openml_cache'))
openml.config.set_cache_directory(openml_cache_path)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from abc import abstractmethod
from typing import List, Type

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import DatasetBase


class DatasetsLoader:
data_manager: Type[DataManager] = DataManager
data_manager: Type[FileSystemManager] = FileSystemManager

@abstractmethod
def load(self, *args, **kwargs) -> List[DatasetBase]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
PathType = Union[PathLike, str]


class DataManager:
class FileSystemManager:
default_cache_extension = '.pkl'

@classmethod
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

import pandas as pd

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import DatasetIDType


class MetaFeaturesExtractor:
default_params: Optional[Dict[str, Any]] = None
source_name: Optional[str] = None
data_manager: Type[DataManager] = DataManager
data_manager: Type[FileSystemManager] = FileSystemManager

@abstractmethod
def extract(self, datasets) -> pd.DataFrame:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from golem.core.log import default_log
from tqdm import tqdm

from meta_automl.data_preparation.data_manager import PathType
from meta_automl.data_preparation.file_system_manager import PathType
from meta_automl.data_preparation.dataset import DatasetCache
from meta_automl.data_preparation.datasets_loaders import DatasetsLoader, OpenMLDatasetsLoader
from meta_automl.data_preparation.model import Model
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
from fedot.core.pipelines.pipeline import Pipeline
from golem.core.optimisers.fitness import SingleObjFitness

from meta_automl.data_preparation.data_manager import DataManager
from meta_automl.data_preparation.file_system_manager import FileSystemManager
from meta_automl.data_preparation.dataset import DatasetCache
from meta_automl.data_preparation.model import Model
from meta_automl.data_preparation.models_loaders import ModelsLoader

DEFAULT_KNOWLEDGE_BASE_PATH = DataManager.get_data_dir().joinpath('knowledge_base_0')
DEFAULT_KNOWLEDGE_BASE_PATH = FileSystemManager.get_data_dir().joinpath('knowledge_base_0')


class KnowledgeBaseModelsLoader(ModelsLoader):
Expand Down

0 comments on commit 404a5a5

Please sign in to comment.