From 30d793a8bc0bdffe4845447e50f6c10eca02e3a3 Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 17 Nov 2021 14:26:21 -0500 Subject: [PATCH 1/5] Add test for custom headers in StacApiIO --- tests/test_stac_api_io.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test_stac_api_io.py b/tests/test_stac_api_io.py index 21dd38e5..03eaf931 100644 --- a/tests/test_stac_api_io.py +++ b/tests/test_stac_api_io.py @@ -59,3 +59,19 @@ def test_conforms_to(self): # Check that this does not raise an exception assert conformant_io.conforms_to(ConformanceClasses.CORE) + + def test_custom_headers(self, requests_mock): + """Checks that headers passed to the init method are added to requests.""" + header_name = "x-my-header" + header_value = "Some Value" + url = "https://some-url.com/some-file.json" + stac_api_io = StacApiIO(headers={header_name: header_value}) + + requests_mock.get(url, status_code=200, json={}) + + stac_api_io.read_json(url) + + history = requests_mock.request_history + assert len(history) == 1 + assert header_name in history[0].headers + assert history[0].headers[header_name] == header_value From c0490a72862aa9a1e8d77d781a2d29241f36a022 Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 17 Nov 2021 14:27:08 -0500 Subject: [PATCH 2/5] Add parameters argument to StacApiIO init --- pystac_client/stac_api_io.py | 8 +++++++- tests/test_stac_api_io.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/pystac_client/stac_api_io.py b/pystac_client/stac_api_io.py index c0ef0bca..7f4930de 100644 --- a/pystac_client/stac_api_io.py +++ b/pystac_client/stac_api_io.py @@ -36,7 +36,12 @@ class StacApiIO(DefaultStacIO): - def __init__(self, headers: Optional[Dict] = None, conformance: Optional[List[str]] = None): + def __init__( + self, + headers: Optional[Dict] = None, + conformance: Optional[List[str]] = None, + parameters: Optional[Dict] = None, + ): """Initialize class for API IO Args: @@ -48,6 +53,7 @@ def __init__(self, headers: Optional[Dict] = None, conformance: Optional[List[st # TODO - this should super() to parent class self.session = Session() self.session.headers.update(headers or {}) + self.session.params.update(parameters or {}) self._conformance = conformance diff --git a/tests/test_stac_api_io.py b/tests/test_stac_api_io.py index 03eaf931..ad9d73ef 100644 --- a/tests/test_stac_api_io.py +++ b/tests/test_stac_api_io.py @@ -1,3 +1,5 @@ +from urllib.parse import parse_qs, urlsplit + import pytest from pystac_client.conformance import ConformanceClasses @@ -75,3 +77,32 @@ def test_custom_headers(self, requests_mock): assert len(history) == 1 assert header_name in history[0].headers assert history[0].headers[header_name] == header_value + + def test_custom_query_params(self, requests_mock): + """Checks that query params passed to the init method are added to requests.""" + init_qp_name = "my-param" + init_qp_value = "something" + url = "https://some-url.com/some-file.json" + stac_api_io = StacApiIO(parameters={init_qp_name: init_qp_value}) + + request_qp_name = "another-param" + request_qp_value = "another_value" + requests_mock.get(url, status_code=200, json={}) + + stac_api_io.read_json(url, parameters={request_qp_name: request_qp_value}) + + history = requests_mock.request_history + assert len(history) == 1 + + actual_qs = urlsplit(history[0].url).query + actual_qp = parse_qs(actual_qs) + + # Check that the param from the init method is present + assert init_qp_name in actual_qp + assert len(actual_qp[init_qp_name]) == 1 + assert actual_qp[init_qp_name][0] == init_qp_value + + # Check that the param from the request is present + assert request_qp_name in actual_qp + assert len(actual_qp[request_qp_name]) == 1 + assert actual_qp[request_qp_name][0] == request_qp_value From 059307d273e163309398c59ae8cdd555517a97d9 Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 17 Nov 2021 14:27:09 -0500 Subject: [PATCH 3/5] Update StacApiIO docstring --- pystac_client/stac_api_io.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pystac_client/stac_api_io.py b/pystac_client/stac_api_io.py index 7f4930de..1c3ff2bb 100644 --- a/pystac_client/stac_api_io.py +++ b/pystac_client/stac_api_io.py @@ -46,6 +46,9 @@ def __init__( Args: headers : Optional dictionary of headers to include in all requests + conformance : Optional list of `Conformance Classes + `__. + parameters: Optional dictionary of query string parameters to include in all requests. Return: StacApiIO : StacApiIO instance From 6ee11d3942e05dc07bf00a66ff1ac79077f98002 Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 17 Nov 2021 15:28:31 -0500 Subject: [PATCH 4/5] Add parameters argument to Client.open and Client.from_file --- pystac_client/client.py | 26 +- tests/data/planetary-computer-collection.json | 762 ++++++++++++++++++ tests/test_client.py | 42 +- 3 files changed, 819 insertions(+), 11 deletions(-) create mode 100644 tests/data/planetary-computer-collection.json diff --git a/pystac_client/client.py b/pystac_client/client.py index dc0e1153..4a408920 100644 --- a/pystac_client/client.py +++ b/pystac_client/client.py @@ -27,10 +27,13 @@ def __repr__(self): return ''.format(self.id) @classmethod - def open(cls, - url: str, - headers: Dict[str, str] = None, - ignore_conformance: bool = False) -> "Client": + def open( + cls, + url: str, + headers: Dict[str, str] = None, + parameters: Optional[Dict[str, Any]] = None, + ignore_conformance: bool = False, + ) -> "Client": """Opens a STAC Catalog or API This function will read the root catalog of a STAC Catalog or API @@ -44,7 +47,7 @@ def open(cls, Return: catalog : A :class:`Client` instance for this Catalog/API """ - cat = cls.from_file(url, headers=headers) + cat = cls.from_file(url, headers=headers, parameters=parameters) search_link = cat.get_links('search') # if there is a search link, but no conformsTo advertised, ignore conformance entirely # NOTE: this behavior to be deprecated as implementations become conformant @@ -54,17 +57,20 @@ def open(cls, return cat @classmethod - def from_file(cls, - href: str, - stac_io: Optional[pystac.StacIO] = None, - headers: Optional[Dict] = {}) -> "Client": + def from_file( + cls, + href: str, + stac_io: Optional[pystac.StacIO] = None, + headers: Optional[Dict] = {}, + parameters: Optional[Dict] = None, + ) -> "Client": """Open a STAC Catalog/API Returns: Client: A Client (PySTAC Catalog) of the root Catalog for this Catalog/API """ if stac_io is None: - stac_io = StacApiIO(headers=headers) + stac_io = StacApiIO(headers=headers, parameters=parameters) cat = super().from_file(href, stac_io) diff --git a/tests/data/planetary-computer-collection.json b/tests/data/planetary-computer-collection.json new file mode 100644 index 00000000..bfe9dd01 --- /dev/null +++ b/tests/data/planetary-computer-collection.json @@ -0,0 +1,762 @@ +{ + "id": "gap", + "type": "Collection", + "links": [ + { + "rel": "items", + "type": "application/geo+json", + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gap/items" + }, + { + "rel": "parent", + "type": "application/json", + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/" + }, + { + "rel": "root", + "type": "application/json", + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/" + }, + { + "rel": "self", + "type": "application/json", + "href": "https://planetarycomputer.microsoft.com/api/stac/v1/collections/gap" + }, + { + "rel": "license", + "href": "https://www.usgs.gov/core-science-systems/hdds/data-policy", + "title": "public domain" + }, + { + "rel": "describedby", + "href": "https://planetarycomputer.microsoft.com/dataset/gap", + "title": "Human readable dataset overview and reference", + "type": "text/html" + } + ], + "title": "USGS Gap Land Cover", + "assets": { + "thumbnail": { + "href": "https://ai4edatasetspublicassets.blob.core.windows.net/assets/pc_thumbnails/gap.png", + "type": "image/png", + "roles": [ + "data" + ], + "title": "USGS GAP" + }, + "original-data-ak": { + "href": "https://ai4edataeuwest.blob.core.windows.net/usgs-gap/originals/gaplandcov_ak.zip", + "type": "application/zip", + "roles": [ + "data" + ], + "title": "Alaska source data", + "description": "Original source data for Alaska" + }, + "original-data-hi": { + "href": "https://ai4edataeuwest.blob.core.windows.net/usgs-gap/originals/gaplandcov_hi.zip", + "type": "application/zip", + "roles": [ + "data" + ], + "title": "Hawaii source data", + "description": "Original source data for Hawaii" + }, + "original-data-pr": { + "href": "https://ai4edataeuwest.blob.core.windows.net/usgs-gap/originals/pr_landcover.zip", + "type": "application/zip", + "roles": [ + "data" + ], + "title": "Puerto Rico source data", + "description": "Original source data for Puerto Rico" + }, + "original-data-conus": { + "href": "https://ai4edataeuwest.blob.core.windows.net/usgs-gap/originals/gap_landfire_nationalterrestrialecosystems2011.zip", + "type": "application/zip", + "roles": [ + "data" + ], + "title": "CONUS source data", + "description": "Original source data for the continental United States (CONUS)" + } + }, + "extent": { + "spatial": { + "bbox": [ + [ + -127.9710481801793, + 22.797789263564383, + -65.26634281147894, + 51.64692620669362 + ], + [ + -178.13166387448902, + 49.09079265233118, + 179.87849702345594, + 71.43382483774205 + ], + [ + -160.26640694607218, + 18.851824447510786, + -154.66974350173518, + 22.295114188194738 + ], + [ + -67.9573345827195, + 17.874066536543, + -65.21836408976736, + 18.5296513469496 + ] + ] + }, + "temporal": { + "interval": [ + [ + "1999-01-01T00:00:00Z", + "2011-12-31T00:00:00Z" + ] + ] + } + }, + "license": "proprietary", + "keywords": [ + "USGS", + "GAP", + "LANDFIRE", + "Land Cover", + "United States" + ], + "providers": [ + { + "url": "https://www.usgs.gov/core-science-systems/science-analytics-and-synthesis/gap/science/land-cover", + "name": "USGS", + "roles": [ + "processor", + "producer", + "licensor" + ] + }, + { + "url": "https://planetarycomputer.microsoft.com", + "name": "Microsoft", + "roles": [ + "host" + ] + } + ], + "summaries": { + "gsd": [ + 30 + ], + "label:classes": [ + { + "classes": [ + "0", + "South Florida Bayhead Swamp", + "South Florida Cypress Dome", + "South Florida Dwarf Cypress Savanna", + "South Florida Mangrove Swamp", + "South Florida Hardwood Hammock", + "Southeast Florida Coastal Strand and Maritime Hammock", + "Southwest Florida Coastal Strand and Maritime Hammock", + "South Florida Pine Rockland", + "Atlantic Coastal Plain Fall-line Sandhills Longleaf Pine Woodland - Open Understory", + "Atlantic Coastal Plain Fall-line Sandhills Longleaf Pine Woodland - Scrub/Shrub Understory", + "Atlantic Coastal Plain Upland Longleaf Pine Woodland", + "Atlantic Coastal Plain Xeric River Dune", + "East Gulf Coastal Plain Interior Upland Longleaf Pine Woodland - Open Understory Modifier", + "East Gulf Coastal Plain Interior Upland Longleaf Pine Woodland - Scrub/Shrub Modifier", + "Florida Longleaf Pine Sandhill - Scrub/Shrub Understory Modifier", + "Florida Longleaf Pine Sandhill- Open Understory Modifier", + "West Gulf Coastal Plain Upland Longleaf Pine Forest and Woodland", + "Atlantic Coastal Plain Central Maritime Forest", + "Atlantic Coastal Plain Southern Maritime Forest", + "Central and South Texas Coastal Fringe Forest and Woodland", + "East Gulf Coastal Plain Limestone Forest", + "East Gulf Coastal Plain Maritime Forest", + "East Gulf Coastal Plain Southern Loess Bluff Forest", + "East Gulf Coastal Plain Southern Mesic Slope Forest", + "Mississippi Delta Maritime Forest", + "Southern Coastal Plain Dry Upland Hardwood Forest", + "Southern Coastal Plain Oak Dome and Hammock", + "West Gulf Coastal Plain Chenier and Upper Texas Coastal Fringe Forest and Woodland", + "West Gulf Coastal Plain Mesic Hardwood Forest", + "East-Central Texas Plains Pine Forest and Woodland", + "West Gulf Coastal Plain Pine-Hardwood Forest", + "West Gulf Coastal Plain Sandhill Oak and Shortleaf Pine Forest and Woodland", + "Atlantic Coastal Plain Fall-Line Sandhills Longleaf Pine Woodland - Loblolly Modifier", + "Deciduous Plantations", + "East Gulf Coastal Plain Interior Upland Longleaf Pine Woodland - Loblolly Modifier", + "East Gulf Coastal Plain Interior Upland Longleaf Pine Woodland - Offsite Hardwood Modifier", + "East Gulf Coastal Plain Near-Coast Pine Flatwoods - Offsite Hardwood Modifier", + "Evergreen Plantation or Managed Pine", + "California Central Valley Mixed Oak Savanna", + "California Coastal Closed-Cone Conifer Forest and Woodland", + "California Coastal Live Oak Woodland and Savanna", + "California Lower Montane Blue Oak-Foothill Pine Woodland and Savanna", + "Central and Southern California Mixed Evergreen Woodland", + "Mediterranean California Lower Montane Black Oak-Conifer Forest and Woodland", + "Southern California Oak Woodland and Savanna", + "Madrean Encinal", + "Madrean Pinyon-Juniper Woodland", + "Madrean Pine-Oak Forest and Woodland", + "Madrean Upper Montane Conifer-Oak Forest and Woodland", + "Edwards Plateau Dry-Mesic Slope Forest and Woodland", + "Edwards Plateau Limestone Savanna and Woodland", + "Edwards Plateau Mesic Canyon", + "Llano Uplift Acidic Forest, Woodland and Glade", + "East Cascades Oak-Ponderosa Pine Forest and Woodland", + "Mediterranean California Mixed Evergreen Forest", + "Mediterranean California Mixed Oak Woodland", + "North Pacific Dry Douglas-fir-(Madrone) Forest and Woodland", + "North Pacific Oak Woodland", + "Edwards Plateau Limestone Shrubland", + "Allegheny-Cumberland Dry Oak Forest and Woodland - Hardwood", + "Allegheny-Cumberland Dry Oak Forest and Woodland - Pine Modifier", + "Central and Southern Appalachian Montane Oak Forest", + "Central and Southern Appalachian Northern Hardwood Forest", + "Central Appalachian Oak and Pine Forest", + "Crosstimbers Oak Forest and Woodland", + "East Gulf Coastal Plain Black Belt Calcareous Prairie and Woodland - Woodland Modifier", + "East Gulf Coastal Plain Northern Dry Upland Hardwood Forest", + "East Gulf Coastal Plain Northern Loess Plain Oak-Hickory Upland - Hardwood Modifier", + "East Gulf Coastal Plain Northern Loess Plain Oak-Hickory Upland - Juniper Modifier", + "East-Central Texas Plains Post Oak Savanna and Woodland", + "Lower Mississippi River Dune Woodland and Forest", + "Mississippi River Alluvial Plain Dry-Mesic Loess Slope Forest", + "North-Central Interior Dry Oak Forest and Woodland", + "North-Central Interior Dry-Mesic Oak Forest and Woodland", + "Northeastern Interior Dry Oak Forest - Mixed Modifier", + "Northeastern Interior Dry Oak Forest - Virginia/Pitch Pine Modifier", + "Northeastern Interior Dry Oak Forest-Hardwood Modifier", + "Northeastern Interior Dry-Mesic Oak Forest", + "Northern Atlantic Coastal Plain Dry Hardwood Forest", + "Crowley's Ridge Sand Forest", + "Ouachita Montane Oak Forest", + "Ozark-Ouachita Dry Oak Woodland", + "Ozark-Ouachita Dry-Mesic Oak Forest", + "Southern and Central Appalachian Oak Forest", + "Southern and Central Appalachian Oak Forest - Xeric", + "Southern Interior Low Plateau Dry-Mesic Oak Forest", + "Southern Ridge and Valley Dry Calcareous Forest", + "Southern Ridge and Valley Dry Calcareous Forest - Pine modifier", + "East Gulf Coastal Plain Northern Dry Upland Hardwood Forest - Offsite Pine Modifier", + "Managed Tree Plantation", + "Ruderal forest", + "Southern Piedmont Dry Oak-(Pine) Forest - Loblolly Pine Modifier", + "Acadian Low-Elevation Spruce-Fir-Hardwood Forest", + "Acadian-Appalachian Montane Spruce-Fir Forest", + "Appalachian Hemlock-Hardwood Forest", + "Central and Southern Appalachian Spruce-Fir Forest", + "0", + "Laurentian-Acadian Northern Hardwoods Forest", + "Laurentian-Acadian Northern Pine-(Oak) Forest", + "Laurentian-Acadian Pine-Hemlock-Hardwood Forest", + "Paleozoic Plateau Bluff and Talus", + "Southern Appalachian Northern Hardwood Forest", + "Atlantic Coastal Plain Dry and Dry-Mesic Oak Forest", + "Atlantic Coastal Plain Fall-line Sandhills Longleaf Pine Woodland - Offsite Hardwood", + "East Gulf Coastal Plain Interior Shortleaf Pine-Oak Forest - Hardwood Modifier", + "East Gulf Coastal Plain Interior Shortleaf Pine-Oak Forest - Mixed Modifier", + "Ozark-Ouachita Shortleaf Pine-Bluestem Woodland", + "Ozark-Ouachita Shortleaf Pine-Oak Forest and Woodland", + "Southeastern Interior Longleaf Pine Woodland", + "Southern Appalachian Low Mountain Pine Forest", + "Southern Piedmont Dry Oak-(Pine) Forest", + "Southern Piedmont Dry Oak-(Pine) Forest - Hardwood Modifier", + "Southern Piedmont Dry Oak-(Pine) Forest - Mixed Modifier", + "Southern Piedmont Dry Oak-Heath Forest - Mixed Modifier", + "Eastern Great Plains Tallgrass Aspen Parkland", + "Northwestern Great Plains Aspen Forest and Parkland", + "Northwestern Great Plains Shrubland", + "Western Great Plains Dry Bur Oak Forest and Woodland", + "Western Great Plains Wooded Draw and Ravine", + "Southern Atlantic Coastal Plain Mesic Hardwood Forest", + "East Gulf Coastal Plain Northern Loess Bluff Forest", + "East Gulf Coastal Plain Northern Mesic Hardwood Forest", + "North-Central Interior Beech-Maple Forest", + "North-Central Interior Maple-Basswood Forest", + "Ozark-Ouachita Mesic Hardwood Forest", + "South-Central Interior Mesophytic Forest", + "Southern and Central Appalachian Cove Forest", + "Crowley's Ridge Mesic Loess Slope Forest", + "Southern Piedmont Mesic Forest", + "Appalachian Shale Barrens", + "Atlantic Coastal Plain Northern Maritime Forest", + "Laurentian Pine-Oak Barrens", + "Northeastern Interior Pine Barrens", + "Northern Atlantic Coastal Plain Pitch Pine Barrens", + "Southern Appalachian Montane Pine Forest and Woodland", + "East Cascades Mesic Montane Mixed-Conifer Forest and Woodland", + "Middle Rocky Mountain Montane Douglas-fir Forest and Woodland", + "Northern Rocky Mountain Dry-Mesic Montane Mixed Conifer Forest", + "Northern Rocky Mountain Foothill Conifer Wooded Steppe", + "Northern Rocky Mountain Mesic Montane Mixed Conifer Forest", + "Northern Rocky Mountain Ponderosa Pine Woodland and Savanna", + "Northern Rocky Mountain Western Larch Savanna", + "Northwestern Great Plains - Black Hills Ponderosa Pine Woodland and Savanna", + "Rocky Mountain Foothill Limber Pine-Juniper Woodland", + "Inter-Mountain Basins Aspen-Mixed Conifer Forest and Woodland", + "Inter-Mountain Basins Subalpine Limber-Bristlecone Pine Woodland", + "Northern Rocky Mountain Subalpine Woodland and Parkland", + "Rocky Mountain Aspen Forest and Woodland", + "Rocky Mountain Lodgepole Pine Forest", + "Rocky Mountain Poor-Site Lodgepole Pine Forest", + "Rocky Mountain Subalpine Dry-Mesic Spruce-Fir Forest and Woodland", + "Rocky Mountain Subalpine Mesic Spruce-Fir Forest and Woodland", + "Rocky Mountain Subalpine-Montane Limber-Bristlecone Pine Woodland", + "Rocky Mountain Bigtooth Maple Ravine Woodland", + "Southern Rocky Mountain Dry-Mesic Montane Mixed Conifer Forest and Woodland", + "Southern Rocky Mountain Mesic Montane Mixed Conifer Forest and Woodland", + "Southern Rocky Mountain Ponderosa Pine Savanna", + "Southern Rocky Mountain Ponderosa Pine Woodland", + "California Montane Jeffrey Pine-(Ponderosa Pine) Woodland", + "Klamath-Siskiyou Lower Montane Serpentine Mixed Conifer Woodland", + "Klamath-Siskiyou Upper Montane Serpentine Mixed Conifer Woodland", + "Mediterranean California Dry-Mesic Mixed Conifer Forest and Woodland", + "Mediterranean California Mesic Mixed Conifer Forest and Woodland", + "Sierran-Intermontane Desert Western White Pine-White Fir Woodland", + "California Coastal Redwood Forest", + "North Pacific Broadleaf Landslide Forest and Shrubland", + "North Pacific Dry-Mesic Silver Fir-Western Hemlock-Douglas-fir Forest", + "North Pacific Hypermaritime Sitka Spruce Forest", + "North Pacific Hypermaritime Western Red-cedar-Western Hemlock Forest", + "North Pacific Lowland Mixed Hardwood-Conifer Forest and Woodland", + "North Pacific Maritime Dry-Mesic Douglas-fir-Western Hemlock Forest", + "North Pacific Maritime Mesic-Wet Douglas-fir-Western Hemlock Forest", + "North Pacific Mesic Western Hemlock-Silver Fir Forest", + "North Pacific Wooded Volcanic Flowage", + "Mediterranean California Red Fir Forest", + "Mediterranean California Subalpine Woodland", + "North Pacific Maritime Mesic Subalpine Parkland", + "North Pacific Mountain Hemlock Forest", + "Northern California Mesic Subalpine Woodland", + "Northern Pacific Mesic Subalpine Woodland", + "Sierra Nevada Subalpine Lodgepole Pine Forest and Woodland", + "Columbia Plateau Western Juniper Woodland and Savanna", + "Great Basin Pinyon-Juniper Woodland", + "Inter-Mountain Basins Curl-leaf Mountain Mahogany Woodland and Shrubland", + "Inter-Mountain Basins Juniper Savanna", + "Colorado Plateau Pinyon-Juniper Shrubland", + "Colorado Plateau Pinyon-Juniper Woodland", + "Southern Rocky Mountain Juniper Woodland and Savanna", + "Southern Rocky Mountain Pinyon-Juniper Woodland", + "Northwestern Great Plains Floodplain", + "Northwestern Great Plains Riparian", + "Western Great Plains Floodplain", + "Western Great Plains Floodplain Systems", + "Western Great Plains Riparian Woodland and Shrubland", + "Central Appalachian Floodplain - Forest Modifier", + "Central Appalachian Riparian - Forest Modifier", + "Central Interior and Appalachian Floodplain Systems", + "Central Interior and Appalachian Riparian Systems", + "Laurentian-Acadian Floodplain Systems", + "Ozark-Ouachita Riparian", + "South-Central Interior Large Floodplain", + "South-Central Interior Large Floodplain - Forest Modifier", + "South-Central Interior Small Stream and Riparian", + "North-Central Interior and Appalachian Rich Swamp", + "0", + "0", + "Laurentian-Acadian Swamp Systems", + "North-Central Interior Wet Flatwoods", + "0", + "South-Central Interior / Upper Coastal Plain Wet Flatwoods", + "0", + "Southern Piedmont/Ridge and Valley Upland Depression Swamp", + "Atlantic Coastal Plain Blackwater Stream Floodplain Forest - Forest Modifier", + "Atlantic Coastal Plain Brownwater Stream Floodplain Forest", + "Atlantic Coastal Plain Northern Tidal Wooded Swamp", + "Atlantic Coastal Plain Small Blackwater River Floodplain Forest", + "Atlantic Coastal Plain Small Brownwater River Floodplain Forest", + "Atlantic Coastal Plain Southern Tidal Wooded Swamp", + "East Gulf Coastal Plain Large River Floodplain Forest - Forest Modifier", + "East Gulf Coastal Plain Small Stream and River Floodplain Forest", + "East Gulf Coastal Plain Tidal Wooded Swamp", + "0", + "Southeastern Great Plains Riparian Forest", + "Southeastern Great Plains Floodplain Forest", + "Mississippi River Bottomland Depression", + "Mississippi River Floodplain and Riparian Forest", + "Mississippi River Low Floodplain (Bottomland) Forest", + "Mississippi River Riparian Forest", + "Red River Large Floodplain Forest", + "Southern Coastal Plain Blackwater River Floodplain Forest", + "Southern Piedmont Large Floodplain Forest - Forest Modifier", + "Southern Piedmont Small Floodplain and Riparian Forest", + "West Gulf Coastal Plain Large River Floodplain Forest", + "West Gulf Coastal Plain Near-Coast Large River Swamp", + "West Gulf Coastal Plain Small Stream and River Forest", + "Atlantic Coastal Plain Streamhead Seepage Swamp - Pocosin - and Baygall", + "Gulf and Atlantic Coastal Plain Swamp Systems", + "Southern Coastal Plain Hydric Hammock", + "Southern Coastal Plain Seepage Swamp and Baygall", + "West Gulf Coastal Plain Seepage Swamp and Baygall", + "Atlantic Coastal Plain Nonriverine Swamp and Wet Hardwood Forest - Taxodium/Nyssa Modifier", + "Atlantic Coastal Plain Nonriverine Swamp and Wet Hardwood Forest - Oak Dominated Modifier", + "East Gulf Coastal Plain Southern Loblolly-Hardwood Flatwoods", + "Lower Mississippi River Bottomland Depressions - Forest Modifier", + "Lower Mississippi River Flatwoods", + "Northern Atlantic Coastal Plain Basin Swamp and Wet Hardwood Forest", + "Southern Coastal Plain Nonriverine Basin Swamp", + "Southern Coastal Plain Nonriverine Basin Swamp - Okefenokee Bay/Gum Modifier", + "Southern Coastal Plain Nonriverine Basin Swamp - Okefenokee Pine Modifier", + "Southern Coastal Plain Nonriverine Basin Swamp - Okefenokee Taxodium Modifier", + "West Gulf Coastal Plain Nonriverine Wet Hardwood Flatwoods", + "West Gulf Coastal Plain Pine-Hardwood Flatwoods", + "Edwards Plateau Riparian", + "Atlantic Coastal Plain Clay-Based Carolina Bay Forested Wetland", + "Atlantic Coastal Plain Clay-Based Carolina Bay Herbaceous Wetland", + "Atlantic Coastal Plain Southern Wet Pine Savanna and Flatwoods", + "Central Atlantic Coastal Plain Wet Longleaf Pine Savanna and Flatwoods", + "Central Florida Pine Flatwoods", + "East Gulf Coastal Plain Near-Coast Pine Flatwoods", + "East Gulf Coastal Plain Near-Coast Pine Flatwoods - Open Understory Modifier", + "East Gulf Coastal Plain Near-Coast Pine Flatwoods - Scrub/Shrub Understory Modifier", + "South Florida Pine Flatwoods", + "Southern Coastal Plain Nonriverine Cypress Dome", + "West Gulf Coastal Plain Wet Longleaf Pine Savanna and Flatwoods", + "Columbia Basin Foothill Riparian Woodland and Shrubland", + "Great Basin Foothill and Lower Montane Riparian Woodland and Shrubland", + "0", + "Northern Rocky Mountain Conifer Swamp", + "Northern Rocky Mountain Lower Montane Riparian Woodland and Shrubland", + "Rocky Mountain Lower Montane Riparian Woodland and Shrubland", + "Rocky Mountain Montane Riparian Systems", + "Rocky Mountain Subalpine-Montane Riparian Woodland", + "North Pacific Hardwood-Conifer Swamp", + "North Pacific Lowland Riparian Forest and Shrubland", + "North Pacific Montane Riparian Woodland and Shrubland", + "North Pacific Shrub Swamp", + "California Central Valley Riparian Woodland and Shrubland", + "Mediterranean California Foothill and Lower Montane Riparian Woodland", + "Mediterranean California Serpentine Foothill and Lower Montane Riparian Woodland and Seep", + "North American Warm Desert Lower Montane Riparian Woodland and Shrubland", + "North American Warm Desert Riparian Systems", + "North American Warm Desert Riparian Woodland and Shrubland", + "Tamaulipan Floodplain", + "Tamaulipan Riparian Systems", + "Boreal Aspen-Birch Forest", + "Boreal Jack Pine-Black Spruce Forest", + "Boreal White Spruce-Fir-Hardwood Forest", + "Boreal-Laurentian Conifer Acidic Swamp and Treed Poor Fen", + "Eastern Boreal Floodplain", + "South Florida Shell Hash Beach", + "Southeast Florida Beach", + "Southwest Florida Beach", + "South Florida Everglades Sawgrass Marsh", + "South Florida Freshwater Slough and Gator Hole", + "South Florida Wet Marl Prairie", + "California Maritime Chaparral", + "California Mesic Chaparral", + "California Xeric Serpentine Chaparral", + "Klamath-Siskiyou Xeromorphic Serpentine Savanna and Chaparral", + "Mediterranean California Mesic Serpentine Woodland and Chaparral", + "Northern and Central California Dry-Mesic Chaparral", + "Southern California Dry-Mesic Chaparral", + "Southern California Coastal Scrub", + "California Central Valley and Southern Coastal Grassland", + "California Mesic Serpentine Grassland", + "Columbia Basin Foothill and Canyon Dry Grassland", + "Columbia Basin Palouse Prairie", + "North Pacific Alpine and Subalpine Dry Grassland", + "North Pacific Montane Grassland", + "North Pacific Montane Shrubland", + "Northern Rocky Mountain Lower Montane, Foothill and Valley Grassland", + "Northern Rocky Mountain Montane-Foothill Deciduous Shrubland", + "Northern Rocky Mountain Subalpine Deciduous Shrubland", + "Northern Rocky Mountain Subalpine-Upper Montane Grassland", + "Southern Rocky Mountain Montane-Subalpine Grassland", + "Rocky Mountain Gambel Oak-Mixed Montane Shrubland", + "Rocky Mountain Lower Montane-Foothill Shrubland", + "California Northern Coastal Grassland", + "North Pacific Herbaceous Bald and Bluff", + "North Pacific Hypermaritime Shrub and Herbaceous Headland", + "Willamette Valley Upland Prairie and Savanna", + "Mediterranean California Subalpine Meadow", + "Rocky Mountain Subalpine-Montane Mesic Meadow", + "Central Mixedgrass Prairie", + "Northwestern Great Plains Mixedgrass Prairie", + "Western Great Plains Foothill and Piedmont Grassland", + "Western Great Plains Tallgrass Prairie", + "Western Great Plains Sand Prairie", + "Western Great Plains Sandhill Steppe", + "Western Great Plains Mesquite Woodland and Shrubland", + "Western Great Plains Shortgrass Prairie", + "Arkansas Valley Prairie and Woodland", + "Central Tallgrass Prairie", + "North-Central Interior Oak Savanna", + "North-Central Interior Sand and Gravel Tallgrass Prairie", + "North-Central Oak Barrens", + "Northern Tallgrass Prairie", + "Southeastern Great Plains Tallgrass Prairie", + "Texas Blackland Tallgrass Prairie", + "Texas-Louisiana Coastal Prairie", + "Central Appalachian Pine-Oak Rocky Woodland", + "Southern Appalachian Grass and Shrub Bald", + "Southern Appalachian Grass and Shrub Bald - Herbaceous Modifier", + "Southern Appalachian Grass and Shrub Bald - Shrub Modifier", + "Central Appalachian Alkaline Glade and Woodland", + "Central Interior Highlands Calcareous Glade and Barrens", + "Central Interior Highlands Dry Acidic Glade and Barrens", + "Cumberland Sandstone Glade and Barrens", + "Great Lakes Alvar", + "Nashville Basin Limestone Glade", + "Southern Ridge and Valley / Cumberland Dry Calcareous Forest", + "Southern Piedmont Glade and Barrens", + "East Gulf Coastal Plain Black Belt Calcareous Prairie and Woodland - Herbaceous Modifier", + "East Gulf Coastal Plain Jackson Prairie and Woodland", + "Eastern Highland Rim Prairie and Barrens - Dry Modifier", + "Coahuilan Chaparral", + "Madrean Oriental Chaparral", + "Mogollon Chaparral", + "Sonora-Mojave Semi-Desert Chaparral", + "California Montane Woodland and Chaparral", + "Great Basin Semi-Desert Chaparral", + "Florida Dry Prairie", + "Florida Peninsula Inland Scrub", + "West Gulf Coastal Plain Catahoula Barrens", + "West Gulf Coastal Plain Nepheline Syenite Glade", + "East Gulf Coastal Plain Jackson Plain Dry Flatwoods - Open Understory Modifier", + "West Gulf Coastal Plain Northern Calcareous Prairie", + "West Gulf Coastal Plain Southern Calcareous Prairie", + "Acadian-Appalachian Subalpine Woodland and Heath-Krummholz", + "Atlantic and Gulf Coastal Plain Interdunal Wetland", + "Atlantic Coastal Plain Southern Dune and Maritime Grassland", + "Central and Upper Texas Coast Dune and Coastal Grassland", + "East Gulf Coastal Plain Dune and Coastal Grassland", + "Great Lakes Dune", + "Northern Atlantic Coastal Plain Dune and Swale", + "Northern Atlantic Coastal Plain Heathland and Grassland", + "South Texas Dune and Coastal Grassland", + "South Texas Sand Sheet Grassland", + "Southwest Florida Dune and Coastal Grassland", + "North Pacific Coastal Cliff and Bluff", + "North Pacific Maritime Coastal Sand Dune and Strand", + "Northern California Coastal Scrub", + "Mediterranean California Coastal Bluff", + "Mediterranean California Northern Coastal Dune", + "Mediterranean California Southern Coastal Dune", + "Atlantic Coastal Plain Northern Sandy Beach", + "Atlantic Coastal Plain Sea Island Beach", + "Atlantic Coastal Plain Southern Beach", + "Florida Panhandle Beach Vegetation", + "Louisiana Beach", + "Northern Atlantic Coastal Plain Sandy Beach", + "Texas Coastal Bend Beach", + "Upper Texas Coast Beach", + "0", + "Mediterranean California Serpentine Fen", + "Mediterranean California Subalpine-Montane Fen", + "North Pacific Bog and Fen", + "Rocky Mountain Subalpine-Montane Fen", + "Atlantic Coastal Plain Peatland Pocosin", + "Southern and Central Appalachian Bog and Fen", + "Atlantic Coastal Plain Central Fresh-Oligohaline Tidal Marsh", + "Atlantic Coastal Plain Embayed Region Tidal Freshwater Marsh", + "Atlantic Coastal Plain Northern Fresh and Oligohaline Tidal Marsh", + "Florida Big Bend Fresh-Oligohaline Tidal Marsh", + "Atlantic Coastal Plain Depression Pondshore", + "Atlantic Coastal Plain Large Natural Lakeshore", + "Central Florida Herbaceous Pondshore", + "Central Florida Herbaceous Seep", + "East Gulf Coastal Plain Savanna and Wet Prairie", + "East Gulf Coastal Plain Depression Pondshore", + "Floridian Highlands Freshwater Marsh", + "Southern Coastal Plain Herbaceous Seepage Bog", + "Southern Coastal Plain Nonriverine Basin Swamp - Okefenokee Clethra Modifier", + "Southern Coastal Plain Nonriverine Basin Swamp - Okefenokee Nupea Modifier", + "Texas-Louisiana Coastal Prairie Slough", + "Central Interior and Appalachian Shrub-Herbaceous Wetland Systems", + "Great Lakes Coastal Marsh Systems", + "0", + "0", + "Laurentian-Acadian Shrub-Herbaceous Wetland Systems", + "0", + "Eastern Great Plains Wet Meadow, Prairie and Marsh", + "Great Lakes Wet-Mesic Lakeplain Prairie", + "Great Plains Prairie Pothole", + "Western Great Plains Closed Depression Wetland", + "Western Great Plains Depressional Wetland Systems", + "Western Great Plains Open Freshwater Depression Wetland", + "Cumberland Riverscour", + "Inter-Mountain Basins Interdunal Swale Wetland", + "North Pacific Avalanche Chute Shrubland", + "North Pacific Intertidal Freshwater Wetland", + "Temperate Pacific Freshwater Emergent Marsh", + "Temperate Pacific Freshwater Mudflat", + "Columbia Plateau Vernal Pool", + "Northern California Claypan Vernal Pool", + "Northern Rocky Mountain Wooded Vernal Pool", + "Columbia Plateau Silver Sagebrush Seasonally Flooded Shrub-Steppe", + "Rocky Mountain Alpine-Montane Wet Meadow", + "Rocky Mountain Subalpine-Montane Riparian Shrubland", + "Temperate Pacific Montane Wet Meadow", + "Willamette Valley Wet Prairie", + "Chihuahuan-Sonoran Desert Bottomland and Swale Grassland", + "North American Arid West Emergent Marsh", + "North American Warm Desert Riparian Mesquite Bosque", + "Western Great Plains Saline Depression Wetland", + "Acadian Salt Marsh and Estuary Systems", + "Atlantic Coastal Plain Central Salt and Brackish Tidal Marsh", + "Atlantic Coastal Plain Embayed Region Tidal Salt and Brackish Marsh", + "Atlantic Coastal Plain Indian River Lagoon Tidal Marsh", + "Atlantic Coastal Plain Northern Tidal Salt Marsh", + "Florida Big Bend Salt-Brackish Tidal Marsh", + "Gulf and Atlantic Coastal Plain Tidal Marsh Systems", + "Mississippi Sound Salt and Brackish Tidal Marsh", + "Texas Saline Coastal Prairie", + "Temperate Pacific Tidal Salt and Brackish Marsh", + "Inter-Mountain Basins Alkaline Closed Depression", + "Inter-Mountain Basins Greasewood Flat", + "Inter-Mountain Basins Playa", + "North American Warm Desert Playa", + "Apacherian-Chihuahuan Mesquite Upland Scrub", + "Apacherian-Chihuahuan Semi-Desert Grassland and Steppe", + "Chihuahuan Creosotebush, Mixed Desert and Thorn Scrub", + "Chihuahuan Gypsophilous Grassland and Steppe", + "Chihuahuan Loamy Plains Desert Grassland", + "Chihuahuan Mixed Desert and Thorn Scrub", + "Chihuahuan Sandy Plains Semi-Desert Grassland", + "Chihuahuan Stabilized Coppice Dune and Sand Flat Scrub", + "Chihuahuan Succulent Desert Scrub", + "Madrean Juniper Savanna", + "Mojave Mid-Elevation Mixed Desert Scrub", + "North American Warm Desert Active and Stabilized Dune", + "Sonora-Mojave Creosotebush-White Bursage Desert Scrub", + "Sonoran Mid-Elevation Desert Scrub", + "Sonoran Paloverde-Mixed Cacti Desert Scrub", + "Chihuahuan Mixed Salt Desert Scrub", + "Sonora-Mojave Mixed Salt Desert Scrub", + "North American Warm Desert Wash", + "South Texas Lomas", + "Tamaulipan Calcareous Thornscrub", + "Tamaulipan Clay Grassland", + "Tamaulipan Mesquite Upland Scrub", + "Tamaulipan Mixed Deciduous Thornscrub", + "Tamaulipan Savanna Grassland", + "Inter-Mountain Basins Mat Saltbush Shrubland", + "Inter-Mountain Basins Mixed Salt Desert Scrub", + "Inter-Mountain Basins Wash", + "Columbia Plateau Steppe and Grassland", + "Great Basin Xeric Mixed Sagebrush Shrubland", + "Inter-Mountain Basins Big Sagebrush Shrubland", + "Inter-Mountain Basins Big Sagebrush Steppe", + "Inter-Mountain Basins Montane Sagebrush Steppe", + "Colorado Plateau Mixed Low Sagebrush Shrubland", + "Columbia Plateau Low Sagebrush Steppe", + "Columbia Plateau Scabland Shrubland", + "Wyoming Basins Dwarf Sagebrush Shrubland and Steppe", + "Colorado Plateau Blackbrush-Mormon-tea Shrubland", + "Inter-Mountain Basins Semi-Desert Grassland", + "Inter-Mountain Basins Semi-Desert Shrub Steppe", + "Southern Colorado Plateau Sand Shrubland", + "Acadian-Appalachian Alpine Tundra", + "Rocky Mountain Alpine Dwarf-Shrubland", + "Rocky Mountain Alpine Fell-Field", + "Rocky Mountain Alpine Turf", + "Mediterranean California Alpine Dry Tundra", + "Mediterranean California Alpine Fell-Field", + "North Pacific Dry and Mesic Alpine Dwarf-Shrubland, Fell-field and Meadow", + "Rocky Mountain Alpine Tundra/Fell-field/Dwarf-shrub Map Unit", + "Temperate Pacific Intertidal Mudflat", + "Mediterranean California Eelgrass Bed", + "North Pacific Maritime Eelgrass Bed", + "South-Central Interior Large Floodplain - Herbaceous Modifier", + "East Gulf Coastal Plain Large River Floodplain Forest - Herbaceous Modifier", + "Temperate Pacific Freshwater Aquatic Bed", + "Central California Coast Ranges Cliff and Canyon", + "Mediterranean California Serpentine Barrens", + "Southern California Coast Ranges Cliff and Canyon", + "Central Interior Acidic Cliff and Talus", + "Central Interior Calcareous Cliff and Talus", + "East Gulf Coastal Plain Dry Chalk Bluff", + "North-Central Appalachian Acidic Cliff and Talus", + "North-Central Appalachian Circumneutral Cliff and Talus", + "Southern Appalachian Montane Cliff", + "Southern Interior Acid Cliff", + "Southern Interior Calcareous Cliff", + "Southern Piedmont Cliff", + "Southern Appalachian Granitic Dome", + "Southern Appalachian Rocky Summit", + "Southern Piedmont Granite Flatrock", + "Rocky Mountain Cliff, Canyon and Massive Bedrock", + "Klamath-Siskiyou Cliff and Outcrop", + "North Pacific Montane Massive Bedrock, Cliff and Talus", + "North Pacific Serpentine Barren", + "North Pacific Active Volcanic Rock and Cinder Land", + "Sierra Nevada Cliff and Canyon", + "Western Great Plains Badland", + "Southwestern Great Plains Canyon", + "Western Great Plains Cliff and Outcrop", + "North American Warm Desert Badland", + "North American Warm Desert Bedrock Cliff and Outcrop", + "North American Warm Desert Pavement", + "North American Warm Desert Volcanic Rockland", + "Colorado Plateau Mixed Bedrock Canyon and Tableland", + "Columbia Plateau Ash and Tuff Badland", + "Geysers and Hot Springs", + "Inter-Mountain Basins Active and Stabilized Dune", + "Inter-Mountain Basins Cliff and Canyon", + "Inter-Mountain Basins Shale Badland", + "Inter-Mountain Basins Volcanic Rock and Cinder Land", + "Rocky Mountain Alpine Bedrock and Scree", + "Mediterranean California Alpine Bedrock and Scree", + "North Pacific Alpine and Subalpine Bedrock and Scree", + "Unconsolidated Shore", + "Undifferentiated Barren Land", + "North American Alpine Ice Field", + "Orchards Vineyards and Other High Structure Agriculture", + "Cultivated Cropland", + "Pasture/Hay", + "Introduced Upland Vegetation - Annual Grassland", + "Introduced Upland Vegetation - Perennial Grassland and Forbland", + "Modified/Managed Southern Tall Grassland", + "Introduced Upland Vegetation - Shrub", + "Introduced Riparian and Wetland Vegetation", + "Introduced Upland Vegetation - Treed", + "0", + "Disturbed, Non-specific", + "Recently Logged Areas", + "Harvested Forest - Grass/Forb Regeneration", + "Harvested Forest-Shrub Regeneration", + "Harvested Forest - Northwestern Conifer Regeneration", + "Recently Burned", + "Recently burned grassland", + "Recently burned shrubland", + "Recently burned forest", + "Disturbed/Successional - Grass/Forb Regeneration", + "Disturbed/Successional - Shrub Regeneration", + "Disturbed/Successional - Recently Chained Pinyon-Juniper", + "Open Water (Aquaculture)", + "Open Water (Brackish/Salt)", + "Open Water (Fresh)", + "Quarries, Mines, Gravel Pits and Oil Wells", + "Developed, Open Space", + "Developed, Low Intensity", + "Developed, Medium Intensity", + "Developed, High Intensity" + ] + } + ] + }, + "description": "The USGS GAP/LANDFIRE National Terrestrial Ecosystems data, based on the NatureServe Ecological Systems Classification, are the foundation of the most detailed, consistent map of vegetation available for the United States. These data facilitate planning and management for biological diversity on a regional and national scale.\\n\\nThis dataset includes the land cover component of the GAP Analyais project.\\n\\n", + "item_assets": { + "data": { + "type": "image/tiff; application=geotiff; profile=cloud-optimized", + "roles": [ + "data" + ], + "title": "GeoTIFF data" + } + }, + "stac_version": "1.0.0", + "msft:container": "usgs-gap", + "stac_extensions": [ + "https://stac-extensions.github.io/label/v1.0.0/schema.json", + "https://stac-extensions.github.io/item-assets/v1.0.0/schema.json" + ], + "msft:storage_account": "ai4edataeuwest", + "msft:short_description": "US-wide land cover information for 2011" +} diff --git a/tests/test_client.py b/tests/test_client.py index 48dcef4e..83ee40ca 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,4 +1,5 @@ from datetime import datetime +from urllib.parse import urlsplit, parse_qs from dateutil.tz import tzutc import pystac @@ -97,13 +98,52 @@ def test_get_collections_with_conformance(self, requests_mock): "collections": [pc_collection_dict], "links": [] }) - _ = next(api.get_collections()) history = requests_mock.request_history assert len(history) == 2 assert history[1].url == collections_link.href + def test_custom_request_parameters(self, requests_mock): + pc_root_text = read_data_file("planetary-computer-root.json") + pc_collection_dict = read_data_file("planetary-computer-collection.json", parse_json=True) + + requests_mock.get(STAC_URLS["PLANETARY-COMPUTER"], status_code=200, text=pc_root_text) + + init_qp_name = "my-param" + init_qp_value = "some-value" + + api = Client.open(STAC_URLS['PLANETARY-COMPUTER'], parameters={init_qp_name: init_qp_value}) + + # Ensure that the the Client will use the /collections endpoint and not fall back + # to traversing child links. + assert api._stac_io.conforms_to(ConformanceClasses.COLLECTIONS) + + # Get the /collections endpoint + collections_link = api.get_single_link("data") + + # Mock the request + requests_mock.get(collections_link.href, + status_code=200, + json={ + "collections": [pc_collection_dict], + "links": [] + }) + + # Make the collections request + _ = next(api.get_collections()) + + history = requests_mock.request_history + assert len(history) == 2 + + actual_qs = urlsplit(history[1].url).query + actual_qp = parse_qs(actual_qs) + + # Check that the param from the init method is present + assert init_qp_name in actual_qp + assert len(actual_qp[init_qp_name]) == 1 + assert actual_qp[init_qp_name][0] == init_qp_value + def test_get_collections_without_conformance(self, requests_mock): """Checks that the "data" endpoint is used if the API published the collections conformance class.""" pc_root_dict = read_data_file("planetary-computer-root.json", parse_json=True) From a01f4c8babd7c84d716c93d049213cea7e88b4be Mon Sep 17 00:00:00 2001 From: Jon Duckworth Date: Wed, 17 Nov 2021 15:29:21 -0500 Subject: [PATCH 5/5] Added CHANGELOG entry for #118 --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 186f5401..8eab8415 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Adds `--block-network` option to all test commands to ensure no network requests are made during unit tests [#119](https://github.com/stac-utils/pystac-client/pull/119) +- `parameters` argument to `StacApiIO`, `Client.open`, and `Client.from_file` to allow query string parameters to be passed to all requests + [#118](https://github.com/stac-utils/pystac-client/pull/118) ### Fixed