Skip to content

Commit

Permalink
Merge pull request #9 from Arlula/3.0.1
Browse files Browse the repository at this point in the history
Version 3.0.1 - Updates to gsd and orderingID fields
  • Loading branch information
Maldris authored Jul 8, 2022
2 parents d8cd665 + 0a94d62 commit 3139082
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 15 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
13 changes: 7 additions & 6 deletions arlulacore/archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def __init__(self, data):

class SearchRequest(ArlulaObject):
start: date
res: float
gsd: float
end: date
lat: float
long: float
Expand All @@ -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,
Expand All @@ -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
Expand All @@ -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":
Expand Down Expand Up @@ -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}
Expand Down
2 changes: 1 addition & 1 deletion arlulacore/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 " + \
Expand Down
17 changes: 13 additions & 4 deletions arlulacore/orders.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.imagery_id = data["imageryID"]
# 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"]
Expand All @@ -66,7 +70,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
Expand All @@ -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.imagery_id = data["imageryID"]
# 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"]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name='arlulacore',
version='3.0.0',
version='3.0.1',
author="Arlula",
author_email="[email protected]",
description="A package to facilitate access to the Arlula Imagery Marketplace API",
Expand Down
11 changes: 10 additions & 1 deletion tests/test_archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
)

Expand All @@ -32,6 +34,7 @@ def test_to_dict(self):
"east": 10,
"west": 20,
"res": 100,
"gsd": 100,
}
)

Expand All @@ -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,
}
Expand All @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 3139082

Please sign in to comment.