Skip to content

Commit

Permalink
rebase refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed Jun 10, 2024
1 parent c374788 commit 981e9ff
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions clinicadl/quality_check/pet_linear/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
)
def cli(
caps_directory,
output_tsv,
resluts_tsv,
tracer,
suvr_reference_region,
use_uncropped_image,
Expand All @@ -48,7 +48,7 @@ def cli(

pet_linear_qc(
caps_directory,
output_tsv,
resluts_tsv,
tracer,
suvr_reference_region,
use_uncropped_image=use_uncropped_image,
Expand Down
4 changes: 2 additions & 2 deletions clinicadl/quality_check/t1_linear/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
)
def cli(
caps_directory,
output_tsv,
results_tsv,
participants_tsv,
threshold,
batch_size,
Expand All @@ -63,7 +63,7 @@ def cli(

linear_qc(
caps_directory,
output_tsv,
results_tsv,
tsv_path=participants_tsv,
threshold=threshold,
batch_size=batch_size,
Expand Down
20 changes: 12 additions & 8 deletions tests/unittests/train/trainer/test_training_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
import pytest
from pydantic import ValidationError

import clinicadl.config.config as config
from clinicadl.caps_dataset.data_config import DataConfig
from clinicadl.caps_dataset.dataloader_config import DataLoaderConfig
from clinicadl.config.config.cross_validation import CrossValidationConfig
from clinicadl.config.config.ssda import SSDAConfig
from clinicadl.config.config.transfer_learning import TransferLearningConfig
from clinicadl.network.config import NetworkConfig
from clinicadl.transforms.config import TransformsConfig


# Tests for customed validators #
Expand All @@ -16,7 +20,7 @@ def caps_example():


def test_cross_validation_config():
c = config.CrossValidationConfig(
c = CrossValidationConfig(
split=[0],
tsv_directory="",
)
Expand Down Expand Up @@ -57,7 +61,7 @@ def test_data_config(caps_example):

def test_model_config():
with pytest.raises(ValidationError):
config.NetworkConfig(
NetworkConfig(
**{
"architecture": "",
"loss": "",
Expand All @@ -70,7 +74,7 @@ def test_ssda_config(caps_example):
preprocessing_json_target = (
caps_example / "tensor_extraction" / "preprocessing.json"
)
c = config.SSDAConfig(
c = SSDAConfig(
ssda_network=True,
preprocessing_json_target=preprocessing_json_target,
)
Expand All @@ -87,19 +91,19 @@ def test_ssda_config(caps_example):
},
}
assert c.preprocessing_dict_target == expected_preprocessing_dict
c = config.SSDAConfig()
c = SSDAConfig()
assert c.preprocessing_dict_target == {}


def test_transferlearning_config():
c = config.TransferLearningConfig(transfer_path=False)
c = TransferLearningConfig(transfer_path=False)
assert c.transfer_path is None


def test_transforms_config():
c = config.TransformsConfig(data_augmentation=False)
c = TransformsConfig(data_augmentation=False)
assert c.data_augmentation == ()
c = config.TransformsConfig(data_augmentation=["Noise"])
c = TransformsConfig(data_augmentation=["Noise"])
assert c.data_augmentation == ("Noise",)


Expand Down

0 comments on commit 981e9ff

Please sign in to comment.