Skip to content

Commit 6e16bfd

Browse files
committed
added parquet pytest
1 parent 1cdaf14 commit 6e16bfd

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

tests/test_arcticdem.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ def test_sampler(self, domain, asset, organization):
2222
resource = "ATL03_20190314093716_11600203_005_01.h5"
2323
region = icesat2.toregion(os.path.join(TESTDIR, "data/dicksonfjord.geojson"))
2424
parms = { "poly": region['poly'],
25+
"raster": region['raster'],
2526
"cnf": "atl03_high",
2627
"ats": 20.0,
2728
"cnt": 10,

tests/test_parquet.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
"""Tests for sliderule-python arcticdem raster support."""
2+
3+
import pytest
4+
from pathlib import Path
5+
import os
6+
import os.path
7+
from sliderule import icesat2
8+
9+
TESTDIR = Path(__file__).parent
10+
11+
@pytest.mark.network
12+
class TestParquet:
13+
def test_parquet(self, domain, asset, organization):
14+
icesat2.init(domain, organization=organization)
15+
resource = "ATL03_20190314093716_11600203_005_01.h5"
16+
region = icesat2.toregion(os.path.join(TESTDIR, "data/dicksonfjord.geojson"))
17+
parms = { "poly": region['poly'],
18+
"raster": region['raster'],
19+
"cnf": "atl03_high",
20+
"ats": 20.0,
21+
"cnt": 10,
22+
"len": 40.0,
23+
"res": 20.0,
24+
"maxi": 1,
25+
"output": { "path": "testfile.parquet", "format": "parquet", "open_on_complete": True } }
26+
gdf = icesat2.atl06p(parms, asset=asset, resources=[resource])
27+
assert len(gdf) == 256
28+
assert len(gdf.keys()) == 17
29+
assert gdf["rgt"][0] == 1160
30+
assert gdf["cycle"][0] == 2
31+
assert gdf["segment_id"][0] >= 405240
32+
assert gdf["segment_id"][255] <= 405609
33+
os.remove("testfile.parquet")
34+

0 commit comments

Comments
 (0)