Skip to content

Releases: timwie/aio-overpass

v0.14.1

10 Aug 02:06
Compare
Choose a tag to compare

Fixed

  • Fix an AssertionError in Client.run_query() that could happen when asyncio's monotonic clock returned the same time twice

v0.14.0

21 Jul 21:34
Compare
Choose a tag to compare

Added

  • Add the Element.base_geometry(_details) properties to allow properly typed access
    to an element's geometry when the exact type is unknown
  • Add the center property to Way and Relation
  • Add the bounds property to Way and Relation
  • Add the QueryRejectError.timed_out_after_secs property
  • Add the QueryRejectError.oom_using_mib property
  • Add the GiveupCause class that gives more context to GiveupErrors
  • Add the GiveupError.cause property
  • Add the DefaultQueryRunner.cache_delete() function, which was internal before

Changed

  • Breaking: Move GeoJsonDict type from element to new spatial module
  • Breaking: Move SpatialDict class from element to new spatial module
  • Breaking: Move Spatial class from element to new spatial module
  • Change numpy version requirement for Python <3.12 to >=1.23,<3 (from ^1.23)
  • All tag values are strings, but were previously typed as Any:
    • Change the type of Element.tags to dict[str, str] | None, from dict[str, Any] | None
    • Change the return type of Element.tag() to str | None, from Any
    • Change the type of Route.tags to dict[str, str], from dict[str, Any]
    • Change the return type of Route.tag() to str | None, from Any

Removed

  • Breaking: Remove export of no longer used OverpassDict type alias
  • Breaking: Remove the geometry property from the Element base class due to typing violation
  • Breaking: Remove the bounds property from the Element base class
  • Breaking: Remove the center property from the Element base class

Fixed

  • Fix Query.reset() removing the selected logger
  • Fix a possible IndexError in OrderedRouteView.paths
  • Fix a bug in to_ordered_routes() that would omit the last node of the path between two stops,
    and raise an AssertionError

v0.13.1

29 Apr 23:11
Compare
Choose a tag to compare

Changed

  • Change numpy version requirement ahead of new major release to >=1.26,<3 (from ^1.26)
  • Slight change to string representation of finished queries
  • Add sections of the README into the actual documentation

v0.13.0

10 Apr 23:29
Compare
Choose a tag to compare

Changed

  • Relax aiohttp version requirement to ^3.9 (from ~3.9)
  • Relax joblib version requirement to ^1.3 (from ~1.3)
  • Relax shapely version requirement to ^2 (from ~2.0)
  • raise_on_failure is now a keyword-only argument in Client.run_query()
  • The string representation of a query without kwargs is now "query{}" instead of "query <no kwargs>"
  • Log a message when a query is done
  • Log the error more explicitly when a try fails
  • Debug logging when matching Overpass error messages

v0.12.1

30 Jan 19:33
Compare
Choose a tag to compare

Fixed

  • Client.run_query() now makes POST requests instead of GET to prevent 414 URI Too Long errors for large queries

v0.12.0

07 Dec 19:28
Compare
Choose a tag to compare

Added

  • Add convenience type guard functions to the error module (is_too_busy() etc.)
  • Add status_timeout_secs parameter to Client, which limits the duration of
    all status requests
  • Add timeout_secs parameter to Client.cancel_queries()
  • Add ResponseErrorCause type alias

Changed

  • Change Client.run_query() to no longer enforce a rate limit before making a request.
    This is because we cannot easily know the total amount of slots at an API server
    that uses load balancing, as the default server does.
    Previously this would lead to using a maximum of 6 slots instead of the actual 12 slots.
    The new behavior is to simply adhere to the cooldown duration when the server tells us
    we're making too many requests
  • The [timeout:*] setting is overwritten if run_timeout_secs is set, and the remaining
    time is lower than the current setting. Previously, we would use a query timeout that is
    higher than the request timeout.
  • In case that we lower the [timeout:*] this way, and previously had a try with equal
    or higher query timeout fail with EXCEEDED_TIMEOUT, we give up trying immediately.
  • The request in Client.cancel_queries() is no longer subject to the concurrency limit
  • Shorten Query.cache_key to 16 characters instead of 64
  • Increase aiohttp requirement to ~3.9

Removed

  • Remove the Status.concurrency property, since the reported number of slots
    no longer affects the concurrency
  • Remove the Query.code property, which has no real use when there is Query.input_code

Fixed

  • Fix run_timeout_secs having no effect on query request timeouts

v0.11.0

14 Nov 18:47
Compare
Choose a tag to compare

Added

  • Add the should_retry property to all error classes,
    which is used by the default query runner to decide whether to retry or not
  • Add the ResponseError.is_server_error property
  • Add the SpatialDict class, which has the __geo_interface__ property
    • Compared to the old Spatial.__geo_interface__, this property does not
      contain FeatureCollections, which is not specified by the protocol
  • Add Spatial.geo_interfaces to map objects to SpatialDicts

Changed

  • Increased aiohttp requirement to ~3.9.0rc0
  • ResponseError is reverted to include server-side errors,
    replacing ServerError
  • Retry all ResponseErrors by default
  • In the default runner, only log response bodies of ResponseErrors
    when is_server_error is false
  • GeoJSON "bbox" will use Element.bounds if geometry is not set
  • Add py.typed to make the package PEP 561 compatible

Removed

  • Remove ServerError, which reverts the last release's decision
    to split these error cases off ResponseError
  • Remove Spatial.__geo_interface__

v0.10.0

03 Nov 23:13
Compare
Choose a tag to compare

Added

  • Add ServerError, which is similar to ResponseError, but for
    responses with status code >= 500. The crucial difference is
    that it will be retried by default

Changed

  • Replaced all fields in ResponseError:
    • Remove request_info, history, status, message, and headers
    • Add response, body, and cause
  • The default query runner will log ResponseError.body if such an error occurs
  • logger argument of Query can no longer be None,
    and defaults to a logger that does nothing
  • Change networkx requirement from >=2.7 to ^3
  • There is now an explicit numpy requirement when enabling the shapely extra:
    ^1.26 for Python 3.12 and above, and ^1.23 for Python 3.11 and below

v0.9.0

20 Oct 01:44
Compare
Choose a tag to compare

The Python versions supported by this release are 3.10-3.12.

Added

  • Add Python 3.12 support
  • Add __slots__ to a lot of classes
  • Add pt_ordered.to_ordered_routes() and to_ordered_route()
  • Add GeometryDetails, which provides information on whether an
    element's geometry is "valid"
  • Add Way.geometry_details and Relation.geometry_details
  • Add Status.endpoint
  • Add Status.nb_running_queries

Changed

  • Increased aiohttp requirement to ~3.9.0b0
  • Enable speedups extra of aiohttp
  • Make QueryRunner an abstract class, not a protocol
  • Way.geometry and Relation.geometry may now be geometries fixed
    by shapely instead of the original geometries by the Overpass API.
    To access the original geometry, use Way.geometry_details and
    Relation.geometry_details
  • DefaultQueryRunner no longer blocks the event loop while reading
    from or writing to a cache file
  • Add raise_on_failure argument to Client.run_query(), which can be
    disabled to not raise Query.error if a query fails

Removed

  • Drop Python 3.9 support
  • collect_elements() already no longer worked for "area" elements with the previous
    release, but its documentation did not reflect that change

Fixed

  • Fix an error when RequestTimeout.total_without_query_secs was set to None
  • Fix an edge case that would lead to an error if Query.run_timeout_secs
    was None when a query cooldown occurred
  • Fix an edge case where DefaultQueryRunner would raise an exception
    if a cache file could not be read
  • Fix collect_ordered_routes() breaking when a stop position is missing
  • Fix collect_elements() raising when the result set is empty
  • Fix collect_elements() breaking when the result set included "area" elements

v0.8.0

07 Oct 14:57
Compare
Choose a tag to compare

Added

  • Add the Element.geometry property

Changed

  • Ways may now also have Polygon geometries
  • Relation may now have Polygon or MultiPolygon geometries

Removed

  • Remove AreaWay and AreaRelation
    • These subclasses could be confusing since "area" is also specific Overpass terminology
    • There is no good reason to have these subclasses since their only difference
      is easily modelled through the geometry property