From be70cf2d18d6c658dd0eeb064c8415092d8c8ece Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 05:23:26 +1000 Subject: [PATCH 1/6] Update OrderResult and DetailedOrderResult to rename `imagery_id` to `ordering_id` --- arlulacore/orders.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arlulacore/orders.py b/arlulacore/orders.py index 616069b..823ca49 100644 --- a/arlulacore/orders.py +++ b/arlulacore/orders.py @@ -42,7 +42,7 @@ class OrderResult(ArlulaObject): created_at: datetime updated_at: datetime supplier: str - imagery_id: str + ordering_id: str scene_id: str status: str total: int @@ -54,7 +54,7 @@ def __init__(self, data): self.created_at = parse_rfc3339(data["createdAt"]) self.updated_at = parse_rfc3339(data["updatedAt"]) self.supplier = data["supplier"] - self.imagery_id = data["imageryID"] + self.ordering_id = data["orderingID"] self.scene_id = data["sceneID"] self.status = data["status"] self.total = data["total"] @@ -66,7 +66,7 @@ class DetailedOrderResult(ArlulaObject): created_at: datetime updated_at: datetime supplier: str - imagery_id: str + ordering_id: str scene_id: str status: str total: int @@ -79,7 +79,7 @@ def __init__(self, data): self.created_at = parse_rfc3339(data["createdAt"]) self.updated_at = parse_rfc3339(data["updatedAt"]) self.supplier = data["supplier"] - self.imagery_id = data["imageryID"] + self.ordering_id = data["orderingID"] self.scene_id = data["sceneID"] self.status = data["status"] self.total = data["total"] From 70cc3a4f447afae868f862ab91ce6facd9ed8e23 Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 05:49:11 +1000 Subject: [PATCH 2/6] Update previous commit to allow backwards compatibility with old name --- arlulacore/orders.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/arlulacore/orders.py b/arlulacore/orders.py index 823ca49..d0d86ca 100644 --- a/arlulacore/orders.py +++ b/arlulacore/orders.py @@ -54,7 +54,11 @@ def __init__(self, data): self.created_at = parse_rfc3339(data["createdAt"]) self.updated_at = parse_rfc3339(data["updatedAt"]) self.supplier = data["supplier"] - self.ordering_id = data["orderingID"] + # TODO For backwards compatibility + if "orderingID" in data: + self.ordering_id = data["orderingID"] + elif "imageryID" in data: + self.ordering_id = data["imageryID"] self.scene_id = data["sceneID"] self.status = data["status"] self.total = data["total"] @@ -79,7 +83,12 @@ def __init__(self, data): self.created_at = parse_rfc3339(data["createdAt"]) self.updated_at = parse_rfc3339(data["updatedAt"]) self.supplier = data["supplier"] - self.ordering_id = data["orderingID"] + # TODO For backwards compatibility + if "orderingID" in data: + self.ordering_id = data["orderingID"] + elif "imageryID" in data: + self.ordering_id = data["imageryID"] + self.scene_id = data["sceneID"] self.status = data["status"] self.total = data["total"] From 19fd3b3d133d24cf165d8aea0e86668ecbf3e2d5 Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 05:52:51 +1000 Subject: [PATCH 3/6] Update README to use gsd not resolution --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f5ae759..71e4e15 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,11 @@ api = arlulacore.ArlulaAPI(arlula_session) archive = api.archiveAPI() # Search for imagery around sydney between 2020-Jan-1 and 2020-Feb-1 -# With at least 10m resolution +# With at least 10m resolution (gsd) search_result = archive.search( arlulacore.SearchRequest( start=date(2020, 1, 1), - res=10, + gsd=10, ) .set_point_of_interest(-33.8688, 151.2093) .set_end(date(2020, 2, 1)) From 55a8a4739b5ec308a2a705fc7fa0569c778fc98f Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 05:53:25 +1000 Subject: [PATCH 4/6] Update archive api to accept gsd instead of resolution --- arlulacore/archive.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arlulacore/archive.py b/arlulacore/archive.py index 2e70eab..110ae0a 100644 --- a/arlulacore/archive.py +++ b/arlulacore/archive.py @@ -150,7 +150,7 @@ def __init__(self, data): class SearchRequest(ArlulaObject): start: date - res: float + gsd: float end: date lat: float long: float @@ -163,7 +163,7 @@ class SearchRequest(ArlulaObject): cloud: float def __init__(self, start: date, - res: float, + gsd: float, cloud: typing.Optional[float] = None, end: typing.Optional[date] = None, lat: typing.Optional[float] = None, @@ -176,7 +176,7 @@ def __init__(self, start: date, off_nadir: typing.Optional[float] = None): self.start = start self.cloud = cloud - self.res = res + self.gsd = gsd self.end = end self.lat = lat self.long = long @@ -203,8 +203,8 @@ def set_supplier(self, supplier: str) -> "SearchRequest": self.supplier = supplier return self - def set_maximum_resolution(self, res: float) -> "SearchRequest": - self.res = res + def set_maximum_gsd(self, gsd: float) -> "SearchRequest": + self.gsd = gsd return self def set_start(self, start: date) -> "SearchRequest": @@ -232,7 +232,8 @@ def dict(self): param_dict = { "start": str(self.start) if self.start != None else None, "end": str(self.end) if self.end != None else None, - "res": self.res, "cloud": self.cloud, + # TODO remove res later, included for backwards compatibility + "gsd": self.gsd, "res": self.gsd, "cloud": self.cloud, "lat": self.lat, "long": self.long, "north": self.north, "south": self.south, "east": self.east, "west": self.west, "supplier": self.supplier, "off-nadir": self.off_nadir} From 781fd04e03de7d68fd6f72303e0a9a926b1e9045 Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 06:02:11 +1000 Subject: [PATCH 5/6] Update tests to account for backwards compatibility --- tests/test_archive.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_archive.py b/tests/test_archive.py index e7d6d19..f331788 100644 --- a/tests/test_archive.py +++ b/tests/test_archive.py @@ -17,7 +17,9 @@ def test_to_dict(self): .dict(), { "start": "2021-01-01", - "res": 100 + # TODO backwards compatibility, remove after update 2022-07 + "res": 100, + "gsd": 100 } ) @@ -32,6 +34,7 @@ def test_to_dict(self): "east": 10, "west": 20, "res": 100, + "gsd": 100, } ) @@ -41,7 +44,9 @@ def test_to_dict(self): .dict(), { "start": "2021-01-01", + # TODO backwards compatibility, remove after update 2022-07 "res": 100, + "gsd": 100, "lat": 0, "long": 10, } @@ -58,7 +63,9 @@ def test_to_dict(self): { "start": "2021-01-01", "end": "2021-02-01", + # TODO backwards compatibility, remove after update 2022-07 "res": 100, + "gsd": 100, "lat": 0, "long": 10, "cloud": 10, @@ -73,7 +80,9 @@ def test_to_dict(self): { "start": "2021-01-01", "end": "2021-02-01", + # TODO backwards compatibility, remove after update 2022-07 "res": 0, + "gsd": 0, "cloud": 10, "lat": 20, "long": 30, From 0a94d62370fe3fb61395a5a63eb02d36320b767f Mon Sep 17 00:00:00 2001 From: Harrison Steyn Date: Tue, 5 Jul 2022 06:45:02 +1000 Subject: [PATCH 6/6] Bump Version --- arlulacore/auth.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arlulacore/auth.py b/arlulacore/auth.py index d46c99a..f5a3406 100644 --- a/arlulacore/auth.py +++ b/arlulacore/auth.py @@ -10,7 +10,7 @@ name = "arlulacore" # User agent setting -sdk_version = "2.0.3" +sdk_version = "3.0.1" py_version = sys.version.split(' ')[0] os_version = platform.platform() def_ua = "core-sdk " + \ diff --git a/setup.py b/setup.py index e997c83..355eeb4 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name='arlulacore', - version='3.0.0', + version='3.0.1', author="Arlula", author_email="tech@arlula.com", description="A package to facilitate access to the Arlula Imagery Marketplace API",