diff --git a/dacapo/experiments/run.py b/dacapo/experiments/run.py index e7afb03a..55821a6c 100644 --- a/dacapo/experiments/run.py +++ b/dacapo/experiments/run.py @@ -6,6 +6,7 @@ from .validation_scores import ValidationScores from .starts import Start from .model import Model +from typing import Optional import torch @@ -48,13 +49,13 @@ class Run: task: Task architecture: Architecture trainer: Trainer - datasplit: DataSplit + _datasplit: Optional[DataSplit] model: Model optimizer: torch.optim.Optimizer training_stats: TrainingStats - validation_scores: ValidationScores + _validation_scores: Optional[ValidationScores] def __init__(self, run_config, load_starter_model: bool = True): """ diff --git a/pyproject.toml b/pyproject.toml index 0ab64cdf..8b32fe89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,7 +63,7 @@ dependencies = [ # extras # https://peps.python.org/pep-0621/#dependencies-optional-dependencies [project.optional-dependencies] -test = ["pytest==7.4.4", "pytest-cov", "pytest-lazy-fixture"] +test = ["pytest", "pytest-cov", "pytest-lazy-fixtures"] dev = [ "black", "mypy", diff --git a/tests/components/test_arrays.py b/tests/components/test_arrays.py index d62dcb97..d91863ad 100644 --- a/tests/components/test_arrays.py +++ b/tests/components/test_arrays.py @@ -3,15 +3,15 @@ from dacapo.store.create_store import create_config_store import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf @pytest.mark.parametrize( "array_config", [ - lazy_fixture("cellmap_array"), - lazy_fixture("zarr_array"), - lazy_fixture("dummy_array"), + lf("cellmap_array"), + lf("zarr_array"), + lf("dummy_array"), ], ) def test_array_api(options, array_config): diff --git a/tests/components/test_gp_arraysource.py b/tests/components/test_gp_arraysource.py index 7ff62603..69fee515 100644 --- a/tests/components/test_gp_arraysource.py +++ b/tests/components/test_gp_arraysource.py @@ -5,15 +5,15 @@ import gunpowder as gp import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf @pytest.mark.parametrize( "array_config", [ - lazy_fixture("cellmap_array"), - lazy_fixture("zarr_array"), - lazy_fixture("dummy_array"), + lf("cellmap_array"), + lf("zarr_array"), + lf("dummy_array"), ], ) def test_gp_dacapo_array_source(array_config): diff --git a/tests/components/test_trainers.py b/tests/components/test_trainers.py index 172a89b7..f3f9b07a 100644 --- a/tests/components/test_trainers.py +++ b/tests/components/test_trainers.py @@ -3,14 +3,14 @@ from dacapo.store.create_store import create_config_store import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf @pytest.mark.parametrize( "trainer_config", [ - lazy_fixture("dummy_trainer"), - lazy_fixture("gunpowder_trainer"), + lf("dummy_trainer"), + lf("gunpowder_trainer"), ], ) def test_trainer( diff --git a/tests/operations/test_apply.py b/tests/operations/test_apply.py index 5ce608e1..02bbd47b 100644 --- a/tests/operations/test_apply.py +++ b/tests/operations/test_apply.py @@ -8,7 +8,7 @@ from dacapo import apply import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf import logging @@ -18,9 +18,9 @@ @pytest.mark.parametrize( "run_config", [ - # lazy_fixture("distance_run"), - lazy_fixture("dummy_run"), - # lazy_fixture("onehot_run"), + # lf("distance_run"), + lf("dummy_run"), + # lf("onehot_run"), ], ) def test_apply(options, run_config, zarr_array, tmp_path): diff --git a/tests/operations/test_predict.py b/tests/operations/test_predict.py index cd8f6a6c..4a4b5347 100644 --- a/tests/operations/test_predict.py +++ b/tests/operations/test_predict.py @@ -8,7 +8,7 @@ from dacapo import predict import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf import logging @@ -18,9 +18,9 @@ @pytest.mark.parametrize( "run_config", [ - # lazy_fixture("distance_run"), - lazy_fixture("dummy_run"), - # lazy_fixture("onehot_run"), + # lf("distance_run"), + lf("dummy_run"), + # lf("onehot_run"), ], ) def test_predict(options, run_config, zarr_array, tmp_path): diff --git a/tests/operations/test_train.py b/tests/operations/test_train.py index d36655ea..a852101b 100644 --- a/tests/operations/test_train.py +++ b/tests/operations/test_train.py @@ -7,7 +7,7 @@ from dacapo.train import train_run import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf import logging @@ -20,9 +20,9 @@ @pytest.mark.parametrize( "run_config", [ - lazy_fixture("distance_run"), - lazy_fixture("dummy_run"), - lazy_fixture("onehot_run"), + lf("distance_run"), + lf("dummy_run"), + lf("onehot_run"), ], ) def test_train( diff --git a/tests/operations/test_validate.py b/tests/operations/test_validate.py index fa2cc6b9..b293bcbf 100644 --- a/tests/operations/test_validate.py +++ b/tests/operations/test_validate.py @@ -8,7 +8,7 @@ from dacapo import validate import pytest -from pytest_lazyfixture import lazy_fixture +from pytest_lazy_fixtures import lf import logging @@ -18,8 +18,8 @@ @pytest.mark.parametrize( "run_config", [ - lazy_fixture("distance_run"), - # lazy_fixture("onehot_run"), + lf("distance_run"), + # lf("onehot_run"), ], ) def test_validate(