Skip to content

Commit 1300e3d

Browse files
white space comsmetics
1 parent 117fd4b commit 1300e3d

File tree

7 files changed

+20
-19
lines changed

7 files changed

+20
-19
lines changed

climada/test/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def get_test_file(ds_name, file_format=None):
5252
) if ds.version.strip('v') <= climada_version.strip('v')][-1]
5353
_, files = client.download_dataset(test_ds)
5454
[test_file] = [fil for fil in files if fil.name in [
55-
dsf.file_name
56-
for dsf in test_ds.files
55+
dsf.file_name
56+
for dsf in test_ds.files
5757
if file_format is None or dsf.file_format == file_format]]
5858
return test_file

climada/test/test_api_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,12 +253,12 @@ def test_multiplicity_split(self):
253253

254254
def test_purge_cache(self):
255255
client = Client()
256-
256+
257257
active_ds = client.get_dataset_info(data_type="litpop", name="LitPop_150arcsec_ABW", version="v2")
258258
outdated_ds = client.get_dataset_info(data_type="litpop", name="LitPop_150arcsec_ABW", version="v1")
259259
test_ds = client.get_dataset_info(data_type="storm_europe", name="test_storm_europe_icon_2021012800", version="v1", status="test_dataset")
260260
expired_ds = client.get_dataset_info(data_type="tropical_cyclone", name="rename_files2", version="v1", status="expired")
261-
261+
262262
with tempfile.TemporaryDirectory() as temp_dir:
263263
for ds in [active_ds, outdated_ds, test_ds, expired_ds]:
264264
client.download_dataset(dataset=ds, target_dir=Path(temp_dir))

climada/test/test_litpop_integr.py

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def test_from_shape_zurich_pass(self):
144144
def test_from_shape_and_countries_zurich_pass(self):
145145
"""test initiating LitPop for custom shape (square around Zurich City)
146146
with from_shape_and_countries()"""
147-
147+
148148
ent = lp.LitPop.from_shape_and_countries(
149149
shape, 'Switzerland', res_arcsec=30, reference_year=2016)
150150
self.assertEqual(ent.gdf.value.min(), 0.0)
@@ -181,7 +181,7 @@ def test_Liechtenstein_30_pop_pass(self):
181181
self.assertAlmostEqual(ent.meta['transform'][0], 30/3600)
182182

183183
def test_from_nightlight_intensity(self):
184-
""" Test raises, logger and if methods from_countries and from_shape are
184+
""" Test raises, logger and if methods from_countries and from_shape are
185185
are used."""
186186

187187
with self.assertRaises(ValueError) as cm:
@@ -191,34 +191,35 @@ def test_from_nightlight_intensity(self):
191191
with self.assertRaises(ValueError) as cm:
192192
lp.LitPop.from_nightlight_intensity(countries = 'Liechtenstein', shape = shape)
193193
self.assertEqual('Not allowed to set both `countries` and `shape`. Aborting.', str(cm.exception))
194-
195-
exp = lp.LitPop.from_nightlight_intensity(countries = 'Liechtenstein')
194+
195+
exp = lp.LitPop.from_nightlight_intensity(countries = 'Liechtenstein')
196196
self.assertEqual(exp.fin_mode, 'none')
197197

198-
exp = lp.LitPop.from_nightlight_intensity(shape = shape)
198+
exp = lp.LitPop.from_nightlight_intensity(shape = shape)
199199
self.assertEqual(exp.value_unit, '')
200-
200+
201201
with self.assertLogs('climada.entity.exposures.litpop.litpop', level = 'WARNING') as cm:
202202
lp.LitPop.from_nightlight_intensity(shape = shape)
203203
self.assertIn('Note: set_nightlight_intensity sets values to raw nightlight intensity,', cm.output[0])
204204

205205
def test_from_population(self):
206-
""" Test raises, logger and if methods from_countries and from_shape are
206+
""" Test raises, logger and if methods from_countries and from_shape are
207207
are used."""
208208

209209
with self.assertRaises(ValueError) as cm:
210210
lp.LitPop.from_population()
211211
self.assertEqual('Either `countries` or `shape` required. Aborting.', str(cm.exception))
212212

213-
exp = lp.LitPop.from_population(countries = 'Liechtenstein')
213+
exp = lp.LitPop.from_population(countries = 'Liechtenstein')
214214
self.assertEqual(exp.fin_mode, 'pop')
215215

216-
exp = lp.LitPop.from_population(shape = shape)
216+
exp = lp.LitPop.from_population(shape = shape)
217217
self.assertEqual(exp.value_unit, 'people')
218218

219219
with self.assertRaises(ValueError) as cm:
220220
lp.LitPop.from_population(countries = 'Liechtenstein', shape = shape)
221-
self.assertEqual('Not allowed to set both `countries` and `shape`. Aborting.', str(cm.exception))
221+
self.assertEqual('Not allowed to set both `countries` and `shape`. Aborting.', str(cm.exception))
222+
222223

223224
class TestAdmin1(unittest.TestCase):
224225
"""Test the admin1 functionalities within the LitPop module"""
@@ -309,7 +310,7 @@ def test_load_gpw_pop_shape_pass(self):
309310
self.assertEqual(meta['height'], data.shape[0])
310311
self.assertEqual(meta['width'], data.shape[1])
311312
self.assertIsInstance(data, np.ndarray)
312-
self.assertEqual(len(data.shape), 2)
313+
self.assertEqual(len(data.shape), 2)
313314
except FileExistsError as err:
314315
self.assertIn('lease download', err.args[0])
315316
self.skipTest('GPW input data for GPW v4.%i not found.' %(gpw_version))

climada/test/test_nightlight.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ def test_load_nightlight_noaa(self):
185185
# compressed image to a gzip file
186186
with gzip.GzipFile(SYSTEM_DIR.joinpath(gzfile), 'wb') as f:
187187
f.write(mem.getvalue())
188-
188+
189189
try:
190190
# with arguments
191191
night, coord_nl, fn_light = nightlight.load_nightlight_noaa(ref_year=year, sat_name=sat_name)

climada/util/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def geo_im_from_array(array_sub, coord, var_name, title,
314314
if axes is None:
315315
proj_plot = proj
316316
if isinstance(proj, ccrs.PlateCarree):
317-
# for PlateCarree, center plot around data's central lon
317+
# for PlateCarree, center plot around data's central lon
318318
# without overwriting the data's original projection info
319319
xmin, xmax = u_coord.lon_bounds(np.concatenate([c[:, 1] for c in list_coord]))
320320
proj_plot = ccrs.PlateCarree(central_longitude=0.5 * (xmin + xmax))

climada/util/test/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def test_missing(self):
6666
CONFIG.hazard.fire_fly.population.str()
6767
self.assertIn("there is no 'fire_fly' configured for 'hazard'", str(ve.exception))
6868
self.assertIn("check your config files: [", str(ve.exception))
69-
69+
7070
with self.assertRaises(AttributeError) as ve:
7171
CONFIG.some_module.str()
7272
self.assertIn("there is no 'some_module' configured for 'climada.CONFIG'", str(ve.exception))

climada/util/test/test_yearsets.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def test_sample_from_poisson(self):
6565

6666
self.assertEqual(events_per_year.size, n_sample_years)
6767
self.assertAlmostEqual(np.mean(events_per_year), lam, places=1)
68-
68+
6969
self.assertRaises(TypeError, yearsets.sample_from_poisson, n_sample_years, None)
7070
self.assertRaises(ValueError, yearsets.sample_from_poisson, n_sample_years, -1)
7171

0 commit comments

Comments
 (0)