Skip to content

Commit

Permalink
updated porder v0.8.3
Browse files Browse the repository at this point in the history
- Fixed bundle parsing
- Updated based bundles
  • Loading branch information
samapriya committed Jun 29, 2021
1 parent af83566 commit a4c01bc
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 62 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,10 @@ A simple setup would be

## Changelog

### v0.8.3
- Fixed bundle parsing
- Updated based bundles

### v0.8.2
- [Pull request 48](https://github.com/tyson-swetnam/porder/pull/48)
- fixes typos and equations for bandmath and includes additional reference information
Expand Down
Binary file removed dist/porder-0.8.2.tar.gz
Binary file not shown.
Binary file not shown.
Binary file added dist/porder-0.8.3.tar.gz
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

### v0.8.3
- Fixed bundle parsing
- Updated based bundles

### v0.8.2
- [Pull request 48](https://github.com/tyson-swetnam/porder/pull/48)
- fixes typos and equations for bandmath and includes additional reference information
Expand Down
2 changes: 1 addition & 1 deletion porder/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

__author__ = "Samapriya Roy"
__email__ = "[email protected]"
__version__ = "0.8.2"
__version__ = "0.8.3"
51 changes: 1 addition & 50 deletions porder/bundles.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,39 +107,6 @@
]
}
},
"analytic_5b": {
"name": "Analytic Image",
"description": "Radiometrically-calibrated analytic image stored as 16-bit scaled radiance",
"bands": "all",
"rectification": "orthorectified",
"radiometry": "at-sensor",
"fileType": "GeoTIFF",
"auxiliaryFiles": "udm",
"assets": {
"PSOrthoTile": [
"analytic_5b",
"analytic_5b_xml",
"udm"
]
}
},
"analytic_5b_udm2": {
"name": "Analytic Image",
"description": "Radiometrically-calibrated analytic image stored as 16-bit scaled radiance. Includes udm2",
"bands": "all",
"rectification": "orthorectified",
"radiometry": "at-sensor",
"fileType": "GeoTIFF",
"auxiliaryFiles": "udm and udm2",
"assets": {
"PSOrthoTile": [
"analytic_5b",
"analytic_5b_xml",
"udm",
"udm2"
]
}
},
"visual": {
"name": "Visual",
"description": "Orthorectified product, visually enhanced for optimal appearance",
Expand Down Expand Up @@ -369,16 +336,6 @@
"udm",
"analytic_xml"
],
"PSOrthoTile": [
"analytic_sr",
"udm",
"analytic_xml"
],
"REOrthoTile": [
"analytic_sr",
"udm",
"analytic_xml"
],
"MOD09GQ": [
"analytic_num_observations",
"analytic_orbit_pnt",
Expand Down Expand Up @@ -463,12 +420,6 @@
"analytic_xml",
"udm",
"udm2"
],
"PSOrthoTile": [
"analytic_sr",
"udm",
"udm2",
"analytic_xml"
]
}
},
Expand Down Expand Up @@ -698,5 +649,5 @@
}
}
},
"version": "2020-03-10"
"version": "02-20-20"
}
18 changes: 8 additions & 10 deletions porder/porder.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import platform
import datetime
import pkg_resources
import dateutil.parser
from bs4 import BeautifulSoup
from pySmartDL import SmartDL
from os.path import expanduser
Expand Down Expand Up @@ -351,18 +352,15 @@ def idsplit_from_parser(args):

# Get package version
def bundles(item):
url = "https://developers.planet.com/docs/orders/product-bundles-reference/"
html = requests.get(url).text
soup = BeautifulSoup(html, "html.parser")
url = "https://developers.planet.com/theme/js/scrub_all_bundles_bundle_spec.json"
date_response = requests.get(url).json()
ref_date = dateutil.parser.parse(date_response['version'])
with open(os.path.join(lpath, "bundles.json")) as f:
r = json.load(f)
current = r["version"]
curr_date = datetime.datetime.strptime(current, "%Y-%m-%d")
for detail in soup.find_all("em"):
release = detail.text.split(":")[1].strip()
ref_date = datetime.datetime.strptime(release, "%Y-%m-%d")
r=json.load(f)
current= r['version']
curr_date = dateutil.parser.parse(current)
if curr_date < ref_date:
print("Refreshing bundles to " + "\n" + str(release))
print("Refreshing bundles to " + "\n" + str(date_response['version']))
try:
url = "https://developers.planet.com/theme/js/scrub_all_bundles_bundle_spec.json"
dest = os.path.join(lpath, "bundles.json")
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def readme():
return f.read()
setuptools.setup(
name='porder',
version='0.8.2',
version='0.8.3',
packages=['porder'],
url='https://github.com/samapriya/porder',
package_data={'': ['bundles.json']},
Expand Down

0 comments on commit a4c01bc

Please sign in to comment.