Skip to content

Commit

Permalink
add cleanup / black / flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
ninsbl committed Jun 6, 2023
1 parent 3945f24 commit 95ff7a0
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
19 changes: 14 additions & 5 deletions src/temporal/t.import.hrsi/testsuite/test_t_import_hrsi_ice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test t.rast.reclass
"""Test t.import.hrsi for Ice products
(C) 2022 by the GRASS GIS Development Team
(C) 2023 by the GRASS GIS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
Expand All @@ -9,8 +9,8 @@
"""
import os

import grass.pygrass.modules as pymod
import grass.temporal as tgis
import grass.script as gs

from grass.gunittest.case import TestCase
from grass.gunittest.gmodules import SimpleModule

Expand All @@ -20,16 +20,22 @@ class TestAggregationAbsolute(TestCase):
def setUpClass(cls):
"""Initiate the temporal GIS and set the region"""
os.putenv("GRASS_OVERWRITE", "1")
cls.tempdir = gs.tempdir()

@classmethod
def tearDownClass(cls):
"""Remove the temporary region and data"""
products = ["FractionalSnowCover", "GapfilledFractionalSnowCover", "PersistentSnowArea", "PersistentSnowArea_LAEA", "RiverandLakeIceExtent_S1", "RiverandLakeIceExtent_S2", "RiverandLakeIceExtent_S1_S2", "SARWetSnow", "WetDrySnow", "AggregatedRiverandLakeIceExtent"]
products = [
"RiverandLakeIceExtent_S1",
"RiverandLakeIceExtent_S2",
"RiverandLakeIceExtent_S1_S2",
]
for product in products:
try:
cls.runModule("t.remove", flags="df", type="strds", inputs=product)
except Exception:
pass
gs.utils.try_rmdir(cls.tempdir)

def test_import_RILE_S1_S2(self):
"""Test download and import of RiverandLakeIceExtent_S1_S2 with fast external data"""
Expand All @@ -44,6 +50,7 @@ def test_import_RILE_S1_S2(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -65,6 +72,7 @@ def test_import_RILE_S2(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -86,6 +94,7 @@ def test_import_RILE_S1(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand Down
19 changes: 12 additions & 7 deletions src/temporal/t.import.hrsi/testsuite/test_t_import_hrsi_snow.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Test t.rast.reclass
"""Test t.import.hrsi for Snow products
(C) 2022 by the GRASS GIS Development Team
(C) 2023 by the GRASS GIS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
Expand All @@ -9,8 +9,8 @@
"""
import os

import grass.pygrass.modules as pymod
import grass.temporal as tgis
import grass.script as gs

from grass.gunittest.case import TestCase
from grass.gunittest.gmodules import SimpleModule

Expand All @@ -20,6 +20,7 @@ class TestAggregationAbsolute(TestCase):
def setUpClass(cls):
"""Initiate the temporal GIS and set the region"""
os.putenv("GRASS_OVERWRITE", "1")
cls.tempdir = gs.tempdir()

@classmethod
def tearDownClass(cls):
Expand All @@ -29,9 +30,6 @@ def tearDownClass(cls):
"GapfilledFractionalSnowCover",
"PersistentSnowArea",
"PersistentSnowArea_LAEA",
"RiverandLakeIceExtent_S1",
"RiverandLakeIceExtent_S2",
"RiverandLakeIceExtent_S1_S2",
"SARWetSnow",
"WetDrySnow",
"AggregatedRiverandLakeIceExtent",
Expand All @@ -41,6 +39,7 @@ def tearDownClass(cls):
cls.runModule("t.remove", flags="df", type="strds", inputs=product)
except Exception:
pass
gs.utils.try_rmdir(cls.tempdir)

def test_import_WDS(self):
"""Test download and import of WetDrySnow with fast external data"""
Expand All @@ -55,6 +54,7 @@ def test_import_WDS(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -76,6 +76,7 @@ def test_import_SWS(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -97,6 +98,7 @@ def test_import_FSC(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -118,6 +120,7 @@ def test_import_GFSC(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -139,6 +142,7 @@ def test_import_PSA(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand All @@ -159,6 +163,7 @@ def test_import_PSA_LAEA(self):
nprocs=2,
memory=2048,
output=test_product,
output_directory=self.tempdir,
)
info = SimpleModule(
"t.info",
Expand Down

0 comments on commit 95ff7a0

Please sign in to comment.