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

QuakeML: fix a bug in reading QuakeML (empty stub MomentTensor added) #1896

Merged
merged 6 commits into from Sep 20, 2017

Conversation

Projects
None yet
2 participants
@megies
Copy link
Member

commented Sep 19, 2017

Reading an event with focal mechanism without moment tensor introduces an empty stub moment tensor (instead of keeping it None), which in turn can result in invalid QuakeML files when saving again later.

quakeml: add failing test for a bug in reading QuakeML
Reading an event with focal mechanism without moment tensor introduces
an empty stub moment tensor (instead of keeping it None), which in turn
can result in invalid QuakeML files when saving again later

@megies megies added this to the 1.1.0 milestone Sep 19, 2017

# rather `None`
memfile.seek(0)
cat = read_events(memfile, format="QUAKEML")
self.assertEqual(cat[0].focal_mechanisms[0].moment_tensor, None)

This comment has been minimized.

Copy link
@krischer

krischer Sep 19, 2017

Member

Maybe also write it out again with validate=True to test the behavior because of which you discovered the bug?

megies added some commits Sep 19, 2017

@megies megies force-pushed the fix_read_quakeml_focmec branch from d1fbae6 to f38445c Sep 19, 2017

@krischer
Copy link
Member

left a comment

Looks pretty good to me. Feel free to merge if you think its done. Maybe add a changelog entry?

@megies

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2017

CI was green, only added changelog now. Merging.

@megies megies merged commit 5f795bc into master Sep 20, 2017

0 of 3 checks passed

ci/circleci CircleCI is running your tests
Details
continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

@megies megies deleted the fix_read_quakeml_focmec branch Sep 20, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.