Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nackerley
Copy link
Contributor

Fixed #1621 by bringing Pickler._station_magnitude_contributions() into line with other Pickler methods, such as Pickler._arrival(), in particular by making use of Pickler._str(). This means that residual and weight are written even if they are both zero, and not written only when they are None.

I suspect that Pickler._station_magnitude_contributions() was missed when other methods were updated a while back to use Pickler._str() mainly because it is out-of-order with the rest which do use Pickler._str(). A more natural place for it among the methods would be between Pickler._station_magnitude() and Pickler._origin(), but that would have made the diff less clear.

Also fixed a bug whereby Event.region was neither written to QuakeML nor read.

Updated regression tests to reflect these changes, and added myself to contributors, even this is a very minor contribution.

… into line with other Pickler methods, such as Pickler._arrival. This means that residual and weight are written even if they are both zero, and not written only when they are `None`.

Also fixed a bug whereby Event.region was neither written to QuakeML nor read.

Updated regression tests to reflect this, and added myself to contributors.

Tidied up whitespace.
@nackerley
Copy link
Contributor Author

Forking from the maintenance branch seemed easier than resolving all the conflicts when rebasing from master to maintenance. Sorry for any confusion.

@nackerley nackerley changed the title Fixed https://github.com/obspy/obspy/issues/1621 by bringing Pickler.… Correctly writing zero station magnitude contributions in QuakeML Dec 19, 2016
@nackerley nackerley changed the title Correctly writing zero station magnitude contributions in QuakeML Correctly writing zero station magnitude contributions and reading/writing event regions in QuakeML Dec 19, 2016
@QuLogic QuLogic requested a review from krischer December 19, 2016 23:27
@QuLogic QuLogic added this to the 1.0.3 milestone Dec 19, 2016
Copy link
Member

@megies megies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a short item in the changelog, otherwise looks good to me, Travis fails are unrelated.

Thanks @nackerley!

if contrib.residual:
etree.SubElement(contrib_el, 'residual').text = \
str(contrib.residual)
self._str(contrib.station_magnitude_id.id, contrib_el,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nackerley please get rid of the trailing whitespace..

@nackerley
Copy link
Contributor Author

@megies re: travis. Thanks, I was wondering about the failures I saw when I ran the full test suite.

p.s. @krischer @megies Wonderful first interaction with the project. Looking forward to contributing more.

@megies
Copy link
Member

megies commented Dec 22, 2016

p.s. @krischer @megies Wonderful first interaction with the project. Looking forward to contributing more.

Thanks for the fix and good to hear! ObsPy can use all the help it gets!

@megies megies merged commit 6e9fbfe into obspy:maintenance_1.0.x Dec 22, 2016
@nackerley nackerley deleted the fix_issue_1621_bis branch December 23, 2016 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants