Skip to content

Commit

Permalink
Use .value to access str value of enum DistributionStrategy.
Browse files Browse the repository at this point in the history
  • Loading branch information
markbader committed Aug 8, 2023
1 parent 3e0d68c commit 36eefcf
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DistributionStrategy(str, Enum):
SLURM = "slurm"
KUBERNETES = "kubernetes"
MULTIPROCESSING = "multiprocessing"
DEBUGS_SEQUENTIAL = "debug_sequential"
DEBUG_SEQUENTIAL = "debug_sequential"


class LayerCategory(str, Enum):
Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/check_equality.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/compress.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/convert_knossos.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/convert_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/convert_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/downsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)

Expand Down
2 changes: 1 addition & 1 deletion webknossos/webknossos/cli/export_wkw_as_tiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def main(
logging.info("Starting tiff export for bounding box: %s", bbox)
executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)
used_tile_size = None
Expand Down
10 changes: 5 additions & 5 deletions webknossos/webknossos/cli/upsample.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ def main(

executor_args = Namespace(
jobs=jobs,
distribution_strategy=distribution_strategy,
distribution_strategy=distribution_strategy.value,
job_resources=job_resources,
)
dataset = Dataset.open(source)
mode = SamplingModes.parse(sampling_mode.value)

with get_executor_for_args(args=executor_args) as executor:
if layer_name is None:
upsample_all_layers(dataset, mode, from_mag, executor_args)
else:
if layer_name is None:
upsample_all_layers(dataset, mode, from_mag, executor_args)
else:
with get_executor_for_args(args=executor_args) as executor:
layer = dataset.get_layer(layer_name)
layer.upsample(from_mag=from_mag, sampling_mode=mode, executor=executor)

Expand Down

0 comments on commit 36eefcf

Please sign in to comment.