Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsta committed Apr 3, 2024
1 parent 75100a1 commit 2957c56
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ disable=C0103,
C0114,
C0302,
W0718,
C0702
C0116
18 changes: 9 additions & 9 deletions tests/test_basin_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
_ = utils.get_datapaths(update_gee_metadata=True)


def clean_res(feature):
def _clean_res(feature):
res = pd.DataFrame(feature["properties"], index=[0])
res["id"] = feature["id"]
return res


def test_unvalidated_dataset():
urls, tasks = rabpro.basin_stats.compute(
urls, _ = rabpro.basin_stats.compute(
[
Dataset(
"NASA/ORNL/DAYMET_V4",
Expand All @@ -49,7 +49,7 @@ def test_customreducer():
def asdf(feat):
return feat.getNumber("max")

urls, task = rabpro.basin_stats.compute(
urls, _ = rabpro.basin_stats.compute(
[Dataset("JRC/GSW1_4/YearlyHistory", "waterClass", stats=["max"])],
gee_feature_path="users/jstacompute/basins",
reducer_funcs=[asdf],
Expand All @@ -62,7 +62,7 @@ def asdf(feat):

def test_categorical_imgcol():

urls, task = rabpro.basin_stats.compute(
urls, _ = rabpro.basin_stats.compute(
[Dataset("MODIS/061/MCD12Q1", "LC_Type1", stats=["freqhist"])],
gee_feature_path="users/jstacompute/basins",
)
Expand All @@ -73,7 +73,7 @@ def test_categorical_imgcol():

def test_timeindexed_imgcol():

urls, tasks = rabpro.basin_stats.compute(
urls, _ = rabpro.basin_stats.compute(
[
Dataset(
"JRC/GSW1_4/YearlyHistory",
Expand All @@ -91,7 +91,7 @@ def test_timeindexed_imgcol():

def test_timeindexedspecific_imgcol():

urls, task = rabpro.basin_stats.compute(
urls, _ = rabpro.basin_stats.compute(
[
Dataset(
"JRC/GSW1_4/YearlyHistory",
Expand All @@ -110,7 +110,7 @@ def test_timeindexedspecific_imgcol():

def test_nontimeindexed_imgcol():

data, task = rabpro.basin_stats.compute(
data, _ = rabpro.basin_stats.compute(
[
Dataset(
"JRC/GSW1_4/MonthlyRecurrence",
Expand All @@ -121,14 +121,14 @@ def test_nontimeindexed_imgcol():
test=True,
)

res = pd.concat([clean_res(feature) for feature in data[0]["features"]])
res = pd.concat([_clean_res(feature) for feature in data[0]["features"]])

assert res.shape[0] > 0


def test_img():

data, task = rabpro.basin_stats.compute(
data, _ = rabpro.basin_stats.compute(
[
Dataset(
"JRC/GSW1_4/GlobalSurfaceWater",
Expand Down

0 comments on commit 2957c56

Please sign in to comment.