This repository was archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
Fix for stuck Linux build: Move pytest to Windows #652
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
c848bf6
fix
ant0nsc 6317a1a
rename workflows
ant0nsc fb0901b
Revert "fix"
ant0nsc 88b0f96
mark linux-only tests
ant0nsc 977dd70
fix code
ant0nsc 067d249
speed up test
ant0nsc 930731e
conda for windows
ant0nsc 2e94f1b
job rename
ant0nsc 626b36b
disable caching for now
ant0nsc 4b0ee80
disable caching part 2
ant0nsc 49a072e
disable most jobs
ant0nsc a50a9cc
fix script/bash problem
ant0nsc e3965ae
fix skipif errors
ant0nsc fb949f3
multiplatform cache
ant0nsc 32e1da3
cleanup
ant0nsc 5f24166
yaml fix
ant0nsc 4d29238
fixed test
maxilse c551223
put all jobs back in
ant0nsc 34d0807
changelog
ant0nsc bc16040
changelog
ant0nsc c0335dd
cache-only job
ant0nsc 62e09e6
comment
ant0nsc 98b3c3c
fix flake&mypy
ant0nsc ee8370c
fix build
ant0nsc 93b9417
print
ant0nsc 9f8d419
fix problem with ' at the end
ant0nsc 2daa4a2
fix problem with ' at the end,m 2
ant0nsc d5603d4
escape
ant0nsc 617b768
forward slash
ant0nsc e9419ea
fix
ant0nsc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,21 +2,24 @@ | |
|
|
||
| import numpy as np | ||
| import pytest | ||
| from cucim import CuImage | ||
| from monai.data.image_reader import WSIReader | ||
|
|
||
| from InnerEye.Common.common_util import is_windows | ||
| from InnerEye.Common.fixed_paths_for_tests import tests_root_directory | ||
| from InnerEye.ML.Histopathology.preprocessing.tiling import tile_array_2d | ||
| from InnerEye.ML.Histopathology.preprocessing.loading import LoadROId, get_luminance, load_slide_at_level, segment_foreground | ||
| from InnerEye.ML.Histopathology.preprocessing.loading import (LoadROId, get_luminance, load_slide_at_level, | ||
| segment_foreground) | ||
| from InnerEye.ML.Histopathology.utils.naming import SlideKey | ||
| from Tests.ML.histopathology.datasets.test_slides_dataset import MockSlidesDataset | ||
|
|
||
| TEST_IMAGE_PATH = str(tests_root_directory("ML/histopathology/test_data/panda_wsi_example.tiff")) | ||
|
|
||
|
|
||
| @pytest.mark.skipif(is_windows(), reason="cucim package is not available on Windows") | ||
| def test_load_slide() -> None: | ||
| level = 2 | ||
| reader = WSIReader('cuCIM') | ||
| from cucim import CuImage | ||
| slide_obj: CuImage = reader.read(TEST_IMAGE_PATH) | ||
| dims = slide_obj.resolutions['level_dimensions'][level][::-1] | ||
|
|
||
|
|
@@ -39,9 +42,11 @@ def test_load_slide() -> None: | |
| assert np.array_equiv(larger_slide[:, :, dims[1]:], empty_fill_value) | ||
|
|
||
|
|
||
| @pytest.mark.skipif(is_windows(), reason="cucim package is not available on Windows") | ||
| def test_get_luminance() -> None: | ||
| level = 2 # here we only need to test at a single resolution | ||
| reader = WSIReader('cuCIM') | ||
| from cucim import CuImage | ||
| slide_obj: CuImage = reader.read(TEST_IMAGE_PATH) | ||
|
|
||
| slide = load_slide_at_level(reader, slide_obj, level) | ||
|
|
@@ -61,9 +66,11 @@ def test_get_luminance() -> None: | |
| assert np.array_equal(slide_luminance_tiles.squeeze(1), tiles_luminance) | ||
|
|
||
|
|
||
| @pytest.mark.skipif(is_windows(), reason="cucim package is not available on Windows") | ||
| def test_segment_foreground() -> None: | ||
| level = 2 # here we only need to test at a single resolution | ||
| reader = WSIReader('cuCIM') | ||
| from cucim import CuImage | ||
| slide_obj: CuImage = reader.read(TEST_IMAGE_PATH) | ||
| slide = load_slide_at_level(reader, slide_obj, level) | ||
|
|
||
|
|
@@ -95,11 +102,13 @@ def test_segment_foreground() -> None: | |
|
|
||
| @pytest.mark.parametrize('level', [1, 2]) | ||
| @pytest.mark.parametrize('foreground_threshold', [None, 215]) | ||
| @pytest.mark.skipif(is_windows(), reason="cucim package is not available on Windows") | ||
| def test_get_bounding_box(level: int, foreground_threshold: Optional[float]) -> None: | ||
| margin = 0 | ||
| reader = WSIReader('cuCIM') | ||
| loader = LoadROId(reader, image_key=SlideKey.IMAGE, level=level, margin=margin, | ||
| foreground_threshold=foreground_threshold) | ||
| from cucim import CuImage | ||
| slide_obj: CuImage = reader.read(TEST_IMAGE_PATH) | ||
| level0_bbox, _ = loader._get_bounding_box(slide_obj) | ||
|
|
||
|
|
@@ -130,6 +139,7 @@ def test_get_bounding_box(level: int, foreground_threshold: Optional[float]) -> | |
| @pytest.mark.parametrize('level', [1, 2]) | ||
| @pytest.mark.parametrize('margin', [0, 42]) | ||
| @pytest.mark.parametrize('foreground_threshold', [None, 215]) | ||
| @pytest.mark.skipif(is_windows(), reason="cucim package is not available on Windows") | ||
| def test_load_roi(level: int, margin: int, foreground_threshold: Optional[float]) -> None: | ||
| dataset = MockSlidesDataset() | ||
| sample = dataset[0] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this moving the tests to Windows and skipping them a temporary workaround? |
||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.