diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e0387b..9740fba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,7 @@ - start and end timestamp meta information of the client are now datetime objects - accept shapely Polygon and MultiPolygon for `bpolys` input parameter - if a request fails a bash script containing the respective `curl` command is logged (if possible). This allows for easier debugging and sharing of failed requests. - - timestamps are converted without timezone information. Deviates from Ohsome API + - timestamps are converted without timezone information. Deviates from Ohsome API [(Issue #318)](https://github.com/GIScience/ohsome-api/issues/318) ### Removed diff --git a/README.md b/README.md index 43ce160..f9551f5 100644 --- a/README.md +++ b/README.md @@ -131,11 +131,11 @@ time = pandas.date_range("2018-01-01", periods=3, freq="M") ## Contribution Guidelines -The easiest way to contribute is to file a comprehensive [issue](https://github.com/GIScience/ohsome-py/issues) with a reproducible example. Pull requests are always welcome, so if you want to contribute to this project, please fork the repository or create a new branch containing your changes. Follow the steps below to make sure that your contributed code follows the code style and does not break any functionality. Create a **pull request to the main/master** branch once it is ready to be merged. +The easiest way to contribute is to file a comprehensive [issue](https://github.com/GIScience/ohsome-py/issues) with a reproducible example. Pull requests are always welcome, so if you want to contribute to this project, please fork the repository or create a new branch containing your changes. -### Install Package +This package uses [poetry](https://python-poetry.org/) for dependency management. -This package uses [poetry](https://python-poetry.org/) for dependency management. To install all packages necessary for testing and development run +### Install Package `poetry install` @@ -147,10 +147,12 @@ This package uses [poetry](https://python-poetry.org/) for dependency management ### Run Tests -**Before pushing your commits**, run the python unit tests +**Before pushing your commits**, run python tests `poetry run pytest` +Create a **pull request to the main/master** branch once it is ready to be merged. + #### VCR ohsome-py records responses using [VCR](https://vcrpy.readthedocs.io/en/latest/) via [pytest-recording](https://github.com/kiwicom/pytest-recording) to prevent unnecessary network traffic and computing during testing. If you implement a test or change an existing one, make sure to update the recorded cassettes. In addition, you should delete all cassettes after a certain time (e.g. every 6m or on each new ohsome release) and re-record them. To do that run diff --git a/ohsome/clients.py b/ohsome/clients.py index 995147a..7358324 100644 --- a/ohsome/clients.py +++ b/ohsome/clients.py @@ -740,28 +740,8 @@ def count(self): class _OhsomeClientContributionsAggregated(_OhsomePostClient): @property def density(self): - return _OhsomeClientContributionsAggregatedDensity( - self._base_api_url, self.log, self.log_dir, self._cache + ["density"] - ) - - @property - def groupByBoundary(self): - return _OhsomePostClient( - self._base_api_url, - self.log, - self.log_dir, - self._cache + ["groupBy", "boundary"], - ) - - -class _OhsomeClientContributionsAggregatedDensity(_OhsomePostClient): - @property - def groupByBoundary(self): return _OhsomePostClient( - self._base_api_url, - self.log, - self.log_dir, - self._cache + ["groupBy", "boundary"], + self._base_api_url, self.log, self.log_dir, self._cache + ["density"] ) @@ -786,12 +766,6 @@ def geometry(self): self._base_api_url, self.log, self.log_dir, self._cache + ["geometry"] ) - @property - def count(self): - return _OhsomeClientContributionsAggregated( - self._base_api_url, self.log, self.log_dir, self._cache + ["count"] - ) - class _OhsomeClientUsers(_OhsomeBaseClient): """Subclass of _OhsomePostClient to define endpoints of ohsome API""" diff --git a/ohsome/test/cassettes/test_client/test_check_time_parameter_datetime.yaml b/ohsome/test/cassettes/test_client/test_check_time_parameter_datetime.yaml index 86751af..6d54c8d 100644 --- a/ohsome/test/cassettes/test_client/test_check_time_parameter_datetime.yaml +++ b/ohsome/test/cassettes/test_client/test_check_time_parameter_datetime.yaml @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:04 GMT + - Wed, 29 Nov 2023 13:54:48 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_check_time_parameter_list.yaml b/ohsome/test/cassettes/test_client/test_check_time_parameter_list.yaml index bfb2f4c..8525244 100644 --- a/ohsome/test/cassettes/test_client/test_check_time_parameter_list.yaml +++ b/ohsome/test/cassettes/test_client/test_check_time_parameter_list.yaml @@ -44,7 +44,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:04 GMT + - Wed, 29 Nov 2023 13:54:48 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_end_timestamp_as_time_input.yaml b/ohsome/test/cassettes/test_client/test_end_timestamp_as_time_input.yaml index ef39cb8..c84f37e 100644 --- a/ohsome/test/cassettes/test_client/test_end_timestamp_as_time_input.yaml +++ b/ohsome/test/cassettes/test_client/test_end_timestamp_as_time_input.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: bcircles=0%3A8.678770065307615%2C49.414435400453954%2C100%7C1%3A8.697137832641602%2C49.41007968889129%2C150&time=2023-11-11T22%3A00%3A00&filter=amenity%3Drestaurant+and+type%3Away + body: bcircles=0%3A8.678770065307615%2C49.414435400453954%2C100%7C1%3A8.697137832641602%2C49.41007968889129%2C150&time=2023-11-25T13%3A00%3A00&filter=amenity%3Drestaurant+and+type%3Away headers: Accept: - '*/*' @@ -20,7 +20,7 @@ interactions: body: string: "{\n \"attribution\" : {\n \"url\" : \"https://ohsome.org/copyrights\",\n \ \"text\" : \"\xA9 OpenStreetMap contributors\"\n },\n \"apiVersion\" - : \"1.10.1\",\n \"result\" : [ {\n \"timestamp\" : \"2023-11-11T22:00:00Z\",\n + : \"1.10.1\",\n \"result\" : [ {\n \"timestamp\" : \"2023-11-25T13:00:00Z\",\n \ \"value\" : 0.0\n } ]\n}" headers: Access-Control-Allow-Credentials: @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:06 GMT + - Wed, 29 Nov 2023 13:54:48 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bboxes_dataframe.yaml b/ohsome/test/cassettes/test_client/test_format_bboxes_dataframe.yaml index 4702274..538ad3f 100644 --- a/ohsome/test/cassettes/test_client/test_format_bboxes_dataframe.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bboxes_dataframe.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:13 GMT + - Wed, 29 Nov 2023 13:54:53 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bboxes_list.yaml b/ohsome/test/cassettes/test_client/test_format_bboxes_list.yaml index cda57d1..ea02d0b 100644 --- a/ohsome/test/cassettes/test_client/test_format_bboxes_list.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bboxes_list.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:13 GMT + - Wed, 29 Nov 2023 13:54:53 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -99,7 +99,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:14 GMT + - Wed, 29 Nov 2023 13:54:53 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -156,7 +156,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:14 GMT + - Wed, 29 Nov 2023 13:54:55 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -213,7 +213,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:16 GMT + - Wed, 29 Nov 2023 13:54:55 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -270,7 +270,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:16 GMT + - Wed, 29 Nov 2023 13:54:55 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bcircles_dataframe.yaml b/ohsome/test/cassettes/test_client/test_format_bcircles_dataframe.yaml index e44fe91..e6d3721 100644 --- a/ohsome/test/cassettes/test_client/test_format_bcircles_dataframe.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bcircles_dataframe.yaml @@ -45,7 +45,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:06 GMT + - Wed, 29 Nov 2023 13:54:49 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bcircles_list.yaml b/ohsome/test/cassettes/test_client/test_format_bcircles_list.yaml index f48fd95..29e8819 100644 --- a/ohsome/test/cassettes/test_client/test_format_bcircles_list.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bcircles_list.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:08 GMT + - Wed, 29 Nov 2023 13:54:51 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -102,7 +102,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:08 GMT + - Wed, 29 Nov 2023 13:54:51 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -159,7 +159,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:09 GMT + - Wed, 29 Nov 2023 13:54:51 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -216,7 +216,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:09 GMT + - Wed, 29 Nov 2023 13:54:52 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bcircles_pandas.yaml b/ohsome/test/cassettes/test_client/test_format_bcircles_pandas.yaml index ba88e8b..80c3b1c 100644 --- a/ohsome/test/cassettes/test_client/test_format_bcircles_pandas.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bcircles_pandas.yaml @@ -51,7 +51,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:11 GMT + - Wed, 29 Nov 2023 13:54:52 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_format_bpolys.yaml b/ohsome/test/cassettes/test_client/test_format_bpolys.yaml index a1a74bb..1d62be3 100644 --- a/ohsome/test/cassettes/test_client/test_format_bpolys.yaml +++ b/ohsome/test/cassettes/test_client/test_format_bpolys.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:11 GMT + - Wed, 29 Nov 2023 13:54:52 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_post_with_endpoint_string.yaml b/ohsome/test/cassettes/test_client/test_post_with_endpoint_string.yaml index ba1c230..ccea8c5 100644 --- a/ohsome/test/cassettes/test_client/test_post_with_endpoint_string.yaml +++ b/ohsome/test/cassettes/test_client/test_post_with_endpoint_string.yaml @@ -50,7 +50,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:17 GMT + - Wed, 29 Nov 2023 13:54:56 GMT Keep-Alive: - timeout=5, max=100 Server: @@ -115,7 +115,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:17 GMT + - Wed, 29 Nov 2023 13:54:56 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_client/test_user_agent.yaml b/ohsome/test/cassettes/test_client/test_user_agent.yaml index 639317f..f6d09fd 100644 --- a/ohsome/test/cassettes/test_client/test_user_agent.yaml +++ b/ohsome/test/cassettes/test_client/test_user_agent.yaml @@ -20,8 +20,8 @@ interactions: : {\n \"type\" : \"Polygon\",\n \"coordinates\" : [ [ [ -180.0, -90.0 ], [ 180.0, -90.0 ], [ 180.0, 90.0 ], [ -180.0, 90.0 ], [ -180.0, -90.0 ] ] ]\n },\n \"temporalExtent\" : {\n \"fromTimestamp\" : \"2007-10-08T00:00:00Z\",\n - \ \"toTimestamp\" : \"2023-11-11T22:00Z\"\n },\n \"replicationSequenceNumber\" - : 97863\n }\n}" + \ \"toTimestamp\" : \"2023-11-25T13:00Z\"\n },\n \"replicationSequenceNumber\" + : 98190\n }\n}" headers: Access-Control-Allow-Credentials: - 'true' @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:03 GMT + - Wed, 29 Nov 2023 13:54:44 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_exceptions/test_disable_logging.yaml b/ohsome/test/cassettes/test_exceptions/test_disable_logging.yaml index 2c98cf0..7284a22 100644 --- a/ohsome/test/cassettes/test_exceptions/test_disable_logging.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_disable_logging.yaml @@ -18,7 +18,7 @@ interactions: uri: https://api.ohsome.org/v1/elements/geometry response: body: - string: "{\n \"timestamp\" : \"2023-11-17T15:37:19.579114653\",\n \"status\" + string: "{\n \"timestamp\" : \"2023-11-29T13:54:57.479125767\",\n \"status\" : 413,\n \"message\" : \"The given query is too large in respect to the given timeout. Please use a smaller region and/or coarser time period.\",\n \"requestUrl\" : \"https://api.ohsome.org/v1/elements/geometry\"\n}" @@ -44,7 +44,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:19 GMT + - Wed, 29 Nov 2023 13:54:56 GMT Server: - Apache Strict-Transport-Security: diff --git a/ohsome/test/cassettes/test_exceptions/test_exception_connection_reset.yaml b/ohsome/test/cassettes/test_exceptions/test_exception_connection_reset.yaml index 5d557c9..3ce90fe 100644 --- a/ohsome/test/cassettes/test_exceptions/test_exception_connection_reset.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_exception_connection_reset.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:26 GMT + - Wed, 29 Nov 2023 13:55:14 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_exceptions/test_exception_invalid_parameters.yaml b/ohsome/test/cassettes/test_exceptions/test_exception_invalid_parameters.yaml index e993adc..1df0927 100644 --- a/ohsome/test/cassettes/test_exceptions/test_exception_invalid_parameters.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_exception_invalid_parameters.yaml @@ -18,7 +18,7 @@ interactions: uri: https://api.ohsome.org/v1/elements/count/groupBy/tag response: body: - string: "{\n \"timestamp\" : \"2023-11-17T15:37:26.890336955\",\n \"status\" + string: "{\n \"timestamp\" : \"2023-11-29T13:55:14.60175905\",\n \"status\" : 400,\n \"message\" : \"You need to give one groupByKey parameter, if you want to use groupBy/tag.\",\n \"requestUrl\" : \"https://api.ohsome.org/v1/elements/count/groupBy/tag\"\n}" headers: @@ -41,7 +41,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:26 GMT + - Wed, 29 Nov 2023 13:55:14 GMT Server: - Apache Strict-Transport-Security: diff --git a/ohsome/test/cassettes/test_exceptions/test_invalid_url.yaml b/ohsome/test/cassettes/test_exceptions/test_invalid_url.yaml index 7881737..6b5fede 100644 --- a/ohsome/test/cassettes/test_exceptions/test_invalid_url.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_invalid_url.yaml @@ -38,7 +38,7 @@ interactions: Content-Type: - text/html Date: - - Fri, 17 Nov 2023 15:37:19 GMT + - Wed, 29 Nov 2023 13:54:57 GMT ETag: - '"25c-5c7180820e5fc"' Keep-Alive: diff --git a/ohsome/test/cassettes/test_exceptions/test_log_bpolys.yaml b/ohsome/test/cassettes/test_exceptions/test_log_bpolys.yaml index 36cbd89..ec243e6 100644 --- a/ohsome/test/cassettes/test_exceptions/test_log_bpolys.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_log_bpolys.yaml @@ -18,7 +18,7 @@ interactions: uri: https://api.ohsome.org/v1/elements/count response: body: - string: "{\n \"timestamp\" : \"2023-11-17T15:37:20.131942698\",\n \"status\" + string: "{\n \"timestamp\" : \"2023-11-29T13:54:57.656277775\",\n \"status\" : 413,\n \"message\" : \"The given query is too large in respect to the given timeout. Please use a smaller region and/or coarser time period.\",\n \"requestUrl\" : \"https://api.ohsome.org/v1/elements/count\"\n}" @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:20 GMT + - Wed, 29 Nov 2023 13:54:57 GMT Server: - Apache Strict-Transport-Security: diff --git a/ohsome/test/cassettes/test_exceptions/test_log_curl.yaml b/ohsome/test/cassettes/test_exceptions/test_log_curl.yaml index 270b745..1b1de46 100644 --- a/ohsome/test/cassettes/test_exceptions/test_log_curl.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_log_curl.yaml @@ -18,7 +18,7 @@ interactions: uri: https://api.ohsome.org/v1/elements/count response: body: - string: "{\n \"timestamp\" : \"2023-11-17T12:28:28.06766606\",\n \"status\" + string: "{\n \"timestamp\" : \"2023-11-29T13:54:57.759114624\",\n \"status\" : 413,\n \"message\" : \"The given query is too large in respect to the given timeout. Please use a smaller region and/or coarser time period.\",\n \"requestUrl\" : \"https://api.ohsome.org/v1/elements/count\"\n}" @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 12:28:27 GMT + - Wed, 29 Nov 2023 13:54:57 GMT Server: - Apache Strict-Transport-Security: diff --git a/ohsome/test/cassettes/test_exceptions/test_timeout_error.yaml b/ohsome/test/cassettes/test_exceptions/test_timeout_error.yaml index 163c2f9..f36d240 100644 --- a/ohsome/test/cassettes/test_exceptions/test_timeout_error.yaml +++ b/ohsome/test/cassettes/test_exceptions/test_timeout_error.yaml @@ -18,7 +18,7 @@ interactions: uri: https://api.ohsome.org/v1/elements/geometry response: body: - string: "{\n \"timestamp\" : \"2023-11-17T15:37:19.028799445\",\n \"status\" + string: "{\n \"timestamp\" : \"2023-11-29T13:54:57.300350483\",\n \"status\" : 413,\n \"message\" : \"The given query is too large in respect to the given timeout. Please use a smaller region and/or coarser time period.\",\n \"requestUrl\" : \"https://api.ohsome.org/v1/elements/geometry\"\n}" @@ -44,7 +44,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:19 GMT + - Wed, 29 Nov 2023 13:54:56 GMT Server: - Apache Strict-Transport-Security: diff --git a/ohsome/test/cassettes/test_response/test_contributions_centroid.yaml b/ohsome/test/cassettes/test_response/test_contributions_centroid.yaml index 851930f..1124c3f 100644 --- a/ohsome/test/cassettes/test_response/test_contributions_centroid.yaml +++ b/ohsome/test/cassettes/test_response/test_contributions_centroid.yaml @@ -46,7 +46,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:41 GMT + - Wed, 29 Nov 2023 13:55:21 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_contributions_latest.yaml b/ohsome/test/cassettes/test_response/test_contributions_latest.yaml index fed5680..081d514 100644 --- a/ohsome/test/cassettes/test_response/test_contributions_latest.yaml +++ b/ohsome/test/cassettes/test_response/test_contributions_latest.yaml @@ -50,7 +50,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:41 GMT + - Wed, 29 Nov 2023 13:55:23 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elementsFullHistory_geometry.yaml b/ohsome/test/cassettes/test_response/test_elementsFullHistory_geometry.yaml index 9794e29..a5e5687 100644 --- a/ohsome/test/cassettes/test_response/test_elementsFullHistory_geometry.yaml +++ b/ohsome/test/cassettes/test_response/test_elementsFullHistory_geometry.yaml @@ -50,7 +50,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:39 GMT + - Wed, 29 Nov 2023 13:55:21 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count.yaml b/ohsome/test/cassettes/test_response/test_elements_count.yaml index f26a8e6..e3dfede 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:28 GMT + - Wed, 29 Nov 2023 13:55:14 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary.yaml b/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary.yaml index cf9a080..d695c6b 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary.yaml @@ -45,7 +45,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:35 GMT + - Wed, 29 Nov 2023 13:55:18 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary_groupby_tag.yaml b/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary_groupby_tag.yaml index de57016..23a8f53 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary_groupby_tag.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_groupby_boundary_groupby_tag.yaml @@ -45,7 +45,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:35 GMT + - Wed, 29 Nov 2023 13:55:18 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_groupby_key.yaml b/ohsome/test/cassettes/test_response/test_elements_count_groupby_key.yaml index 463059d..b62f712 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_groupby_key.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_groupby_key.yaml @@ -50,7 +50,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:30 GMT + - Wed, 29 Nov 2023 13:55:16 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_groupby_tag.yaml b/ohsome/test/cassettes/test_response/test_elements_count_groupby_tag.yaml index 2bb7b0e..0b5ca59 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_groupby_tag.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_groupby_tag.yaml @@ -74,12 +74,12 @@ interactions: : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=doctors\",\n \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 3.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" - : 3.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=fountain\",\n \"result\" - : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : - 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" - : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=parking_entrance\",\n + : 3.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=parking_entrance\",\n \ \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" + : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=fountain\",\n \"result\" + : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : + 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=public_building\",\n \ \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" @@ -128,7 +128,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:32 GMT + - Wed, 29 Nov 2023 13:55:17 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_groupby_type.yaml b/ohsome/test/cassettes/test_response/test_elements_count_groupby_type.yaml index 0ee0297..fa5e773 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_groupby_type.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_groupby_type.yaml @@ -50,7 +50,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:34 GMT + - Wed, 29 Nov 2023 13:55:18 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_ratio.yaml b/ohsome/test/cassettes/test_response/test_elements_count_ratio.yaml index fc55c5f..bd90996 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_ratio.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_ratio.yaml @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:36 GMT + - Wed, 29 Nov 2023 13:55:20 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_count_ratio_groupby_boundary.yaml b/ohsome/test/cassettes/test_response/test_elements_count_ratio_groupby_boundary.yaml index 6d5b0fa..49cc9da 100644 --- a/ohsome/test/cassettes/test_response/test_elements_count_ratio_groupby_boundary.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_count_ratio_groupby_boundary.yaml @@ -50,7 +50,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:37 GMT + - Wed, 29 Nov 2023 13:55:20 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_density.yaml b/ohsome/test/cassettes/test_response/test_elements_density.yaml index 33d57ec..f3246f2 100644 --- a/ohsome/test/cassettes/test_response/test_elements_density.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_density.yaml @@ -42,7 +42,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:28 GMT + - Wed, 29 Nov 2023 13:55:16 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_elements_geometry.yaml b/ohsome/test/cassettes/test_response/test_elements_geometry.yaml index cb50762..57c0c44 100644 --- a/ohsome/test/cassettes/test_response/test_elements_geometry.yaml +++ b/ohsome/test/cassettes/test_response/test_elements_geometry.yaml @@ -79,7 +79,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:37 GMT + - Wed, 29 Nov 2023 13:55:20 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_empty_geodataframe.yaml b/ohsome/test/cassettes/test_response/test_empty_geodataframe.yaml index 6c03783..6677a51 100644 --- a/ohsome/test/cassettes/test_response/test_empty_geodataframe.yaml +++ b/ohsome/test/cassettes/test_response/test_empty_geodataframe.yaml @@ -41,7 +41,7 @@ interactions: Content-disposition: - attachment;filename=ohsome.geojson Date: - - Fri, 17 Nov 2023 15:37:42 GMT + - Wed, 29 Nov 2023 13:55:23 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_multi_index_false.yaml b/ohsome/test/cassettes/test_response/test_multi_index_false.yaml index 2bb7b0e..0b5ca59 100644 --- a/ohsome/test/cassettes/test_response/test_multi_index_false.yaml +++ b/ohsome/test/cassettes/test_response/test_multi_index_false.yaml @@ -74,12 +74,12 @@ interactions: : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=doctors\",\n \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 3.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" - : 3.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=fountain\",\n \"result\" - : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : - 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" - : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=parking_entrance\",\n + : 3.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=parking_entrance\",\n \ \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" + : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=fountain\",\n \"result\" + : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : + 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" : 1.0\n } ]\n }, {\n \"groupByObject\" : \"amenity=public_building\",\n \ \"result\" : [ {\n \"timestamp\" : \"2019-12-10T00:00:00Z\",\n \"value\" : 1.0\n }, {\n \"timestamp\" : \"2019-12-11T00:00:00Z\",\n \"value\" @@ -128,7 +128,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:32 GMT + - Wed, 29 Nov 2023 13:55:17 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_not_implemented_query.yaml b/ohsome/test/cassettes/test_response/test_not_implemented_query.yaml index 463059d..b62f712 100644 --- a/ohsome/test/cassettes/test_response/test_not_implemented_query.yaml +++ b/ohsome/test/cassettes/test_response/test_not_implemented_query.yaml @@ -50,7 +50,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:30 GMT + - Wed, 29 Nov 2023 13:55:16 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/cassettes/test_response/test_users_timestamp.yaml b/ohsome/test/cassettes/test_response/test_users_timestamp.yaml index 7120779..8a2ce30 100644 --- a/ohsome/test/cassettes/test_response/test_users_timestamp.yaml +++ b/ohsome/test/cassettes/test_response/test_users_timestamp.yaml @@ -43,7 +43,7 @@ interactions: Content-Type: - application/json Date: - - Fri, 17 Nov 2023 15:37:39 GMT + - Wed, 29 Nov 2023 13:55:21 GMT Keep-Alive: - timeout=5, max=100 Server: diff --git a/ohsome/test/test_response.py b/ohsome/test/test_response.py index bdefbb1..5c35adb 100644 --- a/ohsome/test/test_response.py +++ b/ohsome/test/test_response.py @@ -344,25 +344,6 @@ def test_contributions_latest(base_client): assert len(result) == 1 -def test_contributions_count_density_groupbyboundary(base_client): - """ - Test whether the result of contributions.count.density.groupbyboundary.post is converted to a DataFrame - :return: - """ - bboxes = "8.7137,49.4096,8.717,49.4119" - time = "2015-01-01,2016-01-01" - filter = "name=Krautturm and type:way" - - client = base_client - response = client.contributions.count.density.groupByBoundary.post( - bboxes=bboxes, time=time, filter=filter - ) - result = response.as_dataframe() - - assert isinstance(result, pd.DataFrame) - assert len(result) == 1 - - @pytest.mark.vcr def test_empty_geodataframe(base_client): """