33from __future__ import annotations
44
55import copy
6+ import itertools
67import json
78import logging
89import re
910import shutil
10- from collections .abc import Callable
1111from copy import deepcopy
1212from pathlib import Path
1313from typing import TYPE_CHECKING
5151)
5252
5353if TYPE_CHECKING : # pragma: no cover
54- from collections .abc import Iterable
54+ from collections .abc import Callable , Iterable
5555
5656 import requests
5757 from openslide import OpenSlide
@@ -136,7 +136,7 @@ def strictly_increasing(sequence: Iterable) -> bool:
136136 bool: True if strictly increasing.
137137
138138 """
139- return all (a < b for a , b in zip (sequence , sequence [ 1 :], strict = False ))
139+ return all (a < b for a , b in itertools . pairwise (sequence ))
140140
141141
142142def strictly_decreasing (sequence : Iterable ) -> bool :
@@ -150,7 +150,7 @@ def strictly_decreasing(sequence: Iterable) -> bool:
150150 bool: True if strictly decreasing.
151151
152152 """
153- return all (a > b for a , b in zip (sequence , sequence [ 1 :], strict = False ))
153+ return all (a > b for a , b in itertools . pairwise (sequence ))
154154
155155
156156def read_rect_objective_power (wsi : WSIReader , location : IntPair , size : IntPair ) -> None :
@@ -1900,29 +1900,29 @@ def test_command_line_jp2_read_bounds(sample_jp2: Path, tmp_path: Path) -> None:
19001900 assert Path (tmp_path ).joinpath ("../im_region.jpg" ).is_file ()
19011901
19021902
1903- @pytest .mark .skipif (
1904- utils .env_detection .running_on_ci (),
1905- reason = "No need to display image on travis." ,
1906- )
1907- def test_command_line_jp2_read_bounds_show (sample_jp2 : Path ) -> None :
1908- """Test JP2 read_bounds with mode as 'show'."""
1909- runner = CliRunner ()
1910- read_bounds_result = runner .invoke (
1911- cli .main ,
1912- [
1913- "read-bounds" ,
1914- "--img-input" ,
1915- str (Path (sample_jp2 )),
1916- "--resolution" ,
1917- "0" ,
1918- "--units" ,
1919- "level" ,
1920- "--mode" ,
1921- "show" ,
1922- ],
1923- )
1924-
1925- assert read_bounds_result .exit_code == 0
1903+ # @pytest.mark.skipif(
1904+ # utils.env_detection.running_on_ci(),
1905+ # reason="No need to display image on travis.",
1906+ # )
1907+ # def test_command_line_jp2_read_bounds_show(sample_jp2: Path) -> None:
1908+ # """Test JP2 read_bounds with mode as 'show'."""
1909+ # runner = CliRunner()
1910+ # read_bounds_result = runner.invoke(
1911+ # cli.main,
1912+ # [
1913+ # "read-bounds",
1914+ # "--img-input",
1915+ # str(Path(sample_jp2)),
1916+ # "--resolution",
1917+ # "0",
1918+ # "--units",
1919+ # "level",
1920+ # "--mode",
1921+ # "show",
1922+ # ],
1923+ # )
1924+ #
1925+ # assert read_bounds_result.exit_code == 0
19261926
19271927
19281928def test_command_line_unsupported_file_read_bounds (sample_svs : Path ) -> None :
0 commit comments