|
2 | 2 |
|
3 | 3 | from grass.gunittest.case import TestCase |
4 | 4 | from grass.gunittest.main import test |
5 | | -import grass.script as gs |
6 | 5 |
|
7 | 6 |
|
8 | 7 | class TestPGA(TestCase): |
9 | 8 |
|
10 | 9 | output = "pga_output" |
11 | 10 | result = "result" |
12 | | - potential_test = "data/potential_test.csv" |
13 | 11 |
|
14 | 12 | @classmethod |
15 | 13 | def setUpClass(cls): |
@@ -69,7 +67,6 @@ def tearDownClass(cls): |
69 | 67 | ], |
70 | 68 | ) |
71 | 69 | cls.del_temp_region() |
72 | | - gs.try_remove(cls.potential_test) |
73 | 70 |
|
74 | 71 | def tearDown(self): |
75 | 72 | self.runModule("g.remove", flags="f", type="raster", name=self.output) |
@@ -101,44 +98,6 @@ def test_pga_run(self): |
101 | 98 | actual=self.output, reference=self.result, precision=1e-6 |
102 | 99 | ) |
103 | 100 |
|
104 | | - def test_pga_run_potential_header(self): |
105 | | - """Test potential header with (un)qualified names""" |
106 | | - mapset = gs.gisenv()["MAPSET"] |
107 | | - with open("data/potential.csv", "r") as inp, open( |
108 | | - self.potential_test, "w" |
109 | | - ) as out: |
110 | | - for line in inp: |
111 | | - if line.startswith("ID"): |
112 | | - out.write( |
113 | | - f"ID,Intercept,devpressure,slope@{mapset},lakes_dist_km@{mapset},streets_dist_km\n" |
114 | | - ) |
115 | | - else: |
116 | | - out.write(line) |
117 | | - self.assertModule( |
118 | | - "r.futures.simulation", |
119 | | - developed="urban_2002", |
120 | | - development_pressure="devpressure", |
121 | | - compactness_mean=0.4, |
122 | | - compactness_range=0.05, |
123 | | - discount_factor=0.1, |
124 | | - patch_sizes="data/patches.txt", |
125 | | - predictors=[f"lakes_dist_km@{mapset}", "streets_dist_km", "slope"], |
126 | | - n_dev_neighbourhood=15, |
127 | | - devpot_params=self.potential_test, |
128 | | - random_seed=1, |
129 | | - num_neighbors=4, |
130 | | - seed_search="random", |
131 | | - development_pressure_approach="gravity", |
132 | | - gamma=1.5, |
133 | | - scaling_factor=1, |
134 | | - subregions="zipcodes", |
135 | | - demand="data/demand.csv", |
136 | | - output=self.output, |
137 | | - ) |
138 | | - self.assertRastersNoDifference( |
139 | | - actual=self.output, reference=self.result, precision=1e-6 |
140 | | - ) |
141 | | - |
142 | 101 | def test_pga_run_patch_library_multiple_columns(self): |
143 | 102 | """Test if results is in expected limits""" |
144 | 103 | self.assertModule( |
|
0 commit comments