Skip to content

Commit 1ae0b48

Browse files
committed
Fix linter issues
1 parent 930fbf5 commit 1ae0b48

File tree

4 files changed

+4
-8
lines changed

4 files changed

+4
-8
lines changed

climada/engine/impact_forecast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from typing import Literal, Union
2525

2626
import numpy as np
27-
import scipy.sparse as sparse
27+
from scipy import sparse
2828

2929
from ..util import log_level
3030
from ..util.checker import size

climada/engine/test/test_impact_forecast.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,10 @@
1919
Tests for Impact Forecast.
2020
"""
2121

22-
import datetime as dt
23-
from pathlib import Path
24-
2522
import numpy as np
2623
import numpy.testing as npt
2724
import pandas as pd
2825
import pytest
29-
import xarray as xr
3026
from scipy.sparse import csr_matrix
3127

3228
from climada.engine import Impact, ImpactForecast
@@ -300,6 +296,7 @@ def imp_fc_stats_dim_reduce(self, imp_fc_stats):
300296

301297
@pytest.fixture
302298
def q(self):
299+
"""Quantile to test"""
303300
return 0.25
304301

305302
@pytest.fixture

climada/hazard/forecast.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
from typing import Any, Dict, Literal, Optional
2525

2626
import numpy as np
27-
import scipy.sparse as sparse
2827
import xarray as xr
28+
from scipy import sparse
2929

3030
from climada.hazard.xarray import HazardXarrayReader
3131

climada/hazard/test/test_forecast.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"""
2121

2222
import datetime as dt
23-
from pathlib import Path
2423

2524
import numpy as np
2625
import numpy.testing as npt
@@ -117,7 +116,6 @@ def test_concat(self, haz_fc, lead_time, member, haz_kwargs):
117116
haz_fc3 = haz_fc.select(event_id=[1, 2])
118117
haz_fc_concat = HazardForecast.concat([haz_fc1, haz_fc2, haz_fc3])
119118
assert isinstance(haz_fc_concat, HazardForecast)
120-
assert haz_fc_concat.size == 3
121119
npt.assert_array_equal(
122120
haz_fc_concat.lead_time, np.concatenate((lead_time[2:3], lead_time[0:2]))
123121
)
@@ -425,6 +423,7 @@ def haz_fc_dim_reduce(self, haz_fc):
425423

426424
@pytest.fixture
427425
def q(self):
426+
"""Quantile to test"""
428427
return 0.25
429428

430429
@pytest.fixture

0 commit comments

Comments
 (0)