Skip to content

Commit

Permalink
_save_report as staticmethod
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoarbitrio committed Oct 28, 2020
1 parent 5f9023b commit a993bac
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/histolab/tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,8 +626,8 @@ def _highest_score_tiles(self, slide: Slide) -> List[Tuple[float, CoordinatePair

return highest_score_tiles, highest_scaled_score_tiles

@staticmethod
def _save_report(
self,
report_path: str,
highest_score_tiles: List[Tuple[float, CoordinatePair]],
highest_scaled_score_tiles: List[Tuple[float, CoordinatePair]],
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/test_tiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -859,7 +859,7 @@ def it_can_extract_score_tiles_and_save_report(self, request, tmpdir):
_tile_filename.side_effect = [
f"tile_{i}_level2_0-10-0-10.png" for i in range(2)
]
_save_report = method_mock(request, ScoreTiler, "_save_report")
_save_report = method_mock(request, ScoreTiler, "_save_report", autospec=False)
random_scorer = RandomScorer()
score_tiler = ScoreTiler(random_scorer, (10, 10), 2, 2)

Expand All @@ -881,7 +881,6 @@ def it_can_extract_score_tiles_and_save_report(self, request, tmpdir):
os.path.join(tmp_path_, "processed", "tiles", "tile_1_level2_0-10-0-10.png")
)
_save_report.assert_called_once_with(
score_tiler,
"report.csv",
[(0.8, coords), (0.7, coords)],
[(0.8, coords), (0.7, coords)],
Expand Down

0 comments on commit a993bac

Please sign in to comment.