- added support for numpy>=2.0 (fixes issue #234)
- added support for cibuildwheel: publish wheels including the native C extension. GHA CI/CD pipeline creates sdist (no binaries inside) and a bunch of binary wheels with a prebuilt clang-pip extension for each python version. Thanks to @theirix
- updated the data to 2024a.
internal:
- use ruff linter in pre-commit hook
- make dependency specifications less strict
- added official support for python 3.8 again, by specifying numba as multiple constraint dependency
internal:
- added unit tests for polygon boundary binary reading
- added python 3.12 support (supported by numba since release 0.59.0), Closes #208
- dropped official support for python 3.8, because the optional dependency numba requires python 3.9. this package might still work with python 3.8, but it is not tested anymore.
- updated the data to 2023d.
internal:
- added docstrings. Thanks to Tyler Huntley
- automatically skip GitHub actions publishing when the version already exists. useful for minor improvements without publishing a version. build would always fail otherwise
- enable tests for python 3.11 with numba
- enable tests for python 3.12
- added tests for generating the documentation
- use poetry dependency group specification (closing #199)
- updated the data to 2023b.
- added a pytz extra for easily maintaining compatibility
- improved documentation
- updated the data to 2022g.
- pumped
h3
dependency to>=3.7.6,<4
to support python 3.11 (FIX #170) - added python 3.11 tests (not yet supporting numba)
- updated the data to 2022f.
- pinning dependencies more strictly
- updated the data to 2022d.
- updated the data to 2022b.
- logging build failures with warnings
- more permissive optional
Numba
dependency specification (FIX #162, impossible using latest numpy version) - made all dependency specifications more permissive following the same rationale
- bugfix broken package build in the case of a broken
cffi
installation (GitHub issue #155). Skip build process ifcffi
fails. For performance reasons using the C extension should remain the default behavior. Hence thecffi
dependency should not be optional.
- bugfix potentially broken pip install due to a mismatch in
cffi
versions (GitHub issue #151)
internals:
- minimized and cleaned up installation footprint (addresses GitHub Issue #151):
- excluded script, changelog etc. files
- included C extension into the "timezonefinder" package folder
- added initialisation speed benchmark
- included point-in-polygon implementation in C
- included build script to (optionally) build C point-in-polygon extension automatically during installation
- added
cffi
as a dependency to build and interact with the C extension - improved initialisation speed: read timezone polygon id index (h3 mapping) with
np.fromfile
- improved CLI speed: construct TimezoneFinder() instances only on demand
internals:
- updated documentation:
Numba
installation is no longer recommended (it is a huge dependency and should be optional) - clarified documentation: TimezoneFinder() instances should be reused
- added separate speed benchmark scripts for point in polygon algorithm implementations and the different timezone finding functions
- added separate section in the documentation for performance including speed benchmark results
- added checks if all timezone polygons are actually in use (appear in index) to the file conversion script
- added and improved utility functions as well as tests
- improved typing
- bump numpy dependency version to
1.22
(vulnerability fix) - officially supported python versions
>=3.8,<3.11
(due to numpy and numba constraints) - packaging now completely based on pyproject.toml (poetry)
- explicitly included
py.typed
in the package to allow mypy users to run static type checking
breaking changes:
- new dependency: using h3 for indexing the timezone polygons to check ("shortcuts) instead of the previous own indexing implementation. technical details: storing all 41,162 hex cells at resolution 3 and the corresponding timezone polygons which appear in them in the
shortcuts.bin
(~500 KB). - removed
.closest_timezone_at()
: with the current data set with ocean zones in use, any point is included in some zone. it is therefore not meaningful to search for the closest boundary! Also the timezone polygons do NOT follow the shorelines. This makes the results ofclosest_timezone_at()
somewhat less expressive. Maintaining the non-trivial distance computation algorithms is not really at the core responsibility of this package. - officially only supporting
python>=3.7
(removed official support forpython3.6
, since thenumpy
dependency did so) - removed
v
from the github release/version tags
internals:
- updated the data to 2021c. please note that timezone polygons might be overlapping (cf. e.g. timezone-boundary-builder/issue/105) and that hence a query coordinate can actually match multiple time zones.
timezonefinder
does currently NOT support such multiplicity and will always only return the first found match. - shortcuts: sorting according to size of polygons (amount of coordinates) instead of the count of zone ids. useful as optimisation: smaller polygons will be checked first and can hence be "ruled-out" faster
- "most common": now meaning the zone with the largest polygons in the shortcut (last in the shortcut sorting). please note that this does not necessarily mean the most area in the shortcut is covered by this zone. the polygon size is just an easier to compute heuristic.
- officially supporting python versions >=3.7,<3.11 (like
numba
) - using poetry for dependency management
- using GitHub actions for CI instead of travis
- some minor typing improvements
- pre-commit hook improvements
In case you have criticism or feedback please reach out by creating an issue, discussion or PR on GitHub.
- added function
unique_timezone_at()
(based on the request in issue #112). Allows querying for the unique zone within the corresponding shortcut.
- BUGFIX: get_geometry() now also works for the last zone
- add get_geometry() tests
- black code style
- pre-commit checks
- update the command line interface. the package can now directly be called with
timezonefinder
- added the new query functions to the command line interface (to match the online API)
MAJOR CHANGES:
Due to multiple user requests the ocean timezones ("Etc/GMT+-XX") are now included in the data files per default. fix #88. Since ocean timezones span the whole globe, now every point lies within a timezone!
API changes:
* added timezone_at_land()
: replaces the previous timezone_at()
and returns None
in case of a matched ocean timezone.
- deprecated
certain_timezone_at()
. only meaningful in the case of timezone data WITHOUT oceans. Has equal results astimezone_at()
, but is more expensive to use. - also looking a single closest timezone boundary with
closest_timezone_at()
is not really meaningful, since every point lies within a zone! - refactored tests. new test cases for ocean timezones
BUGFIX: handle output destination for data files correctly in file_converter.py (FIX #107)
- updated the data to 2020d
- disable a test case for an Uzbek enclave. tests fail at this coordinate, possibly a bug. issue filed here: evansiroky/timezone-boundary-builder#94
- update parse_data.sh script to properly handle new data format
BUGFIX: a longitude of 180 equals -180 (not 0.0 as previously implemented)
- added new class TimezonefinderL for using JUST shortcuts (without timezone polygon data)
- therefore included the most common timezone of each shortcut stored in the binary file
shortcuts_direct_id.bin
- introduced typing
- included API documentation
- read hole registry directly from json,
hole_poly_ids.bin
not required any more - added the
parse_data.sh
shell script for downloading the latest timezone data, also with oceans
improvements of file_converter.py:
- added command line arguments for specifying the input and output directories
- read binary names from
global_settings.py
- read data types from
global_settings.py
- use with statement for writing binaries
- automatically detect overflow for each data type in use
- cleanup code, remove redundancies, improve codestyle
- fixing #101: make imports work for local and remote execution
- BUGFIX #99: include the correct timezone_names.json in build
- wheel specific for the supported python versions (3.6, 3.7, 3.8)
- updated the data to 2020a
- added "extra" simplifying the installation of Numba
- added minimal required python version
- added minimal required version of the dependencies
- simplified and updated settings (e.g. reading current version from file)
- also testing python 3.8 now
- loading version from file
- added option to specify the location of the binary data files to use. making it possible to easily point to own compiled data. also load timezone names json from this location
- make timezone names a class attribute (instead of a global variable)
- simplify code for opening and closing multiple binary files
- added tests for a specified path to the data
- testing multiple python3 versions automatically
- pinned new requirements
- importlib_resources removed from the dependencies
- added a documentation at: https://timezonefinder.readthedocs.io/en/latest/
- added contribution guidelines
- updated the data to 2019b
- added description of using vectorized input in readme
- clarification of readme: referenced latest timezonefinderL release, better rst headlines, updated shield.io banner syntax
- clarification of speedup times (exponential notation)
- removed six and py2 dependency from tests
- minor updates to publishing routine
- minor improvement in timezone_at(): conversion coordinates to int later only when required
- updated the data to 2019a
- BUGFIX: fixing #77 (missing dependency in setup.py)
- ATTENTION: Dropped Python2 support (#72)! six dependency no longer required.
- BUGFIX: fixing #74 (broken py3 with numba support)
- added in_memory-mode (adapted unit tests to test both modes, added speed tests and explanation to readme)
- use of timeit in speed tests for more accurate results
- dropped use of kwargs_only decorator (can be implemented directly with python3)
- BUGFIX: fixing #70 (broken py2.7 with numba support)
- added automatic tox tests for py2.7 py3 environments with numba installed
- fixed coverage report
- added test cases for the Numba helpers (#55)
- added more polygon tests to test the function inside_polygon()
- added global data type definitions (format strings) to
global_settings.py
- removed tzwhere completely from the main tests (no comparison any more).
- removed code drafts for ahead of time compilation (#40)
- updated the data to 2018i
- introduced
global_settings.py
to globally define settings and get rid of "magic numbers".
- updated the data to 2018g
- ATTENTION: the package
importlib_resources
is now required - fixing automatic Conda build by exchanging
pkg_resources.resource_stream
withimportlib_resources.open_binary
- added tests for overflow in helpers.py/inside_polygon()
- ATTENTION: the package kwargs_only is not a requirement any more!
- fixing #63 (kwargs_only not in conda) enabling automatic conda forge builds by directly providing the kwargs_only functionality again
- added example.py with the code examples from the readme
- fixing #62 (overflow happening because of using numpy.int32): forcing int64 type conversion
- fixing typo in requirements.txt
- updated publishing routine: reminder to include all direct dependencies and to compile the requirements.txt with python 2 (pip-tools)
- ATTENTION: the package kwargs_only is now required! This functionality has previously been implemented by the author directly within this package, but some code features got deprecated.
- updated build/testing/publishing routine
- fixing issue #61 (six dependency not listed in setup.py)
- no more default arguments for timezone_at() and certain_timezone_at()
- no more comparison to (py-)tzwhere in the tests (test_it.py)
- updated requirements.txt (removed tzwhere and dependencies)
- prepared helpers_test.py for also testing helpers_numba.py
- exchanged deprecated inspect.getargspec() into .getfullargspec() in functional.py
- fixing minor issue #58 (readme not rendering in pyPI)
- ATTENTION: the package six is now required! (was necessary because of the new testing routine. improves compatibility standards)
- updated build/testing/publishing routine
- updated the data to 2018d
- fixing minor issue #52 (shortcuts being out of bounds for extreme coordinate values)
- the list of polygon ids in each shortcut is sorted after freq. of appearance of their zone id.
- this is critical for ruling out zones faster (as soon as just polygons of one zone are left this zone can be returned)
- using argparse package now for parsing the command line arguments
- added option of choosing between functions timezone_at() and certain_timezone_at() on the command line with flag -f
- the timezone names are now being stored in a readable JSON file
- adjusted the main test cases
- corrections and clarifications in the readme and code comments
- bugfix: possibly uninitialized variable in closest_timezone_at()
- updated the data to 2017c
- minor improvements in code style and readme
- include publishing routine script
- updated the data to 2017a (tz_world is not being maintained any more)
- the file_converter has been updated to parse the new format of .json files
- the new data is much bigger (based on OSM Data, +40MB). I am sorry for this but its still better than small outdated data!
- in case size and speed matter more you than actuality, you can still check out older versions of timezonefinder(L)
- the new timezone polygons are not limited to the coastlines, but they are including some large parts of the sea. This makes the results of closest_timezone_at() somewhat meaningless (as with timezonefinderL).
- the polygons can not be simplified much more and as a consequence timezonefinderL is not being updated any more.
- simplification functions (used for compiling the data for timezonefinderL) have been deleted from the file_converter
- the readme has been updated to inform about this major change
- some tests have been temporarily disabled (with tzwhere still using a very old version of tz_world, a comparison does not make too much sense atm)
- added missing package data entries (2.0.0 didn't include all necessary .bin files)
- ATTENTION: major change!: there is a second version of timezonefinder now: timezonefinderL. There the data has been simplified
- for increasing speed reducing data size. Around 56% of the coordinates of the timezone polygons have been deleted there. Around 60% of the polygons (mostly small islands) have been included in the simplified polygons. For any coordinate on landmass the results should stay the same, but accuracy at the shorelines is lost. This eradicates the usefulness of closest_timezone_at() and certain_timezone_at() but the main use case for this package (= determining the timezone of a point on landmass) is improved. In this repo timezonefinder will still be maintained with the detailed (unsimplified) data.
- file_converter.py has been complemented and modified to perform those simplifications
- introduction of new function get_geometry() for querying timezones for their geometric shape
- added shortcuts_unique_id.bin for instantly returning an id if the shortcut corresponding to the coords only contains polygons of one zone
- data is now stored in separate binaries for ease of debugging and readability
- polygons are stored sorted after their timezone id and size
- timezonefinder can now be called directly as a script (experimental with reduced functionality, cf. readme)
- optimisations on point in polygon algorithm
- small simplifications in the helper functions
- clarification of the readme
- clarification of the comments in the code
- referenced the new conda-feedstock in the readme
- referenced the new timezonefinder API/GUI
- ATTENTION: API BREAK: all functions are now keyword-args only (to prevent lng lat mix-up errors)
- fixed a little bug with too many arguments in a @jit function
- clarified usage of the package in the readme
- prepared the usage of the ahead of time compilation functionality of Numba. It is not enabled yet.
- sorting the order of polygons to check in the order of how often their zones appear, gives a speed bonus (for closest_timezone_at)
- using little endian encoding now
- introduced test for checking the proper functionality of the helper functions
- wrote tests for proximity algorithms
- improved proximity algorithms: introduced exact_computation, return_distances and force_evaluation functionality (s. Readme or documentation for more info)
- using the newest version (2016d, May 2016) of the tz world data
- holes in the polygons which are stored in the tz_world data are now correctly stored and handled
- rewrote the file_converter for storing the holes at the end of the timezone_data.bin
- added specific test cases for hole handling
- made some optimizations in the algorithms
- using the newest version (2016b) of the tz world data
- rewrote the file_converter for parsing a .json created from the tz_worlds .shp
- had to temporarily fix one polygon manually which had the invalid TZID: 'America/Monterey' (should be 'America/Monterrey')
- had to make tests less strict because tzwhere still used the old data at the time and some results were simply different now
- using 32-bit ints for storing the polygons now (instead of 64-bit): I calculated that the minimum accuracy (at the equator) is 1cm with the encoding being used. Tests passed.
- Benefits: 18MB file instead of 35MB, another 10-30% speed boost (depending on your hardware)
- added python 2.7.6 support: replaced strings in unpack (unsupported by python 2.7.6 or earlier) with byte strings
- timezone names are now loaded from a separate file for better modularity
- added python 2.7.8+ support:
- Therefore I had to change the tests a little bit (some operations were not supported). This only affects output. I also had to replace one part of the algorithms to prevent overflow in Python 2.7
- automatically using optimized algorithms now (when numba is installed)
- added TimezoneFinder.using_numba() function to check if the import worked
- Added the
file_converter.py
to the repository: It converts the .csv from pytzwhere to another.csv
and this one into the used.bin
. - Especially the shortcut computation and the boundary storage in there save a lot of reading and computation time, when deciding which timezone the coordinates are in. It will help to keep the package up to date, even when the timezone data should change in the future.
- Added the