[Git][debian-gis-team/owslib][upstream] New upstream version 0.27.2

Bas Couwenberg (@sebastic) gitlab at salsa.debian.org
Sun Aug 28 18:04:42 BST 2022



Bas Couwenberg pushed to branch upstream at Debian GIS Project / owslib


Commits:
ca96ecde by Bas Couwenberg at 2022-08-28T18:53:55+02:00
New upstream version 0.27.2
- - - - -


16 changed files:

- CHANGES.rst
- VERSION.txt
- docs/en/features.rst
- docs/en/usage.rst
- owslib/__init__.py
- owslib/feature/wfs100.py
- owslib/ogcapi/__init__.py
- + owslib/ogcapi/processes.py
- owslib/tms.py
- owslib/wps.py
- requirements.txt
- tests/doctests/wcs_thredds.txt
- tests/doctests/wfs_MapServerWFSCapabilities.txt
- + tests/test_ogcapi_processes_pygeoapi.py
- tests/test_ogcapi_records_pycsw.py
- tests/test_ogcapi_records_pygeoapi.py


Changes:

=====================================
CHANGES.rst
=====================================
@@ -1,6 +1,17 @@
 Changes
 =======
 
+0.27.1 (2022-08-28)
+-------------------
+
+- remove pyproj as core dependency
+
+0.27.0 (2022-08-28)
+-------------------
+
+- core: update pyproj
+- OGC API: add support for OGC API - Processes
+
 0.26.0 (2022-06-06)
 -------------------
 


=====================================
VERSION.txt
=====================================
@@ -1 +1 @@
-0.26.0
+0.27.2


=====================================
docs/en/features.rst
=====================================
@@ -54,10 +54,14 @@ OGC API Support
 +======================================================================================+============+
 | `OGC API - Features - Part 1: Core`_                                                 | 1.0        |
 +--------------------------------------------------------------------------------------+------------+
+| `OGC API - Coverages - Part 1: Core`_                                                | draft      |
++--------------------------------------------------------------------------------------+------------+
 | `OGC API - Records - Part 1: Core`_                                                  | draft      |
 +--------------------------------------------------------------------------------------+------------+
 | `OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) draft`_  | draft      |
 +--------------------------------------------------------------------------------------+------------+
+| `OGC API - Processes - Part 1: Core`_                                                | 1.0        |
++--------------------------------------------------------------------------------------+------------+
 
 .. _`OGC WMS`: https://www.opengeospatial.org/standards/wms
 .. _`OGC WFS`: https://www.opengeospatial.org/standards/wfs
@@ -86,3 +90,5 @@ OGC API Support
 .. _`OGC API - Features - Part 1: Core`: https://docs.opengeospatial.org/is/17-069r3/17-069r3.html
 .. _`OGC API - Records - Part 1: Core`: https://github.com/opengeospatial/ogcapi-records
 .. _`OGC API - Features - Part 3: Filtering and the Common Query Language (CQL) draft`: https://docs.ogc.org/DRAFTS/19-079.html
+.. _`OGC API - Coverages - Part 1: Core`: https://docs.ogc.org/DRAFTS/19-087.html
+.. _`OGC API - Processes - Part 1: Core`: https://docs.ogc.org/is/18-062r2/18-062r2.html


=====================================
docs/en/usage.rst
=====================================
@@ -163,8 +163,8 @@ The `OGC API`_ standards are a clean break from the traditional OGC service arch
 using current design patterns (RESTful, JSON, OpenAPI).  As such, OWSLib the code follows
 the same pattern.
 
-OGC API - Features 1.0
-^^^^^^^^^^^^^^^^^^^^^^
+OGC API - Features 1.0 - Part 1: Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. code-block:: python
 
@@ -195,8 +195,8 @@ OGC API - Features 1.0
   >>> lakes_query['features'][0]['properties']
   {u'scalerank': 0, u'name_alt': None, u'admin': None, u'featureclass': u'Lake', u'id': 0, u'name': u'Lake Baikal'}
 
-OGC API - Coverages 1.0
-^^^^^^^^^^^^^^^^^^^^^^^
+OGC API - Coverages 1.0 - Part 1: Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
 .. code-block:: python
 
@@ -230,8 +230,8 @@ OGC API - Coverages 1.0
   'float64'
   >> gdps_coverage_query = w.coverage('gdps-temperature', range_subset=[1])
 
-OGC API - Records 1.0
-^^^^^^^^^^^^^^^^^^^^^
+OGC API - Records 1.0 - Part 1: Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
   >>> from owslib.ogcapi.records import Records
   >>> w = Records('https://example.org/records-api')
@@ -273,6 +273,21 @@ OGC API - Records 1.0
   >>> my_catalogue_cql_json_query['features'][0]['properties']['title']
   u'Roadrunner ambush locations'
 
+OGC API - Processes 1.0 - Part 1: Core
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+.. code-block:: python
+
+  >>> from owslib.ogcapi.processes import Processes
+  >>> p = Processes(SERVICE_URL)
+
+  >>> processes = p.processes()
+  >>>  hello_world = p.process('hello-world')
+
+  >>> hello_world['id']
+  'hello-world'
+  >>> hello_world['title']
+  'Hello World'
 
 WCS
 ---


=====================================
owslib/__init__.py
=====================================
@@ -1 +1 @@
-__version__ = '0.26.0'
+__version__ = '0.27.2'


=====================================
owslib/feature/wfs100.py
=====================================
@@ -7,6 +7,8 @@
 # =============================================================================
 
 import itertools
+import logging
+
 from owslib import util
 
 from io import BytesIO
@@ -31,7 +33,15 @@ from owslib.feature.common import (
     AbstractContentMetadata,
 )
 
-import pyproj
+LOGGER = logging.getLogger(__name__)
+
+has_pyproj = False
+
+try:
+    import pyproj
+    has_pyproj = True
+except ImportError:
+    LOGGER.warning('pyproj not installed')
 
 n = Namespaces()
 WFS_NAMESPACE = n.get_namespace("wfs")
@@ -394,7 +404,7 @@ class ContentMetadata(AbstractContentMetadata):
         # transform wgs84 bbox from given default bboxt
         self.boundingBoxWGS84 = None
 
-        if b is not None and srs is not None:
+        if has_pyproj and b is not None and srs is not None:
             wgs84 = pyproj.CRS.from_epsg(4326)
             try:
                 src_srs = pyproj.CRS.from_string(srs.text)


=====================================
owslib/ogcapi/__init__.py
=====================================
@@ -62,7 +62,7 @@ class API:
             self.links = json.loads(json_).get('links', [])
             self.response = json_
         else:
-            response = http_get(url, headers=self.headers, auth=self.auth).json()
+            response = http_get(self.url, headers=self.headers, auth=self.auth).json()
             self.links = response.get('links', [])
             self.response = response
 


=====================================
owslib/ogcapi/processes.py
=====================================
@@ -0,0 +1,46 @@
+# =============================================================================
+# Copyright (c) 2022 Tom Kralidis
+#
+# Author: Tom Kralidis <tomkralidis at gmail.com>
+#
+# Contact email: tomkralidis at gmail.com
+# =============================================================================
+
+import logging
+
+from owslib.ogcapi import Collections
+from owslib.util import Authentication
+
+LOGGER = logging.getLogger(__name__)
+
+
+class Processes(Collections):
+    """Abstraction for OGC API - Processes"""
+
+    def __init__(self, url: str, json_: str = None, timeout: int = 30,
+                 headers: dict = None, auth: Authentication = None):
+        __doc__ = Collections.__doc__  # noqa
+        super().__init__(url, json_, timeout, headers, auth)
+
+    def processes(self) -> dict:
+        """
+        implements /processes
+
+        @returns: `dict` of available processes
+        """
+
+        path = 'processes'
+        return self._request(path)
+
+    def process(self, process_id: str) -> dict:
+        """
+        implements /processs/{processId}
+
+        @type process_id: string
+        @param process_id: id of process
+
+        @returns: `dict` of process desceription
+        """
+
+        path = f'processes/{process_id}'
+        return self._request(path)


=====================================
owslib/tms.py
=====================================
@@ -200,7 +200,7 @@ class ContentMetadata(object):
     def _get_tilemap(self):
         if self._tile_map is None:
             self._tile_map = TileMap(self.id, headers=self.headers, auth=self.auth)
-            assert(self._tile_map.srs == self.srs)
+            assert self._tile_map.srs == self.srs
         return self._tile_map
 
     @property


=====================================
owslib/wps.py
=====================================
@@ -765,7 +765,7 @@ class WPSExecution(object):
             elif isinstance(output, list):
                 for ouputTuple in output:
                     # tuple (identifier, as_reference) for backward compatibility
-                    if(len(ouputTuple) == 2):
+                    if len(ouputTuple) == 2:
                         (identifier, as_reference) = ouputTuple
                         mime_type = None
                     else:


=====================================
requirements.txt
=====================================
@@ -1,6 +1,5 @@
 python-dateutil>=1.5
 pytz
 requests>=1.0
-pyproj < 3.3.0
 pyyaml
 dataclasses; python_version < '3.7'


=====================================
tests/doctests/wcs_thredds.txt
=====================================
@@ -37,7 +37,7 @@ Imports
 
 Print the ids of all layers (actually just the first 3):
    >>> sorted(wcs.contents.keys())
-   ['Absolute_vorticity_isobaric', 'Best_4_layer_lifted_index_layer_between_two_pressure_difference_from_ground_layer', 'Convective_Available_Potential_Energy_layer_between_two_pressure_difference_from_ground_layer', 'Convective_Available_Potential_Energy_surface', 'Convective_inhibition_layer_between_two_pressure_difference_from_ground_layer', 'Convective_inhibition_surface', 'Convective_precipitation_surface_Mixed_intervals_Accumulation', 'Geopotential_height_isobaric', 'Geopotential_height_surface', 'Geopotential_height_zeroDegC_isotherm', 'Mean_Sea_Level_Pressure_NAM_Model_Reduction_msl', 'Parcel_lifted_index_to_500_hPa_layer_between_two_pressure_difference_from_ground_layer', 'Precipitable_water_entire_atmosphere', 'Pressure_cloud_base', 'Pressure_cloud_tops', 'Pressure_maximum_wind', 'Pressure_reduced_to_MSL_msl', 'Pressure_surface', 'Pressure_tropopause', 'Relative_humidity_height_above_ground', 'Relative_humidity_isobaric', 'Relative_humidity_layer_between_two_pressure_difference_from_ground_layer', 'Relative_humidity_zeroDegC_isotherm', 'Storm_relative_helicity_layer_between_two_heights_above_ground_layer', 'Temperature_cloud_tops', 'Temperature_height_above_ground', 'Temperature_isobaric', 'Temperature_layer_between_two_pressure_difference_from_ground_layer', 'Temperature_tropopause', 'Total_precipitation_surface_Mixed_intervals_Accumulation', 'Vertical_velocity_pressure_isobaric', 'u-component_of_wind_height_above_ground', 'u-component_of_wind_isobaric', 'u-component_of_wind_layer_between_two_pressure_difference_from_ground_layer', 'u-component_of_wind_maximum_wind', 'u-component_of_wind_tropopause', 'v-component_of_wind_height_above_ground', 'v-component_of_wind_isobaric', 'v-component_of_wind_layer_between_two_pressure_difference_from_ground_layer', 'v-component_of_wind_maximum_wind', 'v-component_of_wind_tropopause']
+   ['Absolute_vorticity_isobaric', 'Best_4_layer_lifted_index_layer_between_two_pressure_difference_from_ground_layer', 'Convective_Available_Potential_Energy_layer_between_two_pressure_difference_from_ground_layer', 'Convective_Available_Potential_Energy_surface', 'Convective_inhibition_layer_between_two_pressure_difference_from_ground_layer', 'Convective_inhibition_surface', 'Convective_precipitation_surface_Accumulation', 'Geopotential_height_isobaric', 'Geopotential_height_surface', 'Geopotential_height_zeroDegC_isotherm', 'Mean_Sea_Level_Pressure_NAM_Model_Reduction_msl', 'Parcel_lifted_index_to_500_hPa_layer_between_two_pressure_difference_from_ground_layer', 'Precipitable_water_entire_atmosphere', 'Pressure_cloud_base', 'Pressure_cloud_tops', 'Pressure_maximum_wind', 'Pressure_reduced_to_MSL_msl', 'Pressure_surface', 'Pressure_tropopause', 'Relative_humidity_height_above_ground', 'Relative_humidity_isobaric', 'Relative_humidity_layer_between_two_pressure_difference_from_ground_layer', 'Relative_humidity_zeroDegC_isotherm', 'Storm_relative_helicity_layer_between_two_heights_above_ground_layer', 'Temperature_cloud_tops', 'Temperature_height_above_ground', 'Temperature_isobaric', 'Temperature_layer_between_two_pressure_difference_from_ground_layer', 'Temperature_tropopause', 'Total_precipitation_surface_Accumulation', 'Vertical_velocity_pressure_isobaric', 'u-component_of_wind_height_above_ground', 'u-component_of_wind_isobaric', 'u-component_of_wind_layer_between_two_pressure_difference_from_ground_layer', 'u-component_of_wind_maximum_wind', 'u-component_of_wind_tropopause', 'v-component_of_wind_height_above_ground', 'v-component_of_wind_isobaric', 'v-component_of_wind_layer_between_two_pressure_difference_from_ground_layer', 'v-component_of_wind_maximum_wind', 'v-component_of_wind_tropopause']
 
 
 #To further interrogate a single "coverage" get the coverageMetadata object
@@ -48,7 +48,7 @@ Print the ids of all layers (actually just the first 3):
     >>> cvg=wcs['Temperature_tropopause']
 
     >>> cvg.boundingBoxWGS84
-    (-153.58889168336785, 11.747698754311253, -48.59839139638086, 57.48431804715324)
+    (-153.58889302705833, 11.747698472996, -48.59839047148847, 61.585029283566165)
 
     >>> len(cvg.timepositions)>1 #The old test kept failing as the response timepositions kept changign on the server
     True
@@ -72,10 +72,10 @@ Print the ids of all layers (actually just the first 3):
     ['92', '64']
 
     >>> cvg.grid.origin
-    ['-4223.61181640625', '-832.2075805664062']
+    ['-4223.611945747588', '-832.2075711108391']
 
     >>> cvg.grid.offsetvectors
-    [['81.27100140115489', '0.0'], ['0.0', '81.27100467681885']]
+    [['81.27100372314453', '0.0'], ['0.0', '81.27100372314453']]
 
 #Now we have enough information to build a getCoverage request:
     >>> covID='Temperature_tropopause'


=====================================
tests/doctests/wfs_MapServerWFSCapabilities.txt
=====================================
@@ -66,9 +66,6 @@ Test single item accessor
     >>> wfs['glaciers'].boundingBox
     (-11887400000.0, -850889000.0, 557154000.0, 262891000.0, urn:ogc:def:crs:EPSG::3031)
 
-    >>> cast_tuple_int_list(wfs['glaciers'].boundingBoxWGS84)
-    [-94, 89, 64, 87]
-
     >>> [x.getcode() for x in wfs['glaciers'].crsOptions]
     ['EPSG:3031']
 


=====================================
tests/test_ogcapi_processes_pygeoapi.py
=====================================
@@ -0,0 +1,36 @@
+from tests.utils import service_ok
+
+import pytest
+
+from owslib.ogcapi.processes import Processes
+
+SERVICE_URL = 'https://demo.pygeoapi.io/master'
+
+
+ at pytest.mark.online
+ at pytest.mark.skipif(not service_ok(SERVICE_URL),
+                    reason='service is unreachable')
+def test_ogcapi_processes_pygeoapi():
+    p = Processes(SERVICE_URL)
+
+    assert p.url == 'https://demo.pygeoapi.io/master/'
+    assert p.url_query_string is None
+
+    api = p.api()
+    assert api['components']['parameters'] is not None
+    paths = api['paths']
+    assert paths is not None
+    assert paths['/processes/hello-world'] is not None
+
+    conformance = p.conformance()
+    assert len(conformance['conformsTo']) > 0
+
+    collections = p.collections()
+    assert len(collections) > 0
+
+    processes = p.processes()
+    assert len(processes) == 1
+
+    hello_world = p.process('hello-world')
+    assert hello_world['id'] == 'hello-world'
+    assert hello_world['title'] == 'Hello World'


=====================================
tests/test_ogcapi_records_pycsw.py
=====================================
@@ -40,7 +40,7 @@ def test_ogcapi_records_pycsw():
     assert isinstance(w.response, dict)
 
     pycsw_cite_demo_queryables = w.collection_queryables('metadata:main')
-    assert len(pycsw_cite_demo_queryables['properties'].keys()) == 11
+    assert len(pycsw_cite_demo_queryables['properties'].keys()) == 12
 
     # Minimum of limit param is 1
     with pytest.raises(RuntimeError):


=====================================
tests/test_ogcapi_records_pygeoapi.py
=====================================
@@ -40,18 +40,18 @@ def test_ogcapi_records_pygeoapi():
     assert isinstance(w.response, dict)
 
     dutch_metacat_queryables = w.collection_queryables('dutch-metadata')
-    assert len(dutch_metacat_queryables['properties']) == 11
+    assert len(dutch_metacat_queryables['properties']) == 10
 
     # Minimum of limit param is 1
     with pytest.raises(RuntimeError):
         dutch_metacat_query = w.collection_items('dutch-metadata', limit=0)
 
     dutch_metacat_query = w.collection_items('dutch-metadata', limit=1)
-    assert dutch_metacat_query['numberMatched'] == 198
+    assert dutch_metacat_query['numberMatched'] == 308
     assert dutch_metacat_query['numberReturned'] == 1
     assert len(dutch_metacat_query['features']) == 1
 
     dutch_metacat_query = w.collection_items('dutch-metadata', q='Wegpanorama')
-    assert dutch_metacat_query['numberMatched'] == 2
-    assert dutch_metacat_query['numberReturned'] == 2
-    assert len(dutch_metacat_query['features']) == 2
+    assert dutch_metacat_query['numberMatched'] == 3
+    assert dutch_metacat_query['numberReturned'] == 3
+    assert len(dutch_metacat_query['features']) == 3



View it on GitLab: https://salsa.debian.org/debian-gis-team/owslib/-/commit/ca96ecde981b3a08adb778f2f189890585ce1965

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/owslib/-/commit/ca96ecde981b3a08adb778f2f189890585ce1965
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20220828/dd89ee80/attachment-0001.htm>


More information about the Pkg-grass-devel mailing list