Skip to content

Commit

Permalink
Format Python code with psf/black push (#340)
Browse files Browse the repository at this point in the history
There appear to be some python formatting errors in
392ddb3. This pull request
uses the [psf/black](https://github.com/psf/black) formatter to fix
these issues.
  • Loading branch information
mzouink authored Nov 13, 2024
2 parents 2b80cfa + 65a8743 commit 7b7c956
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 18 deletions.
13 changes: 11 additions & 2 deletions tests/fixtures/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
from .db import options
from .architectures import dummy_architecture, unet_architecture,unet_architecture_builder
from .architectures import (
dummy_architecture,
unet_architecture,
unet_architecture_builder,
)
from .arrays import dummy_array, zarr_array, cellmap_array
from .datasplits import dummy_datasplit, twelve_class_datasplit, six_class_datasplit, upsample_six_class_datasplit
from .datasplits import (
dummy_datasplit,
twelve_class_datasplit,
six_class_datasplit,
upsample_six_class_datasplit,
)
from .evaluators import binary_3_channel_evaluator
from .losses import dummy_loss
from .post_processors import argmax, threshold
Expand Down
2 changes: 0 additions & 2 deletions tests/fixtures/architectures.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def unet_architecture():
)



def unet_architecture_builder(batch_norm, upsample, use_attention, three_d):
name = "3d_unet" if three_d else "2d_unet"
name = f"{name}_bn" if batch_norm else name
Expand Down Expand Up @@ -71,4 +70,3 @@ def unet_architecture_builder(batch_norm, upsample, use_attention, three_d):
use_attention=use_attention,
upsample_factors=[(1, 2, 2)] if upsample else [],
)

2 changes: 0 additions & 2 deletions tests/fixtures/datasplits.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ def six_class_datasplit(tmp_path):
return six_class_distances_datasplit_config




@pytest.fixture()
def upsample_six_class_datasplit(tmp_path):
"""
Expand Down
9 changes: 3 additions & 6 deletions tests/operations/test_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ def test_train(
@pytest.mark.parametrize("datasplit", [lf("six_class_datasplit")])
@pytest.mark.parametrize("task", [lf("distance_task")])
@pytest.mark.parametrize("trainer", [lf("gunpowder_trainer")])
@pytest.mark.parametrize("batch_norm", [ False])
@pytest.mark.parametrize("batch_norm", [False])
@pytest.mark.parametrize("upsample", [False])
@pytest.mark.parametrize("use_attention", [ False])
@pytest.mark.parametrize("three_d", [ False])
@pytest.mark.parametrize("use_attention", [False])
@pytest.mark.parametrize("three_d", [False])
def test_train_unet(
datasplit, task, trainer, batch_norm, upsample, use_attention, three_d
):
Expand Down Expand Up @@ -148,9 +148,6 @@ def test_train_unet(
assert training_stats.trained_until() == run_config.num_iterations





@pytest.mark.parametrize("upsample_datasplit", [lf("upsample_six_class_datasplit")])
@pytest.mark.parametrize("task", [lf("distance_task")])
@pytest.mark.parametrize("trainer", [lf("gunpowder_trainer")])
Expand Down
8 changes: 2 additions & 6 deletions tests/operations/test_validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,11 @@ def test_validate_run(
os.chdir(old_path)




@pytest.mark.parametrize("datasplit", [lf("six_class_datasplit")])
@pytest.mark.parametrize("task", [lf("distance_task")])
@pytest.mark.parametrize("trainer", [lf("gunpowder_trainer")])
@pytest.mark.parametrize("architecture", [lf("unet_architecture")])
def test_validate_unet(
datasplit, task, trainer, architecture
):
def test_validate_unet(datasplit, task, trainer, architecture):
store = create_config_store()
weights_store = create_weights_store()

Expand All @@ -132,4 +128,4 @@ def test_validate_unet(

# -------------------------------------
weights_store.store_weights(run, 0)
validate_run(run, 0)
validate_run(run, 0)

0 comments on commit 7b7c956

Please sign in to comment.