Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Candidate for Fields Change #437

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3029136
atl24 cleanup for latest tools
elidwa Oct 2, 2024
90e482b
Icesat2Fields replacing Icesat2Parms
jpswinski Oct 3, 2024
5d92e61
removed Icesat2Parms
jpswinski Oct 3, 2024
2ca5974
created perf tests for different datasets
elidwa Oct 5, 2024
3e89a75
fixed debug statement
elidwa Oct 5, 2024
e1a1452
Fixed bug in poi time in arrow sampler, bug fixes
elidwa Oct 5, 2024
22dc8db
disabled debug stuff
elidwa Oct 7, 2024
86dbabb
fixed ortho_h being set to zero when surface_h is zero on negative; f…
jpswinski Oct 7, 2024
551d9e7
using GEOS Rtree for features
elidwa Oct 7, 2024
25137f3
fixed request fields poly; updated parquet tests to include other end…
jpswinski Oct 8, 2024
1a55f6f
Implemented GeoRtree class
elidwa Oct 8, 2024
7209f68
remove request parms, icesat2 parms, gedi parms, swot parms
jpswinski Oct 8, 2024
6c15546
debug build clean up
jpswinski Oct 8, 2024
680a5fb
Rtree completly replaced vector of features, sorting added
elidwa Oct 8, 2024
0922103
fixed comment
elidwa Oct 8, 2024
39ca549
implemented sort_by_index geoparm, updated all lua tests
elidwa Oct 9, 2024
4980d43
removed index file bbox check
elidwa Oct 9, 2024
15e8de4
implemented CreFields, ArrowFields
jpswinski Oct 9, 2024
ea74997
removed tojson
jpswinski Oct 9, 2024
3e87a4e
fixed field enumeration to lua
jpswinski Oct 9, 2024
78b2756
reverting a few of the changes associated with the static analysis cl…
jpswinski Oct 9, 2024
7f3ee85
Merge branch 'atl24-cleanup' into mc
jpswinski Oct 9, 2024
2af1274
resolved merge conflicts with main
jpswinski Oct 9, 2024
2a05e51
changed arrow sampler tests to use request parameters instead of arro…
jpswinski Oct 10, 2024
6482baa
updated geo package to use geo fields
jpswinski Oct 10, 2024
ca00b48
remove GeoParms
jpswinski Oct 10, 2024
e08fc95
static analysis clean up
jpswinski Oct 11, 2024
e26695b
updated github actions
jpswinski Oct 11, 2024
d9200ba
working through issues with std map and emplace insertion
jpswinski Oct 11, 2024
2521f4e
using dictionary of pointers in field map to avoid copy constructors
jpswinski Oct 11, 2024
abeb9ed
cleaned up memory leak in region mask
jpswinski Oct 11, 2024
b5527d1
fixed issues with geo parms
jpswinski Oct 11, 2024
e1c034e
fixed bug in geo fields for sampling radius
jpswinski Oct 11, 2024
d773bde
fixed proxy for samplers
jpswinski Oct 11, 2024
39774a1
updated GEDI parameters to match new parameter names
jpswinski Oct 14, 2024
2eaaeac
fixing issues with pytests
jpswinski Oct 14, 2024
0da7124
fixed stage atl08 in icesat2 parms
jpswinski Oct 14, 2024
de68e99
better error handling when catalog and resource are invalid
jpswinski Oct 15, 2024
f563c22
removed resource check in icesat2 fields so that default parms will work
jpswinski Oct 15, 2024
7731fb7
fixed error message in earth data selftest
jpswinski Oct 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,23 @@ jobs:
permissions:
id-token: write
contents: read

steps:
- name: Checkout CoastNet
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-coastnet

- name: Checkout Qtrees
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-qtrees

- name: Checkout OpenOceans++
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-oopp

- name: Checkout SlideRule Repository
uses: actions/checkout@v3

Expand All @@ -30,7 +45,7 @@ jobs:
make cluster-upload-terraform

- name: Set Up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@v3

- name: Setup Docker Environment
run: |
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,21 @@ jobs:
language: [ 'cpp' ]

steps:
- name: Checkout CoastNet
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-coastnet

- name: Checkout Qtrees
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-qtrees

- name: Checkout OpenOceans++
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-oopp

- name: Checkout repository
uses: actions/checkout@v3

Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/self_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,21 @@ jobs:
container: ghcr.io/slideruleearth/sliderule-buildenv:latest

steps:
- name: Checkout CoastNet
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-coastnet

- name: Checkout Qtrees
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-qtrees

- name: Checkout OpenOceans++
uses: actions/checkout@v3
with:
repository: SlideRuleEarth/ut-ATL24-oopp

- name: Checkout sliderule repository
uses: actions/checkout@v3

Expand Down
3 changes: 0 additions & 3 deletions clients/python/sliderule/gedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@
# profiling times for each major function
profiles = {}

# gedi parameters
ALL_BEAMS = -1

###############################################################################
# LOCAL FUNCTIONS
###############################################################################
Expand Down
34 changes: 17 additions & 17 deletions clients/python/sliderule/sliderule.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,12 +584,12 @@ def procoutputfile(parm, rsps):
# Handle Local Files
if "open_on_complete" in output and output["open_on_complete"]:
if output["format"] == "parquet":
if "as_geo" in output and not output["as_geo"]:
# Return Parquet File as DataFrame
return geopandas.pd.read_parquet(path)
else:
if "as_geo" in output and output["as_geo"]:
# Return GeoParquet File as GeoDataFrame
return geopandas.read_parquet(path)
else:
# Return Parquet File as DataFrame
return geopandas.pd.read_parquet(path)
elif output["format"] == "geoparquet":
# Return Parquet File as DataFrame
return geopandas.pd.read_parquet(path)
Expand Down Expand Up @@ -681,7 +681,7 @@ def todataframe(columns, time_key="time", lon_key="longitude", lat_key="latitude
def simplifypolygon(parm):
if "parms" not in parm:
return

if "cmr" in parm["parms"]:
polygon = parm["parms"]["cmr"]["polygon"]
elif "poly" in parm["parms"]:
Expand All @@ -702,9 +702,9 @@ def simplifypolygon(parm):
simplified_polygon.insert(0, point)

if "cmr" not in parm["parms"]:
parm["parms"]["cmr"] = {}
parm["parms"]["cmr"] = {}
parm["parms"]["cmr"]["polygon"] = simplified_polygon

logger.warning('Using simplified polygon (for CMR request only!), {} points using tolerance of {}'.format(len(simplified_coords), tolerance))

#
Expand All @@ -722,13 +722,13 @@ def rethrow():
# Initialize
#
def init (
url=PUBLIC_URL,
verbose=False,
loglevel=logging.INFO,
organization=0,
desired_nodes=None,
time_to_live=60,
bypass_dns=False,
url=PUBLIC_URL,
verbose=False,
loglevel=logging.INFO,
organization=0,
desired_nodes=None,
time_to_live=60,
bypass_dns=False,
plugins=[],
trust_env=DEFAULT_TRUST_ENV,
log_handler=None,
Expand Down Expand Up @@ -1414,7 +1414,7 @@ def toregion(source, tolerance=0.0, cellsize=0.01, n_clusters=1):

"poly": [{"lat": <lat1>, "lon": <lon1> }, ...],

"raster": {"data": <geojson file as string>,
"region_mask": {"data": <geojson file as string>,

"clusters": [[{"lat": <lat1>, "lon": <lon1>}, ...], [{"lat": <lat1>, "lon": <lon1>}, ...]] }

Expand Down Expand Up @@ -1564,8 +1564,8 @@ def toregion(source, tolerance=0.0, cellsize=0.01, n_clusters=1):
"gdf": gdf,
"poly": polygon, # convex hull of polygons
"clusters": clusters, # list of polygon clusters for cmr request
"raster": {
"data": datafile, # geojson file
"region_mask": {
"geojson": datafile, # geojson file
"length": len(datafile), # geojson file length
"cellsize": cellsize # units are in crs/projection
}
Expand Down
14 changes: 7 additions & 7 deletions clients/python/tests/test_3dep.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ def test_sample(self, init):
def test_as_numpy_array(self, init):
parms = {
"poly": region,
"degrade_flag": 0,
"l2_quality_flag": 1,
"beam": 0,
"degrade_filter": True,
"l2_quality_filter": True,
"beams": 0,
"samples": {"3dep": {"asset": "usgs3dep-1meter-dem"}}
}
gdf = gedi.gedi04ap(parms, resources=['GEDI04_A_2019123154305_O02202_03_T00174_02_002_02_V002.h5'], as_numpy_array=True)
Expand All @@ -38,9 +38,9 @@ def test_as_numpy_array(self, init):
def test_as_variable(self, init):
parms = {
"poly": region,
"degrade_flag": 0,
"l2_quality_flag": 1,
"beam": 0,
"degrade_filter": True,
"l2_quality_filter": True,
"beams": 0,
"samples": {"3dep": {"asset": "usgs3dep-1meter-dem"}}
}
gdf = gedi.gedi04ap(parms, resources=['GEDI04_A_2019123154305_O02202_03_T00174_02_002_02_V002.h5'], as_numpy_array=False)
Expand All @@ -51,4 +51,4 @@ def test_as_variable(self, init):
for entry in gdf[key]:
if (type(entry) != numpy.ndarray) and (not math.isnan(entry)):
non_array_count += 1
assert non_array_count > 0
assert non_array_count > 0
14 changes: 7 additions & 7 deletions clients/python/tests/test_defaults.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for sliderule APIs."""

import pytest
import sliderule
from sliderule import sliderule, icesat2

#
# Default parms
Expand All @@ -11,9 +11,9 @@ class TestDefaultParms:
def test_parms(self, init):
d = sliderule.source("defaults")
assert init
assert d["output"]["as_geo"]
assert d["cre"]["timeout"] == 600
assert d["samples"]["sampling_algo"] == "NearestNeighbour"
assert d["rqst"]["cluster_size_hint"] == 0
assert d["icesat2"]["surface_type"] == "SRT_LAND_ICE"
assert d["gedi"]["projection"] == "AUTOMATIC"
assert d["icesat2"]["output"]["as_geo"] == False, f'icesat2 output has invalid as_geo field: {d["icesat2"]["output"]}'
assert d["cre"]["timeout"] == 600, f'container runtime environment has invalid timeout: {d["cre"]}'
assert len(d["core"]["samples"]) == 0, f'core has invalid samples parameters: {d["core"]["samples"]}'
assert d["core"]["cluster_size_hint"] == 0, f'core has invalid cluster size hint: {d["core"]["cluster_size_hint"]}'
assert d["icesat2"]["srt"] == "land_ice", f'icesat2 has invalid surface reference type: {d["icesat2"]["srt"]}'
assert d["gedi"]["projection"] == "auto", f'gedi has invalid projection: {d["gedi"]["projection"]}'
18 changes: 9 additions & 9 deletions clients/python/tests/test_gedi.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ def test_gedi(self, init):
region = sliderule.toregion(os.path.join(TESTDIR, "data/grandmesa.geojson"))
parms = {
"poly": region["poly"],
"degrade_flag": 0,
"quality_flag": 1,
"beam": 0
"degrade_filter": True,
"quality_filter": True,
"beams": 0
}
gdf = gedi.gedi01bp(parms, resources=[resource])
assert init
Expand All @@ -41,9 +41,9 @@ def test_gedi(self, init):
region = sliderule.toregion(os.path.join(TESTDIR, "data/grandmesa.geojson"))
parms = {
"poly": region["poly"],
"degrade_flag": 0,
"quality_flag": 1,
"beam": 0
"degrade_filter": True,
"quality_filter": True,
"beams": 0
}
gdf = gedi.gedi02ap(parms, resources=[resource])
assert init
Expand Down Expand Up @@ -90,9 +90,9 @@ def test_gedi(self, init):
region = sliderule.toregion(os.path.join(TESTDIR, "data/grandmesa.geojson"))
parms = {
"poly": region["poly"],
"degrade_flag": 0,
"l2_quality_flag": 1,
"beam": 0
"degrade_filter": True,
"l2_quality_filter": True,
"beams": 0
}
gdf = gedi.gedi04ap(parms, resources=[resource])
assert init
Expand Down
2 changes: 1 addition & 1 deletion clients/python/tests/test_geojson.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def test_atl03(self, init):
region = sliderule.toregion(os.path.join(TESTDIR, testfile))
parms = {
"poly": region["poly"],
"raster": region["raster"],
"region_mask": region["region_mask"],
"srt": icesat2.SRT_LAND,
"cnf": icesat2.CNF_SURFACE_HIGH,
"ats": 10.0,
Expand Down
11 changes: 4 additions & 7 deletions clients/python/tests/test_luaerr.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,24 @@ class TestAtl03s:
def test_badasset(self, init):
invalid_asset = "invalid-asset"
rqst = {
"resource": [],
"parms": {"asset" : "invalid-asset"}
"resource": [], # invalid resource (should be resources if a list)
"parms": {"asset" : invalid_asset} # bogus asset
}
rsps = sliderule.source("atl03s", rqst, stream=True, callbacks=GLOBAL_callbacks)
assert init
assert(len(rsps) == 0)
assert("invalid asset specified: {}".format(invalid_asset) == GLOBAL_message)

@pytest.mark.network
class TestAtl06:
def test_badasset(self, init):
invalid_asset = "invalid-asset"
rqst = {
"resource": [],
"parms": {"asset" : "invalid-asset"}
"resource": [], # invalid resource (should be resources if a list)
"parms": {"asset" : invalid_asset} # bogus asset
}
rsps = sliderule.source("atl06", rqst, stream=True, callbacks=GLOBAL_callbacks)
assert init
assert(len(rsps) == 0)
assert("invalid asset specified: {}".format(invalid_asset) == GLOBAL_message)

def test_timeout(self, init):
resource = "ATL03_20220208000041_07291401_005_01.h5"
Expand All @@ -50,4 +48,3 @@ def test_timeout(self, init):
rsps = sliderule.source("atl06", rqst, stream=True, callbacks=GLOBAL_callbacks)
assert init
assert(len(rsps) == 0)
# assert("{} timed-out after 10 seconds".format(resource) in GLOBAL_message) # non-deterministic
Loading
Loading