Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Jurgen Griesfeller committed Aug 14, 2023
1 parent a0056af commit 66f877d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pyaerocom/io/read_eea_aqerep_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,9 @@ def read_file(self, filename, var_name, vars_as_series=False):
diff_unsorted = np.diff(data_dict[self.START_TIME_NAME])
sort_flag = False
# use a vectorised time_diff instead of scalar one as before
time_diff = (data_dict[self.END_TIME_NAME][:lineidx]-data_dict[self.START_TIME_NAME][:lineidx]) / 2.
time_diff = (
data_dict[self.END_TIME_NAME][:lineidx] - data_dict[self.START_TIME_NAME][:lineidx]
) / 2.0

# np.min needs an array and fails with ValueError when a scalar is supplied
# this is the case for a single line file
Expand All @@ -423,7 +425,9 @@ def read_file(self, filename, var_name, vars_as_series=False):
if min_diff < 0:
# data needs to be sorted
ordered_idx = np.argsort(data_dict[self.START_TIME_NAME][:lineidx])
data_out["dtime"] = data_dict[self.START_TIME_NAME][ordered_idx] + time_diff[ordered_idx]
data_out["dtime"] = (
data_dict[self.START_TIME_NAME][ordered_idx] + time_diff[ordered_idx]
)
sort_flag = True
else:
data_out["dtime"] = data_dict[self.START_TIME_NAME][:lineidx] + time_diff
Expand Down

0 comments on commit 66f877d

Please sign in to comment.