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

Wrap meca #516

Merged
merged 77 commits into from
Aug 3, 2020
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
e26ecd3
Initial commit to add meca for focal mechanism plotting
tjnewton Jul 11, 2020
0232450
Formatted and checked initial commit of add-meca
tjnewton Jul 11, 2020
922af45
Merge branch 'master' into add-meca
tjnewton Jul 11, 2020
28efc2d
Add meca to index.rst
liamtoney Jul 12, 2020
2fe87af
Added all GMT meca data conventions to pygmt meca
tjnewton Jul 12, 2020
cff30cc
Remove trailing whitespace
liamtoney Jul 12, 2020
b6339a1
Remove extra parens
liamtoney Jul 12, 2020
1239366
Remove convention warnings
liamtoney Jul 12, 2020
ffff36d
Use GMTError
liamtoney Jul 12, 2020
d9407e9
Import GMTError
liamtoney Jul 12, 2020
8536864
Merge branch 'master' into add-meca
liamtoney Jul 12, 2020
ed383d0
Remove comment
liamtoney Jul 12, 2020
f9ac410
Minor comment edits
liamtoney Jul 12, 2020
5f3bfae
Fix typo
liamtoney Jul 12, 2020
910e0f3
Line length reductions
liamtoney Jul 12, 2020
29c0738
Add alias autofill to docstring
liamtoney Jul 12, 2020
ae84de1
Docstring formatting
liamtoney Jul 12, 2020
78cde02
Remove example
liamtoney Jul 12, 2020
598efb6
Adjust line length in docstring
liamtoney Jul 12, 2020
cfef2d5
More line length stuff
liamtoney Jul 12, 2020
31a0973
Better convention string formatting
liamtoney Jul 12, 2020
100d4f1
Simplify docstring
liamtoney Jul 12, 2020
52cd24f
Implemented scale, updated doc string.
tjnewton Jul 12, 2020
97697aa
implemented plotting different moment tensor components and offset
tjnewton Jul 12, 2020
cfd1c21
More docstring edits
liamtoney Jul 12, 2020
da20e4f
Add full moment tensor test
liamtoney Jul 12, 2020
6dfcbe6
Format with black; add os
liamtoney Jul 12, 2020
de80acc
Add fmt baseline image for test
liamtoney Jul 12, 2020
acc6bf6
Rename test function
liamtoney Jul 12, 2020
8040b34
created meca example
tjnewton Jul 12, 2020
5352f9c
formatted meca example
tjnewton Jul 12, 2020
5782ee8
Update examples/gallery/plot/meca.py to style guidelines
tjnewton Jul 12, 2020
393d1c8
Update examples/gallery/plot/meca.py
tjnewton Jul 12, 2020
f57ff25
better doc string in meca example
tjnewton Jul 12, 2020
4314417
maybe fixed whitespace in meca.py?
tjnewton Jul 12, 2020
1d89c6f
Add function for testing the component argument for mt convention
liamtoney Jul 13, 2020
cd3ebca
Change location of C flag logic
liamtoney Jul 13, 2020
45b01de
Add text, which currently fails
liamtoney Jul 13, 2020
deaa1aa
Merge branch 'master' into add-meca
liamtoney Jul 13, 2020
ff164e6
Disable text kwarg for meca for now
liamtoney Jul 13, 2020
64fa78c
added ability to read in dicts of lists as spec
tjnewton Jul 19, 2020
641dd02
added pandas dataframe functionality
tjnewton Jul 19, 2020
a44e36a
deleted fancy MT tests
tjnewton Jul 19, 2020
d666290
update test_meca_spec_dictionary doc string
tjnewton Jul 19, 2020
916269b
added test for dict of lists
tjnewton Jul 19, 2020
9a5c390
added test for dataframe
tjnewton Jul 19, 2020
9d0cb4a
pushing the test files would help
tjnewton Jul 19, 2020
790864a
added test for 1d array and moment tensor convention
tjnewton Jul 21, 2020
b7a85bd
added 2d array test
tjnewton Jul 21, 2020
770e6b6
change variable format to data_format for style checks
tjnewton Jul 21, 2020
f94c04e
fixed isinstance calls for style
tjnewton Jul 21, 2020
ed83d01
camel casing test names
tjnewton Jul 21, 2020
5ea36ce
make format, make check
tjnewton Jul 21, 2020
c35bbbc
added test for file input
tjnewton Jul 21, 2020
355379d
fix PARAMS storage to dict and fix random bugs
tjnewton Jul 21, 2020
dbd936f
fixed naming convention and loop bug
tjnewton Jul 21, 2020
8defa26
make format & make check :)
tjnewton Jul 21, 2020
80af68a
docstring formatting
tjnewton Jul 24, 2020
eb3ce79
moar docstring formatting
tjnewton Jul 24, 2020
69f3919
rename param dict
tjnewton Jul 24, 2020
0b8fdfe
didn't pull webpage commits first
tjnewton Jul 24, 2020
6545cb1
an offering to the pylint gods
tjnewton Jul 24, 2020
e48c945
pylint dislikes capitalized constants in methods, hence now lowercase
tjnewton Jul 24, 2020
6b83b16
silence refactor-related pylint warnings
tjnewton Jul 24, 2020
2cad4a7
pylint: disable=too-many-statements
tjnewton Jul 24, 2020
7548740
changed lat and lon variables to latitude and longitude
tjnewton Jul 27, 2020
b5ab932
updated syntax in meca exam example
tjnewton Jul 27, 2020
f44bc5d
clarification that plot_longitude and plot_latitude are no longer req…
tjnewton Jul 27, 2020
3946493
added 1d array as input for latitude, longitude, depth, plot_longitud…
tjnewton Jul 27, 2020
08830e9
test for event location as arrays and lists
tjnewton Jul 27, 2020
a4c65ac
Merge branch 'master' into add-meca
tjnewton Jul 31, 2020
50f582c
changed test_meca_spec_dictionary to contain one focal mechanism
tjnewton Aug 3, 2020
b173b49
deleted focal_mechanisms.txt and changed test_meca to only use temp file
tjnewton Aug 3, 2020
b388ab2
more descriptive variable name in test_meca_spec_file
tjnewton Aug 3, 2020
bf47d8b
one more rename for good measure
tjnewton Aug 3, 2020
6c3af68
fix bug in test_meca_spec_file
tjnewton Aug 3, 2020
53424e9
pass object instead of file name string
tjnewton Aug 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use GMTError
  • Loading branch information
liamtoney committed Jul 12, 2020
commit ffff36db09a3371a679d259c35dfefbc408279ae
6 changes: 3 additions & 3 deletions pygmt/base_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1049,7 +1049,7 @@ def meca(
# Check the spec and parse the data according to the specified convention
if type(spec) is dict:
if lon is None or lat is None or depth is None: # if no specified location
raise Error("Location not fully specified.")
raise GMTError("Location not fully specified.")
liamtoney marked this conversation as resolved.
Show resolved Hide resolved

# These are constants related to GMT and could be defined elsewhere (top of file?)
AKI_PARAMS = ["strike", "dip", "rake", "magnitude"]
Expand Down Expand Up @@ -1105,7 +1105,7 @@ def meca(
foc_params = PA_PARAMS

else:
raise Error("Parameters in spec dict do not match known conventions.")
raise GMTError("Parameters in spec dict do not match known conventions.")
liamtoney marked this conversation as resolved.
Show resolved Hide resolved

# Construct the vector (note that order matters here, hence the list comprehension!)
spec = [lon, lat, depth] + [spec[key] for key in foc_params]
Expand All @@ -1118,7 +1118,7 @@ def meca(
spec.append(arg)

elif convention is None:
raise Error("We need a convention to know how to interpret the input!")
raise GMTError("We need a convention to know how to interpret the input!")
liamtoney marked this conversation as resolved.
Show resolved Hide resolved

# if spec is not a dict it is handled here
kind = data_kind(spec)
Expand Down