Skip to content

Commit 0ee27d5

Browse files
committed
convert files to pass pylance, update readme
1 parent 59fd845 commit 0ee27d5

10 files changed

Lines changed: 19 additions & 8 deletions

File tree

.flake8

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ ignore =
55
E203,
66
E206,
77
E501,
8+
# E731 do not assign a lambda expression, use a defflake8()
9+
E731,
810
# F812: list comprehension redefines ...
911
F812,
1012
# H101: Use TODO(NAME)
@@ -31,4 +33,10 @@ ignore =
3133
H501,
3234
# I100:
3335
I100,
36+
# N812, non lowercase
37+
N812,
38+
# N817: camelcase
39+
N817,
3440
W503,
41+
# EXE001: Shebang is present but the file is not executable.
42+
EXE001

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<a href="https://pypi.org/project/pyequilib/0.1.0/"><img src="https://badge.fury.io/py/pyequilib.svg"></a>
1111
<a href="https://pypi.org/project/equilib"><img src="https://img.shields.io/pypi/pyversions/pyequilib"></a>
1212
<a href="https://github.com/haruishi43/equilib/actions"><img src="https://github.com/haruishi43/equilib/workflows/ci/badge.svg"></a>
13+
<a href="https://github.com/haruishi43/equilib/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/haruishi43/equilib"></a>
1314
</div>
1415

1516
<img src=".img/equilib.png" alt="equilib" width="720"/>

tests/cube2equi/test_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
OUT_H = 240
1414

1515

16-
def run(cube, cube_format):
16+
def run(cube, cube_format) -> np.ndarray:
1717
print("Input is {}:".format(cube_format))
1818
if isinstance(cube, list):
1919
c = cube[0] # get the first of the batch

tests/cube2equi/test_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
1818

1919

20-
def run(cube, cube_format):
20+
def run(cube, cube_format) -> torch.Tensor:
2121
print("Input is {}".format(cube_format))
2222
if isinstance(cube, list):
2323
c = cube[0] # get the first of the batch

tests/equi2cube/test_numpy.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import time
4+
from typing import Union
45
import os.path as osp
56

67
import numpy as np
@@ -12,7 +13,7 @@
1213
WIDTH = 256
1314

1415

15-
def run(equi, rot, cube_format):
16+
def run(equi, rot, cube_format) -> Union[list, dict, np.ndarray]:
1617
h_equi, w_equi = equi.shape[-2:]
1718
print("equirectangular image size:")
1819
print(h_equi, w_equi)

tests/equi2cube/test_torch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22

33
import time
4+
from typing import Union
45
import os.path as osp
56

67
import numpy as np
@@ -17,7 +18,7 @@
1718
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
1819

1920

20-
def run(equi, rot, cube_format):
21+
def run(equi, rot, cube_format) -> Union[dict, list, torch.Tensor]:
2122
h_equi, w_equi = equi.shape[-2:]
2223
print("equirectangular image size:")
2324
print(h_equi, w_equi)

tests/equi2equi/test_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
HEIGHT = 320
1414

1515

16-
def run(equi, rot):
16+
def run(equi, rot) -> np.ndarray:
1717
h_equi, w_equi = equi.shape[-2:]
1818
print("equirectangular image size:")
1919
print(h_equi, w_equi)

tests/equi2equi/test_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
2020

2121

22-
def run(equi, rot):
22+
def run(equi, rot) -> torch.Tensor:
2323
h_equi, w_equi = equi.shape[-2:]
2424
print("equirectangular image size:")
2525
print(h_equi, w_equi)

tests/equi2pers/test_numpy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
FOV = 90
1818

1919

20-
def run(equi, rot):
20+
def run(equi, rot) -> np.ndarray:
2121
h_equi, w_equi = equi.shape[-2:]
2222
print("equirectangular image size:")
2323
print(h_equi, w_equi)

tests/equi2pers/test_torch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")
2525

2626

27-
def run(equi, rot):
27+
def run(equi, rot) -> torch.Tensor:
2828
h_equi, w_equi = equi.shape[-2:]
2929
print("equirectangular image size:")
3030
print(h_equi, w_equi)

0 commit comments

Comments
 (0)