Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run unittets and cleaning #620

Merged
merged 63 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
a9a23b9
Bump sqlparse from 0.4.4 to 0.5.0 (#558)
dependabot[bot] Apr 22, 2024
36eb46f
Bump tqdm from 4.66.1 to 4.66.3 (#569)
dependabot[bot] May 4, 2024
fa7f0f1
Bump werkzeug from 3.0.1 to 3.0.3 (#570)
dependabot[bot] May 7, 2024
a05fcd5
Bump jinja2 from 3.1.3 to 3.1.4 (#571)
dependabot[bot] May 7, 2024
b2fc3e6
Bump mlflow from 2.10.1 to 2.12.1 (#575)
dependabot[bot] May 17, 2024
495d5b9
Bump gunicorn from 21.2.0 to 22.0.0 (#576)
dependabot[bot] May 17, 2024
bdd102a
Bump requests from 2.31.0 to 2.32.0 (#578)
dependabot[bot] May 21, 2024
beccd4c
[CI] Run tests through GitHub Actions (#573)
NicolasGensollen May 22, 2024
2861e9d
[CI] Skip tests when PR is in draft mode (#592)
NicolasGensollen May 23, 2024
f5de251
[CI] Test train workflow on GPU machine (#590)
NicolasGensollen May 23, 2024
69b3538
[CI] Port remaining GPU tests to GitHub Actions (#593)
NicolasGensollen May 23, 2024
c9d9252
[CI] Remove GPU pipeline from Jenkinsfile (#594)
NicolasGensollen May 24, 2024
753f04e
[CI] Port remaining non GPU tests to GitHub Actions (#581)
NicolasGensollen May 24, 2024
c424d77
[CI] Remove jenkins related things (#595)
NicolasGensollen May 24, 2024
4281c73
add simulate-gpu option
thibaultdvx May 28, 2024
52d7561
Add flags to run CI tests locally (#596)
thibaultdvx May 30, 2024
39d22fd
[CI] Remove duplicated verbose flag in test pipelines (#598)
NicolasGensollen May 30, 2024
571662c
[DOC] Update the Python version used for creating the conda environme…
NicolasGensollen May 30, 2024
567467e
Merge remote-tracking branch 'upstream/dev' into dev
thibaultdvx May 30, 2024
d54d59c
Flag for local tests (#608)
thibaultdvx May 31, 2024
f641f30
add whole resume pipeline in trainer
thibaultdvx May 31, 2024
78f2928
Merge remote-tracking branch 'upstream/dev' into dev
thibaultdvx May 31, 2024
a6c336f
change from_json cli
thibaultdvx Jun 4, 2024
f20e7fb
Update quality_check.py (#609)
HuguesRoy Jun 4, 2024
f6f382a
Fix issue in compare_folders (#610)
thibaultdvx Jun 4, 2024
cd3a538
Merge remote-tracking branch 'upstream/dev' into dev
thibaultdvx Jun 4, 2024
f7eb225
Merge branch 'dev' into refactoring
thibaultdvx Jun 4, 2024
523563d
revert change on poetry
thibaultdvx Jun 4, 2024
4971fa7
correction of wrong conflict choice in rebasing
thibaultdvx Jun 4, 2024
c60d53c
Merge remote-tracking branch 'upstream/refactoring' into refactoring
thibaultdvx Jun 4, 2024
c1b6e5b
Merge branch 'refactoring' into put_resume_in_trainer
thibaultdvx Jun 4, 2024
fdae3dd
restore split_manager
thibaultdvx Jun 4, 2024
9a57198
trigger tests
thibaultdvx Jun 4, 2024
52f9492
[INFRA] Update the Makefile `check.lock` target (#603)
NicolasGensollen Jun 4, 2024
375e67e
delete automatic resume function
thibaultdvx Jun 5, 2024
919f930
change find_splits to _find_splits
thibaultdvx Jun 5, 2024
b0d3490
Merge remote-tracking branch 'upstream/dev' into dev
thibaultdvx Jun 5, 2024
02c4e30
Merge branch 'refactoring' of https://github.com/aramis-lab/clinicadl…
thibaultdvx Jun 6, 2024
34625fc
Merge branch 'refactoring' into put_resume_in_trainer
thibaultdvx Jun 6, 2024
a05d647
clean tasks cli
thibaultdvx Jun 7, 2024
c4f4e94
make normalization uniform
thibaultdvx Jun 7, 2024
2cd0979
add update_with_toml
thibaultdvx Jun 7, 2024
2f07d62
update unittests
thibaultdvx Jun 7, 2024
95dc7f4
Merge remote-tracking branch 'upstream/refactoring' into refactoring
thibaultdvx Jun 7, 2024
b463a0c
Merge branch 'refactoring' into clean_tasks_cli
thibaultdvx Jun 7, 2024
c1cf03d
remove unecessary imports
thibaultdvx Jun 7, 2024
996cdd5
[CI] Run unit tests and linter on refactoring branch (#618)
NicolasGensollen Jun 7, 2024
6166462
Merge remote-tracking branch 'upstream/dev' into dev
thibaultdvx Jun 7, 2024
e4ce5dc
Merge branch 'dev' into refactoring
thibaultdvx Jun 7, 2024
3b7763e
Merge remote-tracking branch 'upstream/refactoring' into refactoring
thibaultdvx Jun 7, 2024
752bc2b
remove outdated tests
thibaultdvx Jun 7, 2024
2c5b566
Merge branch 'refactoring' into clean_tasks_cli
thibaultdvx Jun 7, 2024
15516b1
Merge remote-tracking branch 'upstream/refactoring' into refactoring
thibaultdvx Jun 12, 2024
37610c4
Merge branch 'refactoring' into cleaning
thibaultdvx Jun 12, 2024
9be8e1a
trigger tests
thibaultdvx Jun 12, 2024
fd2a9ed
correct outdated import
thibaultdvx Jun 12, 2024
dd73874
linter corrections
thibaultdvx Jun 12, 2024
d32c5c6
correction of python 3.8 error
thibaultdvx Jun 12, 2024
404b537
correction of python 3.8 error
thibaultdvx Jun 12, 2024
679452a
add ready_for_review as event that triggers tests
thibaultdvx Jun 12, 2024
42ddcdd
add ready_for_review events to all tests
thibaultdvx Jun 12, 2024
a36e285
trigger tests
thibaultdvx Jun 12, 2024
e93f06d
add synchronize in events for tests
thibaultdvx Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/lint.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can add mood24 branch, WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I will make the change directly on mood24!

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: 'Lint codebase'

on:
pull_request:
branches: [ dev ]
branches: [ "dev", "refactoring" ]
push:
branches: [ dev ]
branches: [ "dev", "refactoring" ]

permissions:
contents: read
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Test

on:
push:
branches: [dev]
branches: ["dev", "refactoring"]
pull_request:
branches: [dev]
branches: ["dev", "refactoring"]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_interpret.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_predict.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_prepare_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_quality_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_random_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_resume.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_train.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_transfer_learning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test_tsvtools.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: ["dev", "refactoring"]
pull_request:
branches: ["dev", "refactoring"]
types: [opened, synchronize, reopened, ready_for_review]

permissions:
contents: read
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ help: Makefile

.PHONY: check.lock
check.lock:
@$(POETRY) lock --check
@$(POETRY) check --lock

## build : Build the package.
.PHONY: build
Expand Down
9 changes: 2 additions & 7 deletions clinicadl/callbacks/config.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
from abc import ABC, abstractmethod
from enum import Enum
from logging import getLogger
from pathlib import Path
from typing import Any, Dict, Optional, Tuple
from typing import Optional

from pydantic import BaseModel, ConfigDict, computed_field, field_validator
from pydantic.types import NonNegativeFloat, NonNegativeInt, PositiveFloat, PositiveInt
from pydantic import BaseModel, ConfigDict

from clinicadl.preprocessing.preprocessing import read_preprocessing
from clinicadl.utils.enum import ExperimentTracking

logger = getLogger("clinicadl.callbacks_config")
Expand Down
2 changes: 1 addition & 1 deletion clinicadl/caps_dataset/data_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DataConfig(BaseModel): # TODO : put in data module
diagnoses: Tuple[str, ...] = ("AD", "CN")
data_df: Optional[pd.DataFrame] = None
label: Optional[str] = None
label_code: Union[str, dict[str, int], None] = {}
label_code: Union[str, Dict[str, int], None] = {}
multi_cohort: bool = False
mask_path: Optional[Path] = None
preprocessing_json: Optional[Path] = None
Expand Down
1 change: 0 additions & 1 deletion clinicadl/caps_dataset/data_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# coding: utf8
# TODO: create a folder for generate/ prepare_data/ data to deal with capsDataset objects ?
import abc
from logging import getLogger
from pathlib import Path
from typing import Any, Callable, Dict, Optional
Expand Down
1 change: 0 additions & 1 deletion clinicadl/commandline/modules_options/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
# from .task import classification, reconstruction, regression
1 change: 0 additions & 1 deletion clinicadl/commandline/modules_options/caps_dataset.py

This file was deleted.

1 change: 0 additions & 1 deletion clinicadl/commandline/modules_options/computational.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from clinicadl.config.config.computational import ComputationalConfig
from clinicadl.config.config_utils import get_default_from_config_class as get_default
from clinicadl.config.config_utils import get_type_from_config_class as get_type

# Computational
amp = click.option(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import get_args

import click

from clinicadl.config.config_utils import get_default_from_config_class as get_default
Expand Down
1 change: 0 additions & 1 deletion clinicadl/commandline/pipelines/generate/trivial/cli.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import tarfile
from logging import getLogger
from pathlib import Path

Expand Down
1 change: 0 additions & 1 deletion clinicadl/commandline/pipelines/predict/options.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import click

from clinicadl.config.config_utils import get_default_from_config_class as get_default
from clinicadl.config.config_utils import get_type_from_config_class as get_type
from clinicadl.predict.config import PredictConfig

# predict specific
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from pathlib import Path
from typing import Optional

import click

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import click

from clinicadl.caps_dataset.caps_dataset_config import CapsDatasetConfig
from clinicadl.commandline import arguments
from clinicadl.commandline.modules_options import (
Expand All @@ -10,9 +10,6 @@
)
from clinicadl.prepare_data.prepare_data import DeepLearningPrepareData
from clinicadl.utils.enum import ExtractionMethod
from clinicadl.commandline import arguments
from clinicadl.commandline.modules_options import data, dataloader, modality, preprocessing
from clinicadl.utils.enum import ExtractionMethod


@click.command(name="image", no_args_is_help=True)
Expand All @@ -27,7 +24,6 @@
@modality.custom_suffix
@data.participants_tsv
def image_bids_cli(kwargs):

image_config = CapsDatasetConfig.from_preprocessing_and_extraction_method(
extraction=ExtractionMethod.IMAGE,
preprocessing_type=kwargs["preprocessing"],
Expand Down
2 changes: 0 additions & 2 deletions clinicadl/config/config/maps_manager.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
from enum import Enum
from logging import getLogger
from pathlib import Path
from typing import Optional

from pydantic import BaseModel, ConfigDict

from clinicadl.utils.exceptions import ClinicaDLArgumentError # type: ignore
from clinicadl.utils.maps_manager.maps_manager import MapsManager # type: ignore

logger = getLogger("clinicadl.predict_config")

Expand Down
2 changes: 1 addition & 1 deletion clinicadl/config/config_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import typing
from enum import Enum
from typing import Any, get_args, get_origin
from typing import Any, get_args

import click
from pydantic import BaseModel
Expand Down
29 changes: 12 additions & 17 deletions clinicadl/generate/generate_config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import tarfile
from logging import getLogger
from pathlib import Path
from time import time
Expand All @@ -14,22 +13,8 @@
field_validator,
)

from clinicadl.utils.clinica_utils import (
RemoteFileStructure,
clinicadl_file_reader,
fetch_file,
)
from clinicadl.utils.enum import (
Pathology,
Preprocessing,
SUVRReferenceRegions,
Tracer,
)
from clinicadl.utils.exceptions import (
ClinicaDLArgumentError,
ClinicaDLTSVError,
DownloadError,
)
from clinicadl.utils.enum import Pathology
from clinicadl.utils.exceptions import ClinicaDLArgumentError

logger = getLogger("clinicadl.predict_config")

Expand All @@ -52,6 +37,8 @@ class GenerateArtifactsConfig(BaseModel):
noise_std: Tuple[NonNegativeFloat, NonNegativeFloat] = (5.0, 15.0)
rotation: Tuple[NonNegativeFloat, NonNegativeFloat] = (2.0, 4.0) # float o int ???
translation: Tuple[NonNegativeFloat, NonNegativeFloat] = (2.0, 4.0)
# pydantic config
model_config = ConfigDict(validate_assignment=True)

@field_validator("gamma", "noise_std", "rotation", "translation", mode="before")
def list_to_tuples(cls, v):
Expand Down Expand Up @@ -85,16 +72,22 @@ class GenerateHypometabolicConfig(BaseModel):
anomaly_degree: NonNegativeFloat = 30.0
pathology: Pathology = Pathology.AD
sigma: NonNegativeFloat = 5
# pydantic config
model_config = ConfigDict(validate_assignment=True)


class GenerateRandomConfig(BaseModel):
mean: NonNegativeFloat = 0.0
sigma: NonNegativeFloat = 0.5
# pydantic config
model_config = ConfigDict(validate_assignment=True)


class GenerateTrivialConfig(BaseModel):
atrophy_percent: PositiveFloat = 60.0
mask_path: Optional[Path] = None
# pydantic config
model_config = ConfigDict(validate_assignment=True)


class GenerateSheppLoganConfig(BaseModel):
Expand All @@ -107,6 +100,8 @@ class GenerateSheppLoganConfig(BaseModel):
extract_json: Optional[str] = None
image_size: PositiveInt = 128
smoothing: bool = False
# pydantic config
model_config = ConfigDict(validate_assignment=True)

@field_validator("extract_json", mode="before")
def compute_extract_json(cls, v: str):
Expand Down
6 changes: 1 addition & 5 deletions clinicadl/generate/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
import random
from copy import copy
from pathlib import Path
from typing import Dict, Optional, Union
from typing import Dict, Optional

import numpy as np
import pandas as pd
from pydantic import BaseModel
from scipy.ndimage import gaussian_filter
from skimage.draw import ellipse

Expand All @@ -22,15 +21,12 @@
from clinicadl.utils.enum import (
LinearModality,
Preprocessing,
SUVRReferenceRegions,
Tracer,
)

# from clinicadl.caps_dataset.caps_dataset_config import CapsDatasetConfig
from clinicadl.utils.exceptions import (
ClinicaDLArgumentError,
ClinicaDLTSVError,
DownloadError,
)


Expand Down
3 changes: 0 additions & 3 deletions clinicadl/hugging_face/pull_cli.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from pathlib import Path

import click

from clinicadl.utils import cli_param
from clinicadl.utils.maps_manager import MapsManager


@click.command(name="pull", no_args_is_help=True)
Expand Down
6 changes: 1 addition & 5 deletions clinicadl/interpret/config.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
from enum import Enum
from logging import getLogger
from pathlib import Path
from typing import Dict, Optional, Union
from typing import Optional

from pydantic import BaseModel, field_validator

from clinicadl.caps_dataset.data_config import DataConfig as DataBaseConfig
from clinicadl.caps_dataset.data_utils import (
load_data_test,
)
from clinicadl.caps_dataset.dataloader_config import DataLoaderConfig
from clinicadl.config.config.computational import ComputationalConfig
from clinicadl.config.config.cross_validation import CrossValidationConfig
Expand Down
1 change: 0 additions & 1 deletion clinicadl/mlflow_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import logging
import os
import sys
import warnings
from urllib.parse import urlparse
Expand Down
2 changes: 1 addition & 1 deletion clinicadl/network/autoencoder/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from torch import nn

from clinicadl.network.autoencoder.cnn_transformer import CNN_Transformer
from clinicadl.network.cnn.models import Conv4_FC3, Conv5_FC3, resnet18
from clinicadl.network.cnn.models import Conv4_FC3, Conv5_FC3
from clinicadl.network.sub_network import AutoEncoder
from clinicadl.network.vae.vae_layers import (
DecoderLayer3D,
Expand Down
1 change: 0 additions & 1 deletion clinicadl/network/cnn/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from clinicadl.network.network_utils import *
from clinicadl.network.sub_network import CNN
from clinicadl.utils.enum import Normalization
from clinicadl.utils.exceptions import ClinicaDLNetworksError


Expand Down
2 changes: 0 additions & 2 deletions clinicadl/predict/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
from logging import getLogger

from pydantic import BaseModel

from clinicadl.caps_dataset.data_config import DataConfig as DataBaseConfig
from clinicadl.caps_dataset.dataloader_config import DataLoaderConfig
from clinicadl.config.config.maps_manager import (
Expand Down
Loading
Loading