Skip to content

Commit b9bbbcc

Browse files
committed
Fix sourcery warnings
1 parent 004ee8b commit b9bbbcc

2 files changed

Lines changed: 15 additions & 9 deletions

File tree

seiscat/fetchdata/event_waveforms_utils.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,11 @@ def get_picked_station_codes(evid_dir, evid):
137137
# Fall back to pick.phase_hint if no arrival found
138138
if phase is None:
139139
phase = pick.phase_hint
140-
if phase is not None and phase[0].upper() in ('P', 'S'):
141-
if pick.waveform_id and pick.waveform_id.station_code:
142-
station_codes.add(pick.waveform_id.station_code)
140+
if (
141+
phase is not None
142+
and phase[0].upper() in ('P', 'S')
143+
and pick.waveform_id
144+
and pick.waveform_id.station_code
145+
):
146+
station_codes.add(pick.waveform_id.station_code)
143147
return station_codes

seiscat/fetchdata/sds.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,15 @@ def fetch_sds_waveforms(config, event, client):
121121
net, sta, loc, chan = nslc
122122
if channel_codes and not _check_channel(chan, channel_codes):
123123
continue
124-
if station_codes and picked_stations is None:
124+
if (
125+
station_codes
126+
and picked_stations is None
127+
and not check_station(sta, station_codes)
128+
):
125129
# Only station_codes filter, no picks filter
126-
if not check_station(sta, station_codes):
127-
continue
128-
if picked_stations is not None:
129-
if sta not in picked_stations:
130-
continue
130+
continue
131+
if picked_stations is not None and sta not in picked_stations:
132+
continue
131133
st = client.get_waveforms(net, sta, loc, chan, t0, t1)
132134
outfile = waveform_dir / f'{net}.{sta}.{loc}.{chan}.mseed'
133135
st.write(outfile, format='MSEED')

0 commit comments

Comments
 (0)