-
Notifications
You must be signed in to change notification settings - Fork 39
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
changes made to obspyIO.py and focalmechplotter.py for string equiva… #5
base: master
Are you sure you want to change the base?
Conversation
Feels like this might stem from obspy using |
continue | ||
|
||
if (pick.onset is 'impulsive'): | ||
if (pick.onset == 'impulsive'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just cosmetics, but those brackets ain't necessary..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was in Fortran mode when I did that 👎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@megies is correct. use ==
to compare strings, never is
.
is
is a much stricter and here unwanted comparison.
For the case of comparing literals (int, string, etc) w/ variable value bindings, I'm not 100% sure what the difference is in the compiler (object id vs value equiv), but @megies is right, we are after value equiv, and if those strings ever get abstracted out as variables, this would break. Which is probably what
Anyhoo, thanks! Either pull this into dev, or I'm waiting until I merge dev into master.... |
Hi Mark, For some reason in order to get my hashpy to work I had to change the string equivalence checks inside obspyIO.py and focalmechplotter.py ; from "is" to "==" in 3 or 4 places. I'm running under python2.7 myself