Skip to content

Commit

Permalink
change is None to not (#444)
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau authored Jun 9, 2023
1 parent 46e00de commit 195acbd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions clinicadl/utils/maps_manager/maps_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def predict(
label: Target label used for training (if network_task in [`regression`, `classification`]).
label_code: dictionary linking the target values to a node number.
"""
if split_list is None:
if not split_list:
split_list = self._find_splits()
logger.debug(f"List of splits {split_list}")

Expand Down Expand Up @@ -256,7 +256,7 @@ def predict(
self.task_manager.generate_label_code(group_df, label)

# Erase previous TSV files
if selection_metrics is None:
if not selection_metrics:
split_selection_metrics = self._find_selection_metrics(split)
else:
split_selection_metrics = selection_metrics
Expand Down Expand Up @@ -473,7 +473,7 @@ def interpret(
f"Please choose in {method_dict.keys()}"
)

if split_list is None:
if not split_list:
split_list = self._find_splits()
logger.debug(f"List of splits {split_list}")

Expand Down Expand Up @@ -521,7 +521,7 @@ def interpret(
num_workers=n_proc if n_proc is not None else self.n_proc,
)

if selection_metrics is None:
if not selection_metrics:
selection_metrics = self._find_selection_metrics(split)

for selection_metric in selection_metrics:
Expand Down Expand Up @@ -1258,7 +1258,7 @@ def _ensemble_prediction(
):
"""Computes the results on the image-level."""

if selection_metrics is None:
if not selection_metrics:
selection_metrics = self._find_selection_metrics(split)

for selection_metric in selection_metrics:
Expand Down Expand Up @@ -1403,7 +1403,7 @@ def _find_selection_metrics(self, split):
def _check_selection_metric(self, split, selection_metric=None):
"""Check that a given selection metric is available for a given split."""
available_metrics = self._find_selection_metrics(split)
if selection_metric is None:
if not selection_metric:
if len(available_metrics) > 1:
raise ClinicaDLArgumentError(
f"Several metrics are available for split {split}. "
Expand Down

0 comments on commit 195acbd

Please sign in to comment.