Skip to content

Commit 18f0fa7

Browse files
fixed pylint issues
1 parent 25209c2 commit 18f0fa7

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

climada/util/interpolation.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ def interpolate_ev(
6565
x_train.size < 2. Defaults to np.nan.
6666
fill_value : tuple, float, str
6767
fill values to use when x_test outside of range of x_train.
68-
If set to "extrapolate", values will be extrapolated. If set to a float, value will
69-
be used on both sides. If set to tuple, left value will be used for left side and
70-
right value will be used for right side. If tuple and left value is "maximum", the maximum
71-
of the cummulative frequencies will be used to compute exceedance intensities on the left.
72-
Defaults to np.nan
68+
If set to "extrapolate", values will be extrapolated. If set to a float, value will
69+
be used on both sides. If set to tuple, left value will be used for left side and
70+
right value will be used for right side. If tuple and left value is "maximum",
71+
the maximum of the cummulative frequencies will be used to compute exceedance
72+
intensities on the left. Defaults to np.nan
7373
7474
Returns
7575
-------
@@ -104,16 +104,16 @@ def interpolate_ev(
104104
fill_value = tuple(np.log10(fill_value))
105105
elif isinstance(fill_value, (float, int)) and y_scale == 'log':
106106
fill_value = np.log10(fill_value)
107-
108-
107+
109108
# warn if data is being extrapolated
110109
if (
111110
fill_value == 'extrapolate' and
112111
((np.min(x_test) < np.min(x_train)) or (np.max(x_test) > np.max(x_train)))
113112
):
114113
LOGGER.warning('Data is being extrapolated.')
115114

116-
interpolation = interpolate.interp1d(x_train, y_train, fill_value=fill_value, bounds_error=False)
115+
interpolation = interpolate.interp1d(
116+
x_train, y_train, fill_value=fill_value, bounds_error=False)
117117
y_test = interpolation(x_test)
118118

119119
# adapt output scale
@@ -162,7 +162,7 @@ def stepfunction_ev(
162162
# handle case of small training data sizes
163163
if x_train.size < 2:
164164
return _interpolate_small_input(x_test, x_train, y_train, None, y_asymptotic)
165-
165+
166166
# find indeces of x_test if sorted into x_train
167167
if not all(sorted(x_train) == x_train):
168168
raise ValueError('Input array x_train must be sorted in ascending order.')
@@ -261,7 +261,8 @@ def group_frequency(frequency, value, n_sig_dig=2):
261261
if not all(sorted(value) == value):
262262
raise ValueError('Value array must be sorted in ascending order.')
263263
# add frequency for equal value
264-
value, start_indices = np.unique(sig_dig_list(value, n_sig_dig=n_sig_dig), return_index=True)
264+
value, start_indices = np.unique(
265+
sig_dig_list(value, n_sig_dig=n_sig_dig), return_index=True)
265266
start_indices = np.insert(start_indices, len(value), len(frequency))
266267
frequency = np.array([
267268
sum(frequency[start_indices[i]:start_indices[i+1]])

0 commit comments

Comments
 (0)