Skip to content

Commit abf7002

Browse files
willGraham01pre-commit-ci[bot]alessandrofelder
authored
Remove pytest-lazy-fixture due to incompatibility with pytest v8.0.0 (#369)
* Add skimage missing dependency and boot broken pytest-lazy-fixture * Remove lazy-fixture dependent fixtures * Clarify problem fixture docstrings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Remove fixtures and get pytest to check for cpu availability at runtime * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Actually raise the exception for not enough CPUs * try attempting garbage collector to run at end of test * Remove double dependency * improve detection debug logs (#375) * improve detection debug logs * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * remove too wordy debug logs --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> * Searching for min. segfault example (#376) Reverting apparently un-neccessary changes due to conflation with a bad cache fetch. * Revert "try attempting garbage collector to run at end of test" This reverts commit 2753abb. * Revert "Actually raise the exception for not enough CPUs" This reverts commit 1545b1b. * Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" This reverts commit bdd0d91. * Revert "Remove fixtures and get pytest to check for cpu availability at runtime" This reverts commit 125fa9d. * Revert "[pre-commit.ci] auto fixes from pre-commit.com hooks" This reverts commit dd0e519. * Revert "Clarify problem fixture docstrings" This reverts commit 67caf82. * Add a timeout to CI for runs * ignore vscode configs in git * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Bump timeout to 60 mins --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alessandro Felder <[email protected]>
1 parent ae10446 commit abf7002

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

.github/workflows/test_and_deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ jobs:
3535
test:
3636
needs: [linting, manifest]
3737
name: Run package tests
38+
timeout-minutes: 60
3839
runs-on: ${{ matrix.os }}
3940
strategy:
4041
matrix:

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,4 @@ benchmarks/env
143143
*/_version.py
144144

145145
.idea/
146+
.vscode/

cellfinder/core/detect/detect.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ def main(
179179
# processes.
180180
cells = mp_3d_filter.process(async_results, locks, callback=callback)
181181

182-
print(
183-
"Detection complete - all planes done in : {}".format(
184-
datetime.now() - start_time
185-
)
182+
time_elapsed = datetime.now() - start_time
183+
logger.debug(
184+
f"All Planes done. Found {len(cells)} cells in {format(time_elapsed)}"
186185
)
186+
print("Detection complete - all planes done in : {}".format(time_elapsed))
187187
return cells
188188

189189

cellfinder/core/detect/filters/volume/volume_filter.py

+5
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ def get_results(self) -> List[Cell]:
142142
)
143143

144144
cells = []
145+
146+
logger.debug(
147+
f"Processing {len(self.cell_detector.coords_maps.items())} cells"
148+
)
145149
for cell_id, cell_points in self.cell_detector.coords_maps.items():
146150
cell_volume = len(cell_points)
147151

@@ -191,6 +195,7 @@ def get_results(self) -> List[Cell]:
191195
)
192196
)
193197

198+
logger.debug("Finished splitting cell clusters.")
194199
return cells
195200

196201

pyproject.toml

-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@ dev = [
4646
"pre-commit",
4747
"pyinstrument",
4848
"pytest-cov",
49-
"pytest-lazy-fixture",
5049
"pytest-mock",
5150
"pytest-qt",
5251
"pytest-timeout",
@@ -125,7 +124,6 @@ commands = python -m pytest -v --color=yes
125124
deps =
126125
pytest
127126
pytest-cov
128-
pytest-lazy-fixture
129127
pytest-mock
130128
pytest-timeout
131129
# Even though napari is a requirement for cellfinder.napari, we have to

tests/core/test_integration/test_detection.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ def background_array():
4545
# FIXME: This isn't a very good example
4646
@pytest.mark.slow
4747
@pytest.mark.parametrize(
48-
"n_free_cpus",
48+
"free_cpus",
4949
[
50-
pytest.lazy_fixture("no_free_cpus"),
51-
pytest.lazy_fixture("run_on_one_cpu_only"),
50+
pytest.param("no_free_cpus", id="No free CPUs"),
51+
pytest.param("run_on_one_cpu_only", id="One CPU"),
5252
],
5353
)
54-
def test_detection_full(signal_array, background_array, n_free_cpus):
54+
def test_detection_full(signal_array, background_array, free_cpus, request):
55+
n_free_cpus = request.getfixturevalue(free_cpus)
5556
cells_test = main(
5657
signal_array,
5758
background_array,

0 commit comments

Comments
 (0)