eodash_catalog 0.0.7__py3-none-any.whl → 0.0.9__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of eodash_catalog might be problematic. Click here for more details.
- eodash_catalog/__about__.py +1 -1
- eodash_catalog/duration.py +7 -18
- eodash_catalog/endpoints.py +669 -0
- eodash_catalog/generate_indicators.py +108 -1267
- eodash_catalog/sh_endpoint.py +1 -0
- eodash_catalog/stac_handling.py +359 -0
- eodash_catalog/thumbnails.py +49 -0
- eodash_catalog/utils.py +71 -45
- {eodash_catalog-0.0.7.dist-info → eodash_catalog-0.0.9.dist-info}/METADATA +45 -2
- eodash_catalog-0.0.9.dist-info/RECORD +14 -0
- {eodash_catalog-0.0.7.dist-info → eodash_catalog-0.0.9.dist-info}/WHEEL +1 -1
- eodash_catalog-0.0.7.dist-info/RECORD +0 -11
- {eodash_catalog-0.0.7.dist-info → eodash_catalog-0.0.9.dist-info}/entry_points.txt +0 -0
- {eodash_catalog-0.0.7.dist-info → eodash_catalog-0.0.9.dist-info}/licenses/LICENSE.txt +0 -0
eodash_catalog/__about__.py
CHANGED
eodash_catalog/duration.py
CHANGED
|
@@ -4,8 +4,9 @@ This module defines a Duration class.
|
|
|
4
4
|
The class Duration allows to define durations in years and months and can be
|
|
5
5
|
used as limited replacement for timedelta objects.
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
from datetime import timedelta
|
|
8
|
-
from decimal import
|
|
9
|
+
from decimal import ROUND_FLOOR, Decimal
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
def fquotmod(val, low, high):
|
|
@@ -82,9 +83,7 @@ class Duration:
|
|
|
82
83
|
years = Decimal(str(years))
|
|
83
84
|
self.months = months
|
|
84
85
|
self.years = years
|
|
85
|
-
self.tdelta = timedelta(
|
|
86
|
-
days, seconds, microseconds, milliseconds, minutes, hours, weeks
|
|
87
|
-
)
|
|
86
|
+
self.tdelta = timedelta(days, seconds, microseconds, milliseconds, minutes, hours, weeks)
|
|
88
87
|
|
|
89
88
|
def __getstate__(self):
|
|
90
89
|
return self.__dict__
|
|
@@ -167,13 +166,8 @@ class Duration:
|
|
|
167
166
|
carry, newmonth = fquotmod(newmonth, 1, 13)
|
|
168
167
|
newyear = other.year + self.years + carry
|
|
169
168
|
maxdays = max_days_in_month(newyear, newmonth)
|
|
170
|
-
if other.day > maxdays
|
|
171
|
-
|
|
172
|
-
else:
|
|
173
|
-
newday = other.day
|
|
174
|
-
newdt = other.replace(
|
|
175
|
-
year=int(newyear), month=int(newmonth), day=int(newday)
|
|
176
|
-
)
|
|
169
|
+
newday = maxdays if other.day > maxdays else other.day
|
|
170
|
+
newdt = other.replace(year=int(newyear), month=int(newmonth), day=int(newday))
|
|
177
171
|
# does a timedelta + date/datetime
|
|
178
172
|
return self.tdelta + newdt
|
|
179
173
|
except AttributeError:
|
|
@@ -252,13 +246,8 @@ class Duration:
|
|
|
252
246
|
carry, newmonth = fquotmod(newmonth, 1, 13)
|
|
253
247
|
newyear = other.year - self.years + carry
|
|
254
248
|
maxdays = max_days_in_month(newyear, newmonth)
|
|
255
|
-
if other.day > maxdays
|
|
256
|
-
|
|
257
|
-
else:
|
|
258
|
-
newday = other.day
|
|
259
|
-
newdt = other.replace(
|
|
260
|
-
year=int(newyear), month=int(newmonth), day=int(newday)
|
|
261
|
-
)
|
|
249
|
+
newday = maxdays if other.day > maxdays else other.day
|
|
250
|
+
newdt = other.replace(year=int(newyear), month=int(newmonth), day=int(newday))
|
|
262
251
|
return newdt - self.tdelta
|
|
263
252
|
except AttributeError:
|
|
264
253
|
# other probably was not compatible with data/datetime
|