biapy 3.7.0__tar.gz → 3.7.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {biapy-3.7.0 → biapy-3.7.2}/PKG-INFO +7 -4
- {biapy-3.7.0 → biapy-3.7.2}/biapy/__init__.py +83 -4
- {biapy-3.7.0 → biapy-3.7.2}/biapy/_biapy.py +320 -98
- biapy-3.7.2/biapy/citations/__init__.py +409 -0
- biapy-3.7.2/biapy/citations/references.yaml +1147 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/config/config.py +859 -160
- biapy-3.7.2/biapy/data/chunked_writer.py +186 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/data_3D_manipulation.py +216 -41
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/data_manipulation.py +847 -144
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/dataset.py +9 -1
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/__init__.py +279 -59
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/augmentors.py +93 -56
- biapy-3.7.2/biapy/data/generators/chunked_test_pair_data_generator.py +817 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/chunked_workflow_process_generator.py +102 -146
- biapy-3.7.2/biapy/data/generators/membrane_augmentors.py +1076 -0
- biapy-3.7.2/biapy/data/generators/membrane_repair_data_generator.py +395 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/pair_base_data_generator.py +265 -57
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/pair_data_3D_generator.py +5 -1
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/test_pair_data_generators.py +131 -11
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/test_single_data_generator.py +6 -0
- biapy-3.7.2/biapy/data/membrane_channels.py +393 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/norm.py +219 -22
- biapy-3.7.2/biapy/data/ome_zarr.py +877 -0
- biapy-3.7.2/biapy/data/patch_sampling.py +366 -0
- biapy-3.7.2/biapy/data/post_processing/affinity_agglomeration.py +470 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/post_processing.py +38 -82
- biapy-3.7.2/biapy/data/post_processing/skoots.py +73 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/pre_processing.py +578 -228
- biapy-3.7.2/biapy/data/roi_mask.py +320 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/__init__.py +13 -1
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/base_workflow.py +928 -170
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/check_configuration.py +867 -241
- biapy-3.7.2/biapy/engine/chunked_tiles.py +212 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/classification.py +87 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/denoising.py +133 -15
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/detection.py +125 -142
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/image_to_image.py +434 -49
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/instance_seg.py +440 -341
- biapy-3.7.2/biapy/engine/malis_loss.py +403 -0
- biapy-3.7.2/biapy/engine/membrane_repair.py +922 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/metrics.py +1172 -215
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/schedulers/warmup_cosine_decay.py +24 -13
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/self_supervised.py +93 -31
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/semantic_seg.py +80 -43
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/super_resolution.py +69 -32
- biapy-3.7.2/biapy/engine/supervoxel_loss.py +231 -0
- biapy-3.7.2/biapy/engine/swt_loss.py +543 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/train_engine.py +29 -12
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/__init__.py +725 -97
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/attention_unet.py +3 -2
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/blocks.py +94 -12
- biapy-3.7.2/biapy/models/bmz_search.py +305 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/bmz_utils.py +119 -59
- biapy-3.7.2/biapy/models/dpt.py +131 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/efficientnet.py +26 -2
- biapy-3.7.2/biapy/models/gan_wrapper.py +82 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/mae.py +1 -1
- biapy-3.7.2/biapy/models/nafnet.py +397 -0
- biapy-3.7.2/biapy/models/patchgan.py +34 -0
- biapy-3.7.2/biapy/models/rdbm.py +426 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/resunet++.py +4 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/resunet.py +4 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/resunet_se.py +4 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/seunet.py +4 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/simple_cnn.py +39 -12
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/stunet.py +161 -57
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/unet.py +3 -2
- biapy-3.7.2/biapy/models/unetr.py +299 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/unext_v1.py +3 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/unext_v2.py +3 -3
- biapy-3.7.2/biapy/models/vit.py +222 -0
- biapy-3.7.2/biapy/models/vit_backbones/__init__.py +9 -0
- biapy-3.7.2/biapy/models/vit_backbones/celldino.py +105 -0
- biapy-3.7.2/biapy/models/vit_backbones/cellpose_sam.py +308 -0
- biapy-3.7.2/biapy/models/vit_backbones/common.py +254 -0
- biapy-3.7.2/biapy/models/vit_backbones/dinov3.py +492 -0
- biapy-3.7.2/biapy/models/vit_backbones/encoder.py +257 -0
- biapy-3.7.0/biapy/models/sam3_vit.py → biapy-3.7.2/biapy/models/vit_backbones/sam3.py +43 -284
- biapy-3.7.2/biapy/models/vit_backbones/weights.py +311 -0
- biapy-3.7.2/biapy/models/vit_decoders/__init__.py +9 -0
- biapy-3.7.2/biapy/models/vit_decoders/dpt_decoder.py +167 -0
- biapy-3.7.2/biapy/models/vit_decoders/output_heads.py +72 -0
- biapy-3.7.2/biapy/models/vit_decoders/readout_decoder.py +77 -0
- biapy-3.7.2/biapy/models/vit_decoders/unetr_decoder.py +299 -0
- biapy-3.7.2/biapy/models/vit_readout.py +140 -0
- biapy-3.7.2/biapy/models/wavelettention.py +1094 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/matching.py +131 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/misc.py +443 -2
- biapy-3.7.2/biapy/utils/scripts/calculate_lightmycells_metrics.py +172 -0
- biapy-3.7.2/biapy/utils/scripts/calculate_neuron_segmentation_metrics.py +309 -0
- biapy-3.7.2/biapy/utils/scripts/h5_to_zarr.py +133 -0
- biapy-3.7.2/biapy/utils/scripts/test_membrane_augmentors.py +441 -0
- biapy-3.7.2/biapy/utils/scripts/tif_to_zarr.py +80 -0
- biapy-3.7.2/biapy/utils/scripts/tune_postprocess_thresholds.py +177 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/zarr_to_tif.py +3 -6
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/util.py +89 -0
- biapy-3.7.2/biapy/wizard/__init__.py +35 -0
- biapy-3.7.2/biapy/wizard/common.py +212 -0
- biapy-3.7.2/biapy/wizard/config_builder.py +484 -0
- biapy-3.7.2/biapy/wizard/data_check.py +466 -0
- biapy-3.7.2/biapy/wizard/detection.py +121 -0
- biapy-3.7.2/biapy/wizard/fingerprint.py +404 -0
- biapy-3.7.2/biapy/wizard/inference.py +250 -0
- biapy-3.7.2/biapy/wizard/instance_seg.py +451 -0
- biapy-3.7.2/biapy/wizard/planning.py +185 -0
- biapy-3.7.2/biapy/wizard/preview.py +368 -0
- biapy-3.7.2/biapy/wizard/resources.py +183 -0
- biapy-3.7.2/biapy/wizard/semantic_seg.py +70 -0
- biapy-3.7.2/biapy/wizard/unet.py +253 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/PKG-INFO +7 -4
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/SOURCES.txt +57 -3
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/requires.txt +6 -3
- {biapy-3.7.0 → biapy-3.7.2}/pyproject.toml +16 -4
- biapy-3.7.2/tests/test_patch_sampling.py +215 -0
- biapy-3.7.2/tests/test_vit_backbones.py +183 -0
- biapy-3.7.2/tests/test_wizard.py +1104 -0
- biapy-3.7.2/tests/test_wizard_api.py +205 -0
- biapy-3.7.0/biapy/data/generators/chunked_test_pair_data_generator.py +0 -670
- biapy-3.7.0/biapy/models/nafnet.py +0 -436
- biapy-3.7.0/biapy/models/patchgan.py +0 -95
- biapy-3.7.0/biapy/models/tr_layers.py +0 -147
- biapy-3.7.0/biapy/models/unetr.py +0 -604
- biapy-3.7.0/biapy/models/vit.py +0 -337
- biapy-3.7.0/biapy/utils/scripts/h5_to_zarr.py +0 -44
- biapy-3.7.0/biapy/utils/scripts/tif_to_zarr.py +0 -47
- {biapy-3.7.0 → biapy-3.7.2}/LICENSE.md +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/README.md +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/config/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/data_2D_manipulation.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/pair_data_2D_generator.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/single_base_data_generator.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/single_data_2D_generator.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/generators/single_data_3D_generator.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/omnipose_core.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/embedseg.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/gradient_tracking.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/polygon_nms.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/data/post_processing/tta.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/schedulers/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/schedulers/warmup_reduce_on_plateau.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/workflow_utils/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/engine/workflow_utils/cellpose.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/dfcan.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/edsr.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/heads.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/hrnet.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/memory_bank.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/multiresunet.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/rcan.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/resunet_plus_plus.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/models/wdsr.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/__init__.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/callbacks.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/PR_plot_instances.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/calculate_detection_metrics.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/calculate_instance_metrics.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/calculate_similatiry_metrics.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/change_dataset_id_bmz_models.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/cityscape_remap_labels.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/collect_instance_sizes.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/convert_instance_data_to_detection.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/create_probability_csv.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/crop_2D_dataset.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/crop_3D_dataset.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/crop_and_discard_3D_dataset.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/detection_plots.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/detection_probs_to_points.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/estimate_blur.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/fill_holes_in_seg_masks.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/filter_close_points.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/foreground_probs_to_instances.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/from_class_csv_to_folders.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/h5_to_tif.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/lightmycell_data_preparation.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/measure_class_weights.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/measure_dataset_size.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/merge_dataset_channels.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/order_axes.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/repair_colab_notebooks.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/stardist_wheels.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy/utils/scripts/tif_to_h5.py +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/dependency_links.txt +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/entry_points.txt +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/biapy.egg-info/top_level.txt +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/setup.cfg +0 -0
- {biapy-3.7.0 → biapy-3.7.2}/tests/test_tta_equivariance.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: biapy
|
|
3
|
-
Version: 3.7.
|
|
3
|
+
Version: 3.7.2
|
|
4
4
|
Summary: BiaPy: Bioimage analysis pipelines in Python
|
|
5
5
|
Author-email: Daniel Franco-Barranco <daniel.franco@dipc.org>
|
|
6
6
|
Maintainer-email: Daniel Franco-Barranco <daniel.franco@dipc.org>
|
|
@@ -52,7 +52,8 @@ Requires-Dist: torchinfo>=1.8.0
|
|
|
52
52
|
Requires-Dist: tensorboardX>=2.6.2.2
|
|
53
53
|
Requires-Dist: h5py>=3.9.0
|
|
54
54
|
Requires-Dist: zarr>=3.1.5
|
|
55
|
-
Requires-Dist: bioimageio.core==0.
|
|
55
|
+
Requires-Dist: bioimageio.core==0.11.0
|
|
56
|
+
Requires-Dist: pydantic<2.14
|
|
56
57
|
Requires-Dist: imagecodecs>=2024.1.1
|
|
57
58
|
Requires-Dist: pooch>=1.8.1
|
|
58
59
|
Requires-Dist: xarray==2025.1.*
|
|
@@ -60,9 +61,11 @@ Requires-Dist: timm==1.0.14
|
|
|
60
61
|
Requires-Dist: pytorch-msssim
|
|
61
62
|
Requires-Dist: torchmetrics[image]==1.4.*
|
|
62
63
|
Requires-Dist: safetensors
|
|
63
|
-
Requires-Dist: torch<
|
|
64
|
-
Requires-Dist: torchvision<0
|
|
64
|
+
Requires-Dist: torch<3.0,>=2.9
|
|
65
|
+
Requires-Dist: torchvision<1.0,>=0.24
|
|
65
66
|
Requires-Dist: nibabel>=5.4.2
|
|
67
|
+
Requires-Dist: PyWavelets>=1.4.1
|
|
68
|
+
Requires-Dist: einops>=0.7.0
|
|
66
69
|
Dynamic: license-file
|
|
67
70
|
|
|
68
71
|

|
|
@@ -11,16 +11,86 @@ This `__init__.py` file serves as the entry point for the BiaPy package,
|
|
|
11
11
|
exposing the `BiaPy` class and defining the `main` function for command-line
|
|
12
12
|
execution.
|
|
13
13
|
|
|
14
|
-
Version: 3.7.
|
|
14
|
+
Version: 3.7.2
|
|
15
15
|
"""
|
|
16
16
|
|
|
17
|
-
__version__ = "3.7.
|
|
17
|
+
__version__ = "3.7.2"
|
|
18
18
|
|
|
19
19
|
import argparse
|
|
20
20
|
import os
|
|
21
21
|
import sys
|
|
22
|
-
from ._biapy import BiaPy, build_config
|
|
23
22
|
|
|
23
|
+
# The engine (BiaPy, build_config, validate_config) is imported on first use: importing it loads PyTorch and every workflow,
|
|
24
|
+
# which takes several seconds, and lightweight parts such as biapy.wizard don't need it.
|
|
25
|
+
_LAZY = {"BiaPy": "._biapy", "build_config": "._biapy", "validate_config": "._biapy"}
|
|
26
|
+
__all__ = ["BiaPy", "build_config", "validate_config", "main", "__version__"]
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __getattr__(name):
|
|
30
|
+
if name in _LAZY:
|
|
31
|
+
import importlib
|
|
32
|
+
|
|
33
|
+
value = getattr(importlib.import_module(_LAZY[name], __name__), name)
|
|
34
|
+
globals()[name] = value # later accesses don't go through __getattr__
|
|
35
|
+
return value
|
|
36
|
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def __dir__():
|
|
40
|
+
return sorted(list(globals()) + list(_LAZY))
|
|
41
|
+
|
|
42
|
+
def _validate_config_cli(argv):
|
|
43
|
+
"""
|
|
44
|
+
Validate a configuration file from the command line.
|
|
45
|
+
|
|
46
|
+
This function is intended to be used as a command-line utility to validate
|
|
47
|
+
a BiaPy configuration file without running anything: no data is loaded, no
|
|
48
|
+
model is built and nothing is written to disk. It prints ``OK`` if the
|
|
49
|
+
configuration is valid, or the first error found (naming the wrong key) otherwise.
|
|
50
|
+
|
|
51
|
+
Usage::
|
|
52
|
+
|
|
53
|
+
biapy validate-config <path_to_config_file>
|
|
54
|
+
biapy validate-config <path_to_config_file> --no-data-check
|
|
55
|
+
|
|
56
|
+
``--no-data-check`` skips the check that the data paths exist, so a configuration
|
|
57
|
+
can be validated before the data is available.
|
|
58
|
+
|
|
59
|
+
Parameters
|
|
60
|
+
----------
|
|
61
|
+
argv : list of str
|
|
62
|
+
Command-line arguments after ``validate-config``.
|
|
63
|
+
|
|
64
|
+
Exit codes
|
|
65
|
+
----------
|
|
66
|
+
0
|
|
67
|
+
The configuration is valid.
|
|
68
|
+
1
|
|
69
|
+
The configuration is not valid (the error is printed to stderr).
|
|
70
|
+
2
|
|
71
|
+
Wrong command-line arguments (raised by ``argparse``).
|
|
72
|
+
"""
|
|
73
|
+
from ._biapy import validate_config
|
|
74
|
+
parser = argparse.ArgumentParser(
|
|
75
|
+
prog="biapy validate-config",
|
|
76
|
+
description="Check a BiaPy YAML configuration without running anything.",
|
|
77
|
+
)
|
|
78
|
+
parser.add_argument("config", help="Path to the YAML configuration file")
|
|
79
|
+
parser.add_argument(
|
|
80
|
+
"--no-data-check",
|
|
81
|
+
action="store_true",
|
|
82
|
+
help="Skip the check that the data paths exist",
|
|
83
|
+
)
|
|
84
|
+
args = parser.parse_args(argv)
|
|
85
|
+
|
|
86
|
+
try:
|
|
87
|
+
cfg = validate_config(args.config, check_data_paths=not args.no_data_check)
|
|
88
|
+
except (ValueError, AssertionError, FileNotFoundError, KeyError) as e:
|
|
89
|
+
print(f"ERROR: {e}", file=sys.stderr)
|
|
90
|
+
sys.exit(1)
|
|
91
|
+
|
|
92
|
+
print(f"OK: {args.config} is a valid {cfg.PROBLEM.TYPE} {cfg.PROBLEM.NDIM} configuration")
|
|
93
|
+
sys.exit(0)
|
|
24
94
|
|
|
25
95
|
def main():
|
|
26
96
|
r"""
|
|
@@ -81,6 +151,10 @@ def main():
|
|
|
81
151
|
and calls its `run_job` method to start the workflow. The program exits
|
|
82
152
|
with status 0 upon successful completion.
|
|
83
153
|
"""
|
|
154
|
+
# Subcommand: 'biapy validate-config ...' only checks a config; any other call runs a job
|
|
155
|
+
if len(sys.argv) > 1 and sys.argv[1] == "validate-config":
|
|
156
|
+
_validate_config_cli(sys.argv[2:])
|
|
157
|
+
|
|
84
158
|
##########################
|
|
85
159
|
# ARGS COMPROBATION #
|
|
86
160
|
##########################
|
|
@@ -102,7 +176,10 @@ def main():
|
|
|
102
176
|
# --run_id $job_counter \
|
|
103
177
|
# --gpu 0,1
|
|
104
178
|
|
|
105
|
-
parser = argparse.ArgumentParser(
|
|
179
|
+
parser = argparse.ArgumentParser(
|
|
180
|
+
epilog="To check a configuration without running anything: biapy validate-config <config> [--no-data-check]",
|
|
181
|
+
)
|
|
182
|
+
|
|
106
183
|
parser.add_argument("--config", required=True, help="Path to the configuration file")
|
|
107
184
|
parser.add_argument(
|
|
108
185
|
"--result_dir",
|
|
@@ -137,6 +214,8 @@ def main():
|
|
|
137
214
|
)
|
|
138
215
|
args = parser.parse_args()
|
|
139
216
|
|
|
217
|
+
from ._biapy import BiaPy
|
|
218
|
+
|
|
140
219
|
_biapy = BiaPy(**vars(args), verbose=True)
|
|
141
220
|
_biapy.run_job()
|
|
142
221
|
sys.exit(0)
|