Skip to content

Commit

Permalink
convert files to pass pylance, update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
haruishi43 committed Dec 21, 2020
1 parent 59fd845 commit 0ee27d5
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 8 deletions.
8 changes: 8 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ ignore =
E203,
E206,
E501,
# E731 do not assign a lambda expression, use a defflake8()
E731,
# F812: list comprehension redefines ...
F812,
# H101: Use TODO(NAME)
Expand All @@ -31,4 +33,10 @@ ignore =
H501,
# I100:
I100,
# N812, non lowercase
N812,
# N817: camelcase
N817,
W503,
# EXE001: Shebang is present but the file is not executable.
EXE001
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<a href="https://pypi.org/project/pyequilib/0.1.0/"><img src="https://badge.fury.io/py/pyequilib.svg"></a>
<a href="https://pypi.org/project/equilib"><img src="https://img.shields.io/pypi/pyversions/pyequilib"></a>
<a href="https://github.com/haruishi43/equilib/actions"><img src="https://github.com/haruishi43/equilib/workflows/ci/badge.svg"></a>
<a href="https://github.com/haruishi43/equilib/blob/master/LICENSE"><img alt="GitHub license" src="https://img.shields.io/github/license/haruishi43/equilib"></a>
</div>

<img src=".img/equilib.png" alt="equilib" width="720"/>
Expand Down
2 changes: 1 addition & 1 deletion tests/cube2equi/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
OUT_H = 240


def run(cube, cube_format):
def run(cube, cube_format) -> np.ndarray:
print("Input is {}:".format(cube_format))
if isinstance(cube, list):
c = cube[0] # get the first of the batch
Expand Down
2 changes: 1 addition & 1 deletion tests/cube2equi/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")


def run(cube, cube_format):
def run(cube, cube_format) -> torch.Tensor:
print("Input is {}".format(cube_format))
if isinstance(cube, list):
c = cube[0] # get the first of the batch
Expand Down
3 changes: 2 additions & 1 deletion tests/equi2cube/test_numpy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

import time
from typing import Union
import os.path as osp

import numpy as np
Expand All @@ -12,7 +13,7 @@
WIDTH = 256


def run(equi, rot, cube_format):
def run(equi, rot, cube_format) -> Union[list, dict, np.ndarray]:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down
3 changes: 2 additions & 1 deletion tests/equi2cube/test_torch.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

import time
from typing import Union
import os.path as osp

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


def run(equi, rot, cube_format):
def run(equi, rot, cube_format) -> Union[dict, list, torch.Tensor]:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down
2 changes: 1 addition & 1 deletion tests/equi2equi/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
HEIGHT = 320


def run(equi, rot):
def run(equi, rot) -> np.ndarray:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down
2 changes: 1 addition & 1 deletion tests/equi2equi/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")


def run(equi, rot):
def run(equi, rot) -> torch.Tensor:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down
2 changes: 1 addition & 1 deletion tests/equi2pers/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
FOV = 90


def run(equi, rot):
def run(equi, rot) -> np.ndarray:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down
2 changes: 1 addition & 1 deletion tests/equi2pers/test_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
DEVICE = torch.device("cuda" if torch.cuda.is_available() else "cpu")


def run(equi, rot):
def run(equi, rot) -> torch.Tensor:
h_equi, w_equi = equi.shape[-2:]
print("equirectangular image size:")
print(h_equi, w_equi)
Expand Down

0 comments on commit 0ee27d5

Please sign in to comment.