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 3 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
5 changes: 5 additions & 0 deletions eqcorrscan/core/template_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@
"Pick not associated with waveforms, will not use:"
" {0}".format(pick))
continue
if pick.waveform_id.channel_code is None:
Logger.error(f"Missing waveform_id.channel_code for Pick {pick}.")

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

View workflow job for this annotation

GitHub Actions / flake8-linter

E501 line too long (82 > 80 characters)
calum-chamberlain marked this conversation as resolved.
Show resolved Hide resolved
raise TemplateGenError(

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

View check run for this annotation

Codecov / codecov/patch

eqcorrscan/core/template_gen.py#L525-L526

Added lines #L525 - L526 were 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