Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise useful error when waveform_id is incomplete #564

Merged
merged 5 commits into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eqcorrscan/core/template_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,12 @@
"Pick not associated with waveforms, will not use:"
" {0}".format(pick))
continue
if pick.waveform_id.channel_code is None:
Logger.error(

Check warning on line 525 in eqcorrscan/core/template_gen.py

View check run for this annotation

Codecov / codecov/patch

eqcorrscan/core/template_gen.py#L525

Added line #L525 was not covered by tests
f"Missing waveform_id.channel_code for Pick {pick}.")
raise TemplateGenError(

Check warning on line 527 in eqcorrscan/core/template_gen.py

View check run for this annotation

Codecov / codecov/patch

eqcorrscan/core/template_gen.py#L527

Added line #L527 was not covered by tests
"Ensure that all picks have complete "
"waveform_id attributes")
if all_channels:
channel_code = pick.waveform_id.channel_code[0:2] + "?"
else:
Expand Down
Loading