Skip to content

Commit

Permalink
Added column QuakeML to Event
Browse files Browse the repository at this point in the history
  • Loading branch information
Baashen committed Jul 8, 2024
1 parent 61697df commit a23fbce
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions stream2segment/io/db/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def webservice_id(cls):
mag_author = Column(String)
event_location_name = Column(String)
event_type = Column(String)
quakeml = Column(LargeBinary, nullable=True)

@property
def url(self):
Expand Down
Binary file modified stream2segment/resources/templates/example.db.sqlite
Binary file not shown.
8 changes: 4 additions & 4 deletions tests/download/test_u_download_01_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,10 +762,10 @@ def test_get_events_response_has_one_col_more(self, mock_urljoin, db):
Event MODEL. TO FIX THIS, EDIT THE RESPONSE BELOW IN ORDER TO HAVE ALWAYS ONE
COLUMN MORE THAN IN OUR Event MODEL
"""
urlread_sideeffect = ["""#EventID|Time|Latitude|Longitude|Depth/km|Author|Catalog|Contributor|ContributorID|MagType|Magnitude|MagAuthor|EventLocationName|EventType|
gfz2021edty|2021-02-28T23:37:15.211956|-17.565212|167.572067|10.0|||GFZ|gfz2021edty|M|5.787024361||Vanuatu Islands|earthquake|
gfz2021edpn|2021-02-28T21:23:50.840903|-22.500320|172.554474|26.75543594|||GFZ|gfz2021edpn|mb|4.907085435||Southeast of Loyalty Islands|earthquake|
gfz2021edoa|2021-02-28T20:37:40.931643|-22.658522|172.432373|30.70357132|||GFZ|gfz2021edoa|Mw|5.755797284||Southeast of Loyalty Islands|earthquake|
urlread_sideeffect = ["""#EventID|Time|Latitude|Longitude|Depth/km|Author|Catalog|Contributor|ContributorID|MagType|Magnitude|MagAuthor|EventLocationName|EventType|QuakeML|
gfz2021edty|2021-02-28T23:37:15.211956|-17.565212|167.572067|10.0|||GFZ|gfz2021edty|M|5.787024361||Vanuatu Islands|earthquake||
gfz2021edpn|2021-02-28T21:23:50.840903|-22.500320|172.554474|26.75543594|||GFZ|gfz2021edpn|mb|4.907085435||Southeast of Loyalty Islands|earthquake||
gfz2021edoa|2021-02-28T20:37:40.931643|-22.658522|172.432373|30.70357132|||GFZ|gfz2021edoa|Mw|5.755797284||Southeast of Loyalty Islands|earthquake||
"""]
with pytest.raises(FailedDownload) as fdw:
data = self.get_events_df(urlread_sideeffect, db.session, "http://eventws", {},
Expand Down

0 comments on commit a23fbce

Please sign in to comment.