Skip to content

Commit

Permalink
Fix for number-only event ids in SourceSpec event file
Browse files Browse the repository at this point in the history
  • Loading branch information
claudiodsf committed Oct 9, 2024
1 parent aaa9c06 commit b94401e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Copyright (c) 2011-2024 Claudio Satriano <[email protected]>
- Fix for rejected spectra still being plotted in the stacked spectra plot
- Fix for corner case where all the inversion errors are zero
- Fix I/O error when reading PAZ files
- Fix for event ids in SourceSpec event file being only numbers: they are now
correctly interpreted as strings

## v1.8 - 2024-04-07

Expand Down
3 changes: 3 additions & 0 deletions sourcespec/ssp_read_event_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,9 @@ def _parse_source_spec_event_file(event_file, event_id=None):
raise TypeError(
'This is a valid YAML file, but it does not contain the key: '
'"- event_id:", preceded by a dash (-).')
# make sure that all the event_id are a string
for ev in events:
ev['event_id'] = str(ev['event_id'])
if event_id is not None:
_events = [ev for ev in events if ev.get('event_id') == event_id]
try:
Expand Down

0 comments on commit b94401e

Please sign in to comment.