Skip to content

Commit e1a6b5a

Browse files
committed
Fix CI quality paths and typing check; bump version to 0.6.5
1 parent 3dc5445 commit e1a6b5a

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ jobs:
2828
python -m pip install -e ".[dev]"
2929
3030
- name: Lint
31-
run: ruff check tests geodata/identity geodata/repository/sqlite_repository.py geodata/interfaces/cli.py scripts/benchmark_queries.py
31+
run: ruff check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/benchmark_queries.py
3232

3333
- name: Format check
34-
run: black --check tests geodata/identity geodata/repository/sqlite_repository.py geodata/interfaces/cli.py scripts/benchmark_queries.py
34+
run: black --check tests geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py scripts/benchmark_queries.py
3535

3636
- name: Type check
37-
run: mypy geodata/identity geodata/repository/sqlite_repository.py geodata/interfaces/cli.py
37+
run: mypy geocompare/identity geocompare/repository/sqlite_repository.py geocompare/interfaces/cli.py
3838

3939
- name: Test
4040
run: pytest -q

geocompare/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.6.4"
1+
__version__ = "0.6.5"

geocompare/tools/numeric.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,16 @@ def safe_divide(
8282
left = parse_number(dividend, default=default)
8383
right = parse_float(divisor, default=default)
8484

85-
if isinstance(left, float) and math.isnan(left):
85+
try:
86+
left_num = float(left)
87+
right_num = float(right)
88+
except (TypeError, ValueError):
8689
return np.nan
87-
if isinstance(right, float) and math.isnan(right):
90+
91+
if math.isnan(left_num):
92+
return np.nan
93+
if math.isnan(right_num):
8894
return np.nan
89-
if right == 0.0:
95+
if right_num == 0.0:
9096
return divide_by_zero
91-
return left / right
97+
return left_num / right_num

0 commit comments

Comments
 (0)