4
4
import pickle
5
5
import tempfile
6
6
import unittest
7
- from typing import Dict , Iterator , Tuple
7
+ from typing import Iterator
8
8
9
9
import numpy as np
10
10
import pytest
@@ -23,7 +23,7 @@ def setUp(self) -> None:
23
23
24
24
def boxes15_stream (
25
25
self , interleaved : bool = True
26
- ) -> Iterator [Tuple [int , Tuple [float , float , float , float ], int ]]:
26
+ ) -> Iterator [tuple [int , tuple [float , float , float , float ], int ]]:
27
27
boxes15 = np .genfromtxt ("boxes_15x15.data" )
28
28
for i , (minx , miny , maxx , maxy ) in enumerate (boxes15 ):
29
29
if interleaved :
@@ -394,7 +394,7 @@ def setUp(self) -> None:
394
394
395
395
def boxes15_stream (
396
396
self , interleaved : bool = True
397
- ) -> Iterator [Tuple [int , Tuple [float , float , float , float ], int ]]:
397
+ ) -> Iterator [tuple [int , tuple [float , float , float , float ], int ]]:
398
398
for i , (minx , miny , maxx , maxy ) in enumerate (self .boxes15 ):
399
399
if interleaved :
400
400
yield (i , (minx , miny , maxx , maxy ), 42 )
@@ -456,7 +456,7 @@ def test_interleaving(self) -> None:
456
456
457
457
def data_gen (
458
458
interleaved : bool = True ,
459
- ) -> Iterator [Tuple [int , Tuple [float , float , float , float ], int ]]:
459
+ ) -> Iterator [tuple [int , tuple [float , float , float , float ], int ]]:
460
460
for i , (minx , miny , maxx , maxy ) in enumerate (self .boxes15 ):
461
461
if interleaved :
462
462
yield (i , (minx , miny , maxx , maxy ), 42 )
@@ -590,7 +590,7 @@ def data_gen(
590
590
591
591
# go through the traversal and see if everything is close
592
592
assert all (
593
- all (np .allclose (a , b ) for a , b in zip (L , E ))
593
+ all (np .allclose (a , b ) for a , b in zip (L , E )) # type: ignore
594
594
for L , E in zip (leaves , expected )
595
595
)
596
596
@@ -724,7 +724,7 @@ class TestException(Exception):
724
724
pass
725
725
726
726
def create_index () -> index .Index :
727
- def gen () -> Iterator [Tuple [int , Tuple [int , int , int , int ], None ]]:
727
+ def gen () -> Iterator [tuple [int , tuple [int , int , int , int ], None ]]:
728
728
# insert at least 6 or so before the exception
729
729
for i in range (10 ):
730
730
yield (i , (1 , 2 , 3 , 4 ), None )
@@ -767,7 +767,7 @@ def destroy(self, returnError):
767
767
768
768
def clear (self ) -> None :
769
769
"""Clear all our data"""
770
- self .dict : Dict = {}
770
+ self .dict : dict = {}
771
771
772
772
def loadByteArray (self , page , returnError ):
773
773
"""Returns the data for page or returns an error"""
0 commit comments