Skip to content

Commit

Permalink
v6.5.0 with data 2024a (#223)
Browse files Browse the repository at this point in the history
* Update CHANGELOG.rst

* update binaries 2024a

* Update current_data_statistics.txt

* Update pyproject.toml

* use ruff linter

* Update CHANGELOG.rst

* Update Makefile

* update dev dependencies

* make numba dependency spec less strict

* bugfix numba installed test

* Update Makefile

* Update CHANGELOG.rst

* less strict dep specs
  • Loading branch information
jannikmi authored Mar 14, 2024
1 parent f388b50 commit 91c6db3
Show file tree
Hide file tree
Showing 33 changed files with 690 additions and 866 deletions.
47 changes: 11 additions & 36 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,39 +17,20 @@ repos:
- id: requirements-txt-fixer
- id: detect-private-key

- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: isort
args: [ "--profile", "black", "--filter-files" ]

- repo: https://github.com/psf/black
rev: 24.1.1
hooks:
- id: black
language_version: python3
args:
- --line-length=120
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.2
hooks:
# linter.
- id: ruff
args: [ --fix ]
- id: ruff-format

- repo: https://github.com/asottile/blacken-docs
rev: 1.16.0
hooks:
- id: blacken-docs

- repo: https://github.com/pycqa/flake8
rev: 7.0.0
hooks:
- id: flake8
exclude: ^(docs|scripts|tests)/|build.py
args:
- --ignore=E402 # E402 module level import not at top of file
- --max-line-length=120

additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-tidy-imports

# TODO also check docs/. make compatible with sphinx
- repo: https://github.com/myint/rstcheck
rev: 'v6.2.0'
Expand All @@ -63,22 +44,16 @@ repos:
- id: validate-pyproject

- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.1
hooks:
- id: pyupgrade

# # TODO very detailed linting:
# - repo: https://github.com/pycqa/pylint
# rev: v2.13.8
# hooks:
# - id: pylint

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
exclude: ^((tests|scripts)/)
#

# - repo: https://github.com/mgedmin/check-manifest
# rev: "0.48"
# hooks:
Expand All @@ -87,6 +62,6 @@ repos:
# additional_dependencies: [ numpy, poetry==1.1.11 ]

- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v17.0.6
rev: v18.1.1
hooks:
- id: clang-format
11 changes: 11 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@
Changelog
=========

6.5.0 (2024-03-14)
------------------

* updated the data to `2024a <https://github.com/evansiroky/timezone-boundary-builder/releases/tag/2023a>`__.

internal:

* use ruff linter in pre-commit hook
* make dependency specifications less strict


6.4.1 (2024-02-08)
------------------

Expand Down
19 changes: 16 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ install:
@echo "installing all specified dependencies..."
@#poetry install --no-dev
# NOTE: root package needs to be installed for CLI tests to work!
@poetry install --all-extras --sync
@poetry install --all-extras --sync --no-root

update:
@echo "updating and pinning the dependencies specified in 'pyproject.toml':"
Expand All @@ -19,9 +19,22 @@ lock:
@echo "locking the dependencies specified in 'pyproject.toml':"
@poetry lock


# when poetry dependency resolving gets stuck:
force_update:
@echo "force updating the requirements. removing lock file"
poetry cache clear --all .
rm poetry.lock
@echo "pinning the dependencies specified in 'pyproject.toml':"
poetry update -vvv

outdated:
poetry show --outdated


env:
# conda env remove -n timezonefinder
source $(CONDAROOT)/bin/activate && conda create -n timezonefinder python=3.7 poetry -y
source $(CONDAROOT)/bin/activate && conda create -n timezonefinder python=3.8 poetry -y
# && conda activate timezonefinder
# && make req

Expand All @@ -45,7 +58,7 @@ hook:
@pre-commit install
@pre-commit run --all-files

hook2:
hookup:
@pre-commit autoupdate

hook3:
Expand Down
16 changes: 11 additions & 5 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
""" optionally builds inside polygon algorithm C extension
"""optionally builds inside polygon algorithm C extension
Resources:
https://github.com/FirefoxMetzger/mini-extension
Expand All @@ -25,7 +25,9 @@
try:
ffibuilder = cffi.FFI()
except Exception as exc:
warnings.warn(f"C lang extension cannot be build, since cffi failed with this error: {exc}")
warnings.warn(
f"C lang extension cannot be build, since cffi failed with this error: {exc}"
)
# Clang extension should be fully optional
ffibuilder = None

Expand All @@ -50,15 +52,17 @@

def build_c_extension():
if ffibuilder is None:
warnings.warn(f"missing ffibuilder. skipping build process")
warnings.warn("missing ffibuilder. skipping build process")
return

# not required
# ffibuilder.compile(verbose=True)

# Note: built into "timezonefinder" package folder
distribution = setuptools.Distribution({"package_dir": {"": "timezonefinder"}})
cffi.setuptools_ext.cffi_modules(distribution, "cffi_modules", ["build.py:ffibuilder"])
cffi.setuptools_ext.cffi_modules(
distribution, "cffi_modules", ["build.py:ffibuilder"]
)
cmd = distribution.cmdclass["build_ext"](distribution)
cmd.inplace = 1
cmd.ensure_finalized()
Expand All @@ -68,7 +72,9 @@ def build_c_extension():
# distutils.errors.CompileError:
# a build failure in the extension (e.g. C compile is not installed) must not abort the build process,
# but instead simply not install the failing extension.
warnings.warn(f"C lang extension cannot be build, since cmd.run() failed with this error: {exc}")
warnings.warn(
f"C lang extension cannot be build, since cmd.run() failed with this error: {exc}"
)


if __name__ == "__main__":
Expand Down
56 changes: 31 additions & 25 deletions current_data_statistics.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
... parsing done. found:
1,375 polygons from
1,317 polygons from
444 timezones with
719 holes
156,382 maximal amount of coordinates in one polygon
21,551 maximal amount of coordinates in a hole polygon
14,482,734 floats in all the polygons (2 per point)
730 holes
156,451 maximal amount of coordinates in one polygon
21,582 maximal amount of coordinates in a hole polygon
14,590,342 floats in all the polygons (2 per point)


shortcut statistics:

Expand All @@ -13,18 +14,18 @@ highest amount in one shortcut is 59
0.0 % of all shortcuts are empty
frequencies of entry amounts:
0: 0
1: 30667
2: 8768
3: 1412
4: 228
5: 45
6: 17
1: 30668
2: 8771
3: 1408
4: 229
5: 46
6: 15
7: 9
8: 5
9: 4
9: 5
10: 1
11: 0
12: 0
12: 1
13: 0
14: 0
15: 0
Expand All @@ -43,7 +44,7 @@ frequencies of entry amounts:
28: 0
29: 0
30: 0
31: 1
31: 0
32: 1
33: 0
34: 0
Expand All @@ -55,10 +56,10 @@ frequencies of entry amounts:
40: 0
41: 0
42: 0
43: 2
43: 0
44: 0
45: 0
46: 0
46: 1
47: 0
48: 0
49: 0
Expand All @@ -73,20 +74,20 @@ frequencies of entry amounts:
58: 0
59: 1
relative accumulated frequencies [%]:
[0.0, 74.5, 95.8, 99.23, 99.79, 99.9, 99.94, 99.96, 99.97, 99.98, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
[0.0, 74.51, 95.81, 99.23, 99.79, 99.9, 99.94, 99.96, 99.97, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 99.99, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
missing relative accumulated frequencies [%]:
[100.0, 25.5, 4.2, 0.77, 0.21, 0.1, 0.06, 0.04, 0.03, 0.02, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
[100.0, 25.49, 4.19, 0.77, 0.21, 0.1, 0.06, 0.04, 0.03, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
--------------------------------

amount of different timezones per shortcut
highest amount in one shortcut is 25
0.0 % of all shortcuts are empty
frequencies of entry amounts:
0: 0
1: 30674
2: 9010
3: 1302
4: 154
1: 30675
2: 9015
3: 1297
4: 153
5: 17
6: 3
7: 1
Expand All @@ -109,12 +110,17 @@ frequencies of entry amounts:
24: 0
25: 1
relative accumulated frequencies [%]:
[0.0, 74.52, 96.41, 99.57, 99.95, 99.99, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
[0.0, 74.52, 96.42, 99.57, 99.95, 99.99, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0, 100.0]
missing relative accumulated frequencies [%]:
[100.0, 25.48, 3.59, 0.43, 0.05, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
[100.0, 25.48, 3.58, 0.43, 0.05, 0.01, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
--------------------------------

validating shortcut mapping
validating shortcut completeness...
validating polygon 1316
function validate_shortcut_mapping(...) executed in 20.3s

function compile_shortcut_mapping(...) executed in 2579.0s
the polygon data makes up 95.67% of the data
the shortcuts make up 0.97% of the data
the shortcuts make up 0.96% of the data
holes make up 3.37% of the data
3 changes: 2 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
# This ensures that the source package is importable
sys.path.insert(0, os.path.join(project_root))

import timezonefinder # needed for auto document, ATTENTION: must then be installed during online build!
# needed for auto document, ATTENTION: must then be installed during online build!
import timezonefinder # noqa: E402 Module level import not at top of file

print(timezonefinder)

Expand Down
Loading

0 comments on commit 91c6db3

Please sign in to comment.