Skip to content

Commit

Permalink
Updated copyright headers, minor refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
sveinbjornt committed May 12, 2024
1 parent d8e428f commit 32b5af2
Show file tree
Hide file tree
Showing 12 changed files with 13 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.9", "3.12"]

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2018-2023, Sveinbjorn Thordarson
Copyright (c) 2018-2024, Sveinbjorn Thordarson
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ pip install .

## BSD License

Copyright (C) 2018-2023 Sveinbjorn Thordarson [<[email protected]>](mailto:[email protected])
Copyright (C) 2018-2024 Sveinbjorn Thordarson [<[email protected]>](mailto:[email protected])

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ ignore = [
"TID", # No relative parent imports rule
"TCH", # Move into type checking block - too risky, causes issues
"RSE102", # Bug: https://github.com/astral-sh/ruff/issues/5416
"FA100", #
]
# Silence complaints when black doesn't format
# lines that are slightly over 88 characters long
Expand Down
4 changes: 2 additions & 2 deletions src/iceaddr/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
"""

import importlib.metadata

__author__ = "Sveinbjorn Thordarson"
__copyright__ = "(C) 2018-2023 Sveinbjorn Thordarson"
__copyright__ = "(C) 2018-2024 Sveinbjorn Thordarson"
__version__ = importlib.metadata.version("iceaddr")

from .addresses import * # noqa: F403
Expand Down
4 changes: 1 addition & 3 deletions src/iceaddr/addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
This file contains code related to Icelandic address lookup.
"""

from __future__ import annotations

from typing import Any, Dict, List, Optional

import re
Expand Down
2 changes: 1 addition & 1 deletion src/iceaddr/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
This file contains code related to the iceaddr sqlite3 database.
Expand Down
6 changes: 2 additions & 4 deletions src/iceaddr/dist.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
"""

from __future__ import annotations

from typing import Tuple

import math

_EARTH_RADIUS = 6371.0088 # Earth's radius in km
EARTH_RADIUS_KM = 6371.0088


def distance(loc1: Tuple[float, float], loc2: Tuple[float, float]) -> float:
Expand Down Expand Up @@ -54,7 +52,7 @@ def distance(loc1: Tuple[float, float], loc2: Tuple[float, float]) -> float:
+ math.cos(math.radians(lat1)) * math.cos(math.radians(lat2)) * slon * slon
)
c = 2 * math.atan2(math.sqrt(a), math.sqrt(1 - a))
return _EARTH_RADIUS * c
return EARTH_RADIUS_KM * c


ICELAND_COORDS = (64.9957538607, -18.5739616708)
Expand Down
4 changes: 1 addition & 3 deletions src/iceaddr/placenames.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
This file contains code related to placename lookup.
"""

from __future__ import annotations

from typing import Any, Dict, List

from .db import shared_db
Expand Down
4 changes: 1 addition & 3 deletions src/iceaddr/postcodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
This file contains code and data related to Icelandic postcodes.
"""

from __future__ import annotations

from typing import Dict, List, Optional, Union

POSTCODES: Dict[int, Dict[str, str]] = {
Expand Down
Empty file added tests/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion tests/test_iceaddr.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
iceaddr: Look up information about Icelandic streets, addresses,
placenames, landmarks, locations and postcodes.
Copyright (c) 2018-2023 Sveinbjorn Thordarson.
Copyright (c) 2018-2024 Sveinbjorn Thordarson.
Tests for iceaddr python package.
Expand Down

0 comments on commit 32b5af2

Please sign in to comment.