Skip to content

Commit

Permalink
STY: fixed space after keyword
Browse files Browse the repository at this point in the history
Ensured there is always a space after a keyword.
  • Loading branch information
aburrell committed Oct 19, 2023
1 parent 53ab137 commit 4d141a0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 19 deletions.
5 changes: 3 additions & 2 deletions pysatSpaceWeather/instruments/methods/ace.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,9 @@ def download(date_array, name, tag='', inst_id='', data_path='', now=None):
file_fmt = "{:s}-{:s}.txt".format("ace", "magnetometer"
if name == "mag" else name)

if(len(date_array) > 1 or date_array[0].year != now.year
or date_array[0].month != now.month or date_array[0].day != now.day):
if any([len(date_array) > 1, date_array[0].year != now.year,
date_array[0].month != now.month,
date_array[0].day != now.day]):
logger.warning(''.join(['real-time data only available for current',
' day, data in this file will have the ',
'wrong date']))
Expand Down
4 changes: 2 additions & 2 deletions pysatSpaceWeather/instruments/methods/swpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,8 @@ def parse_daily_solar_data(data_lines, year, optical):
if year == 1994 and kk == 'new_reg':
# New regions only in files after 1994
val = -999
elif((year == 1994 and kk in xray_keys)
or (not optical and kk in optical_keys)):
elif np.any([year == 1994 and kk in xray_keys,
not optical and kk in optical_keys]):
# X-ray flares in files after 1994, optical flares come later
val = -1
else:
Expand Down
12 changes: 6 additions & 6 deletions pysatSpaceWeather/tests/test_methods_f107.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ def test_calc_f107a_daily_missing(self):
assert 'f107a' in self.testInst.meta.keys()

# Assert the finite values have realistic means
assert(np.nanmin(self.testInst['f107a'])
> np.nanmin(self.testInst['f107']))
assert(np.nanmax(self.testInst['f107a'])
< np.nanmax(self.testInst['f107']))
assert (np.nanmin(self.testInst['f107a'])
> np.nanmin(self.testInst['f107']))
assert (np.nanmax(self.testInst['f107a'])
< np.nanmax(self.testInst['f107']))

# Assert the expected number of fill values
assert(len(self.testInst['f107a'][np.isnan(self.testInst['f107a'])])
== 40)
assert (len(self.testInst['f107a'][np.isnan(self.testInst['f107a'])])
== 40)
return


Expand Down
18 changes: 9 additions & 9 deletions pysatSpaceWeather/tests/test_methods_kp.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ def test_convert_ap_to_kp_middle(self):

# Assert the converted Kp meta data exists and is reasonable
assert 'Kp' in kp_meta.keys()
assert(kp_meta['Kp'][kp_meta.labels.fill_val] == -1)
assert kp_meta['Kp'][kp_meta.labels.fill_val] == -1

return

Expand All @@ -387,7 +387,7 @@ def test_convert_ap_to_kp_nan_input(self):

# Assert the converted Kp meta data exists and is reasonable
assert 'Kp' in kp_meta.keys()
assert(kp_meta['Kp'][kp_meta.labels.fill_val] == -1)
assert kp_meta['Kp'][kp_meta.labels.fill_val] == -1

del kp_out, kp_meta
return
Expand All @@ -402,7 +402,7 @@ def test_convert_ap_to_kp_inf_input(self):

# Assert the converted Kp meta data exists and is reasonable
assert 'Kp' in kp_meta.keys()
assert(kp_meta['Kp'][kp_meta.labels.fill_val] == -1)
assert kp_meta['Kp'][kp_meta.labels.fill_val] == -1

del kp_out, kp_meta
return
Expand Down Expand Up @@ -594,8 +594,8 @@ def test_combine_kp_all(self):
assert kp_inst.variables[0] == 'Kp'

# Fill value is defined by combine
assert(kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert (kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert (kp_inst['Kp'] != self.combine['fill_val']).all()

del kp_inst
Expand All @@ -612,8 +612,8 @@ def test_combine_kp_no_forecast(self):
assert kp_inst.index[-1] < self.combine['stop']
assert len(kp_inst.data.columns) == 1
assert kp_inst.data.columns[0] == 'Kp'
assert(kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert (kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert (kp_inst['Kp'] == self.combine['fill_val']).any()

del kp_inst, combo_in
Expand Down Expand Up @@ -648,8 +648,8 @@ def test_combine_kp_no_standard(self):
assert kp_inst.index[-1] < self.combine['stop']
assert len(kp_inst.data.columns) == 1
assert kp_inst.data.columns[0] == 'Kp'
assert(kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert (kp_inst.meta['Kp'][kp_inst.meta.labels.fill_val]
== self.combine['fill_val'])
assert len(kp_inst['Kp'][kp_inst['Kp']]
== self.combine['fill_val']) > 0

Expand Down

0 comments on commit 4d141a0

Please sign in to comment.