Skip to content

Commit

Permalink
update import for trainer and generate
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed May 30, 2024
1 parent b22a68e commit 69a9d94
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 21 deletions.
9 changes: 4 additions & 5 deletions clinicadl/commandline/pipelines/generate/artifacts/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@

from clinicadl.generate import generate_param
from clinicadl.generate.generate_config import GenerateArtifactsConfig
from clinicadl.utils.caps_dataset.data import CapsDataset
from clinicadl.utils.clinica_utils import clinicadl_file_reader
from clinicadl.utils.maps_manager.iotools import commandline_to_json

from .....generate.generate_utils import (
from clinicadl.generate.generate_utils import (
find_file_type,
load_and_check_tsv,
write_missing_mods,
)
from clinicadl.utils.caps_dataset.data import CapsDataset
from clinicadl.utils.clinica_utils import clinicadl_file_reader
from clinicadl.utils.maps_manager.iotools import commandline_to_json

logger = getLogger("clinicadl.generate.artifacts")

Expand Down
13 changes: 6 additions & 7 deletions clinicadl/commandline/pipelines/generate/hypometabolic/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@

from clinicadl.generate import generate_param
from clinicadl.generate.generate_config import GenerateHypometabolicConfig
from clinicadl.generate.generate_utils import (
find_file_type,
load_and_check_tsv,
mask_processing,
write_missing_mods,
)
from clinicadl.tsvtools.tsvtools_utils import extract_baseline
from clinicadl.utils.caps_dataset.data import CapsDataset
from clinicadl.utils.clinica_utils import (
Expand All @@ -24,13 +30,6 @@
from clinicadl.utils.exceptions import DownloadError
from clinicadl.utils.maps_manager.iotools import commandline_to_json

from .....generate.generate_utils import (
find_file_type,
load_and_check_tsv,
mask_processing,
write_missing_mods,
)

logger = getLogger("clinicadl.generate.hypometabolic")


Expand Down
7 changes: 3 additions & 4 deletions clinicadl/commandline/pipelines/generate/shepplogan/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@

from clinicadl.generate import generate_param
from clinicadl.generate.generate_config import GenerateSheppLoganConfig
from clinicadl.preprocessing.preprocessing import write_preprocessing
from clinicadl.utils.maps_manager.iotools import check_and_clean, commandline_to_json

from .....generate.generate_utils import (
from clinicadl.generate.generate_utils import (
generate_shepplogan_phantom,
write_missing_mods,
)
from clinicadl.preprocessing.preprocessing import write_preprocessing
from clinicadl.utils.maps_manager.iotools import check_and_clean, commandline_to_json

logger = getLogger("clinicadl.generate.shepplogan")

Expand Down
2 changes: 1 addition & 1 deletion clinicadl/commandline/pipelines/train/from_json/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def cli(**kwargs):
OUTPUT_MAPS_DIRECTORY is the path to the MAPS folder where outputs and results will be saved.
"""
from clinicadl.train.trainer import Trainer
from clinicadl.trainer.trainer import Trainer
from clinicadl.utils.maps_manager.maps_manager_utils import read_json

logger = getLogger("clinicadl")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
transforms,
validation,
)
from clinicadl.train.trainer import Trainer
from clinicadl.train.utils import merge_cli_and_config_file_options
from clinicadl.trainer.trainer import Trainer
from clinicadl.utils.enum import Task


Expand Down
2 changes: 1 addition & 1 deletion clinicadl/commandline/pipelines/train/resume/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ def cli(input_maps_directory, split):
INPUT_MAPS_DIRECTORY is the path to the MAPS folder where training job has started.
"""
from ....train.resume.resume import automatic_resume
from clinicadl.train.resume.resume import automatic_resume

automatic_resume(input_maps_directory, user_split_list=split)
2 changes: 1 addition & 1 deletion clinicadl/random_search/random_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from pathlib import Path

from clinicadl.train.trainer import Trainer
from clinicadl.trainer.trainer import Trainer

from .random_search_config import RandomSearchConfig, create_training_config
from .random_search_utils import get_space_dict, random_sampling
Expand Down
2 changes: 1 addition & 1 deletion clinicadl/random_search/random_search_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from clinicadl.utils.enum import Normalization, Pooling, Task

if TYPE_CHECKING:
from clinicadl.train.trainer import TrainConfig
from clinicadl.trainer.trainer import TrainConfig


class RandomSearchConfig(
Expand Down

0 comments on commit 69a9d94

Please sign in to comment.