Skip to content

Commit 968878a

Browse files
authored
auto updates (#5927)
Signed-off-by: monai-bot <[email protected]> Signed-off-by: monai-bot <[email protected]>
1 parent 1a018a7 commit 968878a

File tree

121 files changed

+15
-216
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+15
-216
lines changed

.github/workflows/pythonapp.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
# - os-latest-pip- (shared)
2323
flake8-py3:
2424
runs-on: ubuntu-latest
25+
strategy:
26+
matrix:
27+
opt: ["codeformat", "pytype", "mypy"]
2528
steps:
2629
- uses: actions/checkout@v3
2730
- name: Set up Python 3.8
@@ -46,8 +49,8 @@ jobs:
4649
run: |
4750
# clean up temporary files
4851
$(pwd)/runtests.sh --build --clean
49-
# Git hub actions have 2 cores, so parallize pytype
50-
$(pwd)/runtests.sh --build --codeformat -j 2
52+
# Github actions have 2 cores, so parallelize pytype
53+
$(pwd)/runtests.sh --build --${{ matrix.opt }} -j 2
5154
5255
quick-py3: # full dependencies installed tests for different OS
5356
runs-on: ${{ matrix.os }}

docs/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sphinx-autodoc-typehints==1.11.1
2121
pandas
2222
einops
2323
transformers<4.22 # https://github.com/Project-MONAI/MONAI/issues/5157
24-
mlflow
24+
mlflow>=1.28.0
2525
tensorboardX
2626
imagecodecs; platform_system == "Linux" or platform_system == "Darwin"
2727
tifffile; platform_system == "Linux" or platform_system == "Darwin"

monai/apps/auto3dseg/auto_runner.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,6 @@ def __init__(
223223
templates_path_or_url: str | None = None,
224224
**kwargs,
225225
):
226-
227226
logger.info(f"AutoRunner using work directory {work_dir}")
228227
os.makedirs(work_dir, exist_ok=True)
229228

@@ -641,7 +640,6 @@ def run(self):
641640

642641
# step 2: algorithm generation
643642
if self.algo_gen:
644-
645643
if not os.path.isfile(self.datastats_filename):
646644
raise ValueError(
647645
f"Could not find the datastats file {self.datastats_filename}. "

monai/apps/auto3dseg/bundle_gen.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,7 @@ def __init__(
377377
data_stats_filename: str | None = None,
378378
data_src_cfg_name: str | None = None,
379379
):
380-
381380
if algos is None or isinstance(algos, (list, tuple, str)):
382-
383381
if templates_path_or_url is None:
384382
templates_path_or_url = default_algo_zip
385383

@@ -404,7 +402,6 @@ def __init__(
404402
self.algos: Any = []
405403
if isinstance(algos, dict):
406404
for algo_name, algo_params in algos.items():
407-
408405
template_path = os.path.dirname(algo_params.get("template_path", "."))
409406
if len(template_path) > 0 and template_path not in sys.path:
410407
sys.path.append(template_path)

monai/apps/auto3dseg/data_analyzer.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ def get_all_case_stats(self, key="training", transform_list=None):
214214
Orientationd(keys=keys, axcodes="RAS"),
215215
]
216216
if self.label_key is not None:
217-
218217
allowed_shape_difference = self.extra_params.pop("allowed_shape_difference", 5)
219218
transform_list.append(
220219
EnsureSameShaped(
@@ -235,7 +234,6 @@ def get_all_case_stats(self, key="training", transform_list=None):
235234
warnings.warn("tqdm is not installed. not displaying the caching progress.")
236235

237236
for batch_data in tqdm(dataloader) if has_tqdm else dataloader:
238-
239237
batch_data = batch_data[0]
240238
batch_data[self.image_key] = batch_data[self.image_key].to(self.device)
241239

monai/apps/auto3dseg/ensemble_builder.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ class AlgoEnsembleBestN(AlgoEnsemble):
180180
"""
181181

182182
def __init__(self, n_best: int = 5):
183-
184183
super().__init__()
185184
self.n_best = n_best
186185

@@ -225,7 +224,6 @@ class AlgoEnsembleBestByFold(AlgoEnsemble):
225224
"""
226225

227226
def __init__(self, n_fold: int = 5):
228-
229227
super().__init__()
230228
self.n_fold = n_fold
231229

monai/apps/auto3dseg/hpo_gen.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ def generate(self, output_folder: str = ".") -> None:
197197
if isinstance(self.algo, BundleAlgo):
198198
self.algo.export_to_disk(output_folder, task_prefix + task_id, fill_with_datastats=False)
199199
else:
200-
201200
ConfigParser.export_config_file(self.params, write_path)
202201
logger.info(write_path)
203202

@@ -376,7 +375,6 @@ def generate(self, output_folder: str = ".") -> None:
376375
if isinstance(self.algo, BundleAlgo):
377376
self.algo.export_to_disk(output_folder, task_prefix + task_id, fill_with_datastats=False)
378377
else:
379-
380378
ConfigParser.export_config_file(self.params, write_path)
381379
logger.info(write_path)
382380

monai/apps/deepedit/interaction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(
5151
click_probability_key: str = "probability",
5252
max_interactions: int = 1,
5353
) -> None:
54-
5554
self.deepgrow_probability = deepgrow_probability
5655
self.transforms = Compose(transforms) if not isinstance(transforms, Compose) else transforms
5756
self.train = train

monai/apps/deepedit/transforms.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,6 @@ def find_guidance(self, discrepancy):
529529
return None
530530

531531
def add_guidance(self, guidance, discrepancy, label_names, labels):
532-
533532
# Positive clicks of the segment in the iteration
534533
pos_discr = discrepancy[0] # idx 0 is positive discrepancy and idx 1 is negative discrepancy
535534

monai/apps/deepgrow/interaction.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ def __init__(
4646
train: bool,
4747
key_probability: str = "probability",
4848
) -> None:
49-
5049
if not isinstance(transforms, Compose):
5150
transforms = Compose(transforms)
5251

0 commit comments

Comments
 (0)