From 7bdbea4610917c2862cf3f119abcab827b9b2918 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 11:52:54 +0200 Subject: [PATCH 01/16] Update docs --- pygmt/src/meca.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 9822dae1f23..f9d321871a7 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -227,28 +227,27 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 Parameters ---------- - spec : str, 1-D array, 2-D array, dict, or pd.DataFrame + spec : str, 1-D numpy array, 2-D numpy array, dict, or pd.DataFrame Data that contain focal mechanism parameters. ``spec`` can be specified in either of the following types: - - *str*: a file name containing focal mechanism parameters as + - *string*: a file name containing focal mechanism parameters as columns. The meaning of each column is: - Columns 1 and 2: event longitude and latitude - Column 3: event depth (in km) - Columns 4 to 3+n: focal mechanism parameters. The number of columns - *n* depends on the choice of ``convention``, which will be - described below. + *n* depends on the choice of ``convention``, which is described below. - Columns 4+n and 5+n: longitude, latitude at which to place beachball. Using ``0 0`` will plot the beachball at the longitude, latitude given in columns 1 and 2. [optional and requires ``offset=True`` to take effect]. - Text string to appear near the beachball [optional]. - - *1-D array*: focal mechanism parameters of a single event. + - *1-D np.array*: focal mechanism parameters of a single event. The meanings of columns are the same as above. - - *2-D array*: focal mechanism parameters of multiple events. + - *2-D np.array*: focal mechanism parameters of multiple events. The meanings of columns are the same as above. - *dictionary or pd.DataFrame*: The dictionary keys or pd.DataFrame column names determine the focal mechanism convention. For @@ -265,14 +264,14 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 A dictionary may contain values for a single focal mechanism or lists of values for multiple focal mechanisms. - Both dictionary and pd.DataFrame may optionally contain + Both dictionary and pd.DataFrame may optionally contain the keys/column names: ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, and/or ``event_name``. - If ``spec`` is either a str, a 1-D array or a 2-D array, the - ``convention`` parameter is required so we know how to interpret the - columns. If ``spec`` is a dictionary or a pd.DataFrame, - ``convention`` is not needed and is ignored if specified. + If ``spec`` is either a string, a 1-D or a 2-D np.array, the ``convention`` + parameter is required so we know how to interpret the columns. If ``spec`` + is a dictionary or a pd.DataFrame, ``convention`` is not needed and is + ignored if specified. scale : float or str *scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\ [**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*]. From ae853f0699cd196a113faf3e9ea278b616edb66a Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 11:59:34 +0200 Subject: [PATCH 02/16] Fix format --- pygmt/src/meca.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index f9d321871a7..73187301f06 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -270,8 +270,8 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 If ``spec`` is either a string, a 1-D or a 2-D np.array, the ``convention`` parameter is required so we know how to interpret the columns. If ``spec`` - is a dictionary or a pd.DataFrame, ``convention`` is not needed and is - ignored if specified. + is a dictionary or a pd.DataFrame, ``convention`` is not needed and is + ignored if specified. scale : float or str *scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\ [**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*]. From cd22074cde3ba89a89ed5024771ac90ba1950653 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 13:05:57 +0200 Subject: [PATCH 03/16] Update docs --- pygmt/src/meca.py | 202 ++++++++++++++++++++++------------------------ 1 file changed, 95 insertions(+), 107 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 73187301f06..e9bea92ae1a 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -227,72 +227,67 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 Parameters ---------- - spec : str, 1-D numpy array, 2-D numpy array, dict, or pd.DataFrame + spec : str, 1-D numpy array, 2-D numpy array, dict, or pandas.DataFrame Data that contain focal mechanism parameters. ``spec`` can be specified in either of the following types: - - *string*: a file name containing focal mechanism parameters as - columns. The meaning of each column is: + - *string*: a file name containing focal mechanism parameters as columns. + The meaning of each column is: - Columns 1 and 2: event longitude and latitude - - Column 3: event depth (in km) - - Columns 4 to 3+n: focal mechanism parameters. The number of columns - *n* depends on the choice of ``convention``, which is described below. - - Columns 4+n and 5+n: longitude, latitude at which to place - beachball. Using ``0 0`` will plot the beachball at the longitude, - latitude given in columns 1 and 2. [optional and requires - ``offset=True`` to take effect]. + - Column 3: event depth (in kilometers) + - Columns 4 to 3+n: focal mechanism parameters. The number of columns *n* + depends on the choice of ``convention``, which is described below. + - Columns 4+n and 5+n: longitude and latitude at which to place the + beachball. Using ``0 0`` will plot the beachball at the longitude and + latitude given in columns 1 and 2. [optional; requires ``offset=True``]. - Text string to appear near the beachball [optional]. - *1-D np.array*: focal mechanism parameters of a single event. The meanings of columns are the same as above. - *2-D np.array*: focal mechanism parameters of multiple events. The meanings of columns are the same as above. - - *dictionary or pd.DataFrame*: The dictionary keys or pd.DataFrame - column names determine the focal mechanism convention. For - different conventions, the following combination of keys are allowed: - - - ``"aki"``: *strike, dip, rake, magnitude* - - ``"gcmt"``: *strike1, dip1, rake1, strike2, dip2, rake2, mantissa,* - *exponent* - - ``"mt"``: *mrr, mtt, mff, mrt, mrf, mtf, exponent* - - ``"partial"``: *strike1, dip1, strike2, fault_type, magnitude* - - ``"principal_axis"``: *t_value, t_azimuth, t_plunge, n_value, - n_azimuth, n_plunge, p_value, p_azimuth, p_plunge, exponent* - - A dictionary may contain values for a single focal mechanism or - lists of values for multiple focal mechanisms. - - Both dictionary and pd.DataFrame may optionally contain the - keys/column names: ``latitude``, ``longitude``, ``depth``, - ``plot_longitude``, ``plot_latitude``, and/or ``event_name``. - - If ``spec`` is either a string, a 1-D or a 2-D np.array, the ``convention`` - parameter is required so we know how to interpret the columns. If ``spec`` - is a dictionary or a pd.DataFrame, ``convention`` is not needed and is - ignored if specified. + - *dictionary or pd.DataFrame*: The dictionary keys or pd.DataFrame column + names determine the focal mechanism convention. For the different + conventions, the following combination of keys/column names are required: + + - ``"aki"``: *strike*, *dip*, *rake*, *magnitude* + - ``"gcmt"``: *strike1*, *dip1*, *rake1*, *strike2*, *dip2*, *rake2*, + *mantissa,* *exponent* + - ``"mt"``: *mrr*, *mtt*, *mff*, *mrt*, *mrf*, *mtf*, *exponent* + - ``"partial"``: *strike1*, *dip1*, *strike2*, *fault_type*, *magnitude* + - ``"principal_axis"``: *t_value*, *t_azimuth*, *t_plunge*, *n_value*, + *n_azimuth*, *n_plunge*, *p_value*, *p_azimuth*, *p_plunge*, *exponent* + + A dictionary may contain values for a single focal mechanism or lists of + values for multiple focal mechanisms. + + Both dictionary and pd.DataFrame may optionally contain the keys/column names: + ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, + and/or ``event_name``. + + If ``spec`` is either a str, a 1-D or 2-D np.array, the ``convention`` parameter + is required to interpret the columns. If ``spec`` is a dictionary or a + pd.DataFrame, ``convention`` is not needed and ignored if specified. scale : float or str *scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\ [**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*]. - Adjust scaling of the radius of the beachball, which is - proportional to the magnitude. By default, *scale* defines the - size for magnitude = 5 (i.e., scalar seismic moment - M0 = 4.0E23 dynes-cm). If **+l** is used the radius will be - proportional to the seismic moment instead. Use **+s** and give - a *reference* to change the reference magnitude (or moment), and - use **+m** to plot all beachballs with the same size. A text - string can be specified to appear near the beachball - (corresponding to column or parameter ``event_name``). - Append **+a**\ *angle* to change the angle of the text string; - append **+f**\ *font* to change its font (size,fontname,color); - append **+j**\ *justify* to change the text location relative - to the beachball [Default is ``"TC"``, i.e., Top Center]; - append **+o** to offset the text string by *dx*\ /*dy*. + Adjust scaling of the radius of the beachball, which is proportional to the + magnitude. By default, *scale* defines the size for magnitude = 5 (i.e., scalar + seismic moment M0 = 4.0E23 dynes-cm). If **+l** is used the radius will be + proportional to the seismic moment instead. Use **+s** and give a *reference* + to change the reference magnitude (or moment), and use **+m** to plot all + beachballs with the same size. A text string can be specified to appear near + the beachball (corresponding to column or parameter ``event_name``). Append + **+a**\ *angle* to change the angle of the text string; append **+f**\ *font* + to change its font (size,fontname,color); append **+j**\ *justify* to change + the text location relative to the beachball [Default is ``"TC"``, i.e., Top + Center]; append **+o** to offset the text string by *dx*\ /*dy*. convention : str Focal mechanism convention. Choose from: - - ``"aki"`` (Aki & Richards) + - ``"aki"`` (Aki and Richards) - ``"gcmt"`` (global CMT) - ``"mt"`` (seismic moment tensor) - ``"partial"`` (partial focal mechanism) @@ -303,91 +298,84 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 The component of the seismic moment tensor to plot. - ``"full"``: the full seismic moment tensor - - ``"dc"``: the closest double couple defined from the moment tensor - (zero trace and zero determinant) + - ``"dc"``: the closest double couple defined from the moment tensor (zero + trace and zero determinant) - ``"deviatoric"``: deviatoric part of the moment tensor (zero trace) longitude : float, list, or 1-D numpy array - Longitude(s) of event location(s). Must be the same length as the - number of events. Will override the ``longitude`` values - in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. + Longitude(s) of the event location(s). Length must match the number of events. + Will override the ``longitude`` values in ``spec`` if ``spec`` is a dictionary + or pd.DataFrame. latitude : float, list, or 1-D numpy array - Latitude(s) of event location(s). Must be the same length as the - number of events. Will override the ``latitude`` values - in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. + Latitude(s) of the event location(s). Length must match the number of events. + Will override the ``latitude`` values in ``spec`` if ``spec`` is a dictionary + or pd.DataFrame. depth : float, list, or 1-D numpy array - Depth(s) of event location(s) in kilometers. Must be the same length - as the number of events. Will override the ``depth`` values in ``spec`` - if ``spec`` is a dictionary or pd.DataFrame. + Depth(s) of the event location(s) in kilometers. Length must match the number + of events. Overrides the ``depth`` values in ``spec`` if ``spec`` is a + dictionary or pd.DataFrame. plot_longitude : float, str, list, or 1-D numpy array - Longitude(s) at which to place beachball(s). Must be the same length - as the number of events. Will override the ``plot_longitude`` values - in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. + Longitude(s) at which to place the beachball(s). Length must match the number + of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` + is a dictionary or pd.DataFrame. plot_latitude : float, str, list, or 1-D numpy array - Latitude(s) at which to place beachball(s). List must be the same - length as the number of events. Will override the ``plot_latitude`` - values in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. + Latitude(s) at which to place the beachball(s). Length must match the number + of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` + is a dictionary or pd.DataFrame. event_name : str, list of str, or 1-D numpy array - Text string(s), e.g., event name(s) to appear near the beachball(s). - List must be the same length as the number of events. Will override - the ``event_name`` labels in ``spec`` if ``spec`` is a dictionary - or pd.DataFrame. + Text string(s), e.g., event name(s) to appear near the beachball(s). Length + must match the number of events. Overrides the ``event_name`` labels in + ``spec`` if ``spec`` is a dictionary or pd.DataFrame. labelbox : bool or str [*fill*]. - Draw a box behind the label if given. Use *fill* to give a fill color - [Default is ``"white"``]. + Draw a box behind the label if given via ``event_name``. Use *fill* to give + a fill color [Default is ``"white"``]. offset : bool or str [**+p**\ *pen*][**+s**\ *size*]. - Offset beachball(s) to longitude(s) and latitude(s) specified in the - the last two columns of the input file or array, or by - ``plot_longitude`` and ``plot_latitude`` if provided. A small circle - is plotted at the initial location and a line connects the beachball - to the circle. Use **+s**\ *size* to set the diameter of the circle - [Default is no circle]. Use **+p**\ *pen* to set the pen attributes - for this feature [Default is set via ``pen``]. The fill of the - circle is set via ``compressionfill`` or ``cmap``, i.e., - corresponds to the fill of the compressive quadrants. + Offset beachball(s) to the longitude(s) and latitude(s) specified in the last + two columns of the input file or array, or by ``plot_longitude`` and + ``plot_latitude`` if provided. A line from the beachball to the inital location + is drawn. Use **+s**\ *size* to plot a small circle at the initial location and + to set the diameter of this circle [Default is no circle]. Use **+p**\ *pen* to + set the pen attributes for this feature [Default is set via ``pen``]. The fill + of the circle is set via ``compressionfill`` or ``cmap``, i.e., corresponds to + the fill of the compressive quadrants. compressionfill : str - Set color or pattern for filling compressive quadrants - [Default is ``"black"``]. This setting also applies to the fill of - the circle defined via ``offset``. + Set color or pattern for filling compressive quadrants [Default is ``"black"``]. + This setting also applies to the fill of the circle defined via ``offset``. extensionfill : str - Set color or pattern for filling extensive quadrants - [Default is ``"white"``]. + Set color or pattern for filling extensive quadrants [Default is ``"white"``]. pen : str - Set pen attributes for all lines related to beachball [Default is - ``"0.25p,black,solid"``]. This setting applies to ``outline``, - ``nodal``, and ``offset``, unless overruled by arguments passed to - those parameters. Draws circumference of beachball. + Set (default) pen attributes for all lines related to the beachball [Default is + ``"0.25p,black,solid"``]. This setting applies to ``outline``, ``nodal``, and + ``offset``, unless overruled by arguments passed to those parameters. Draws the + circumference of the beachball. outline : bool or str [*pen*]. - Draw circumference and nodal planes of beachball. Use *pen* to set - the pen attributes for this feature [Default is set via ``pen``]. + Draw circumference and nodal planes of the beachball. Use *pen* to set the pen + attributes for this feature [Default is set via ``pen``]. nodal : bool, int, or str [*nplane*][/*pen*]. - Plot the nodal planes and outline the bubble which is transparent. - If *nplane* is + Plot the nodal planes and outline the bubble which is transparent. If *nplane* + is - ``0`` or ``True``: both nodal planes are plotted [Default]. - ``1``: only the first nodal plane is plotted. - ``2``: only the second nodal plane is plotted. - Use /*pen* to set the pen attributes for this feature [Default is - set via ``pen``]. - For double couple mechanisms, ``nodal`` renders the beachball - transparent by drawing only the nodal planes and the circumference. - For non-double couple mechanisms, ``nodal=0`` overlays best - double couple transparently. + Use /*pen* to set the pen attributes for this feature [Default is set via + ``pen``]. + For double couple mechanisms, ``nodal`` renders the beachball transparent by + drawing only the nodal planes and the circumference. For non-double couple + mechanisms, ``nodal=0`` overlays best double couple transparently. cmap : str File name of a CPT file or a series of comma-separated colors (e.g., - *color1,color2,color3*) to build a linear continuous CPT from those - colors automatically. The color of the compressive quadrants is - determined by the z-value (i.e., event depth or the third column for - an input file). This setting also applies to the fill of the circle - defined via ``offset``. + *color1,color2,color3*) to build a linear continuous CPT from those colors + automatically. The color of the compressive quadrants is determined by the + z-value (i.e., event depth or the third column for an input file). This setting + also applies to the fill of the circle defined via ``offset``. no_clip : bool - Do **not** skip symbols that fall outside the frame boundaries - [Default is ``False``, i.e., plot symbols inside the frame - boundaries only]. + Do **not** skip symbols that fall outside the frame boundaries [Default is + ``False``, i.e., plot symbols inside the frame boundaries only]. {projection} {region} {frame} From 52676618d7c1aece1b42cc0ba4f57e9ff27dcde5 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 13:23:45 +0200 Subject: [PATCH 04/16] Update docs --- pygmt/src/meca.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index e9bea92ae1a..41e9656139a 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -232,7 +232,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 ``spec`` can be specified in either of the following types: - - *string*: a file name containing focal mechanism parameters as columns. + - *str*: a file name containing focal mechanism parameters as columns. The meaning of each column is: - Columns 1 and 2: event longitude and latitude From be2347beee3b2a24c7bceccea3f515c80b61f643 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 15:06:27 +0200 Subject: [PATCH 05/16] Add intent back --- pygmt/src/meca.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 41e9656139a..ea273fbea4a 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -260,12 +260,12 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"principal_axis"``: *t_value*, *t_azimuth*, *t_plunge*, *n_value*, *n_azimuth*, *n_plunge*, *p_value*, *p_azimuth*, *p_plunge*, *exponent* - A dictionary may contain values for a single focal mechanism or lists of - values for multiple focal mechanisms. + A dictionary may contain values for a single focal mechanism or lists of + values for multiple focal mechanisms. - Both dictionary and pd.DataFrame may optionally contain the keys/column names: - ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, - and/or ``event_name``. + Both dictionary and pd.DataFrame may optionally contain the keys/column names: + ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, + and/or ``event_name``. If ``spec`` is either a str, a 1-D or 2-D np.array, the ``convention`` parameter is required to interpret the columns. If ``spec`` is a dictionary or a From 7afec49b162f1fb33e9c9d3d4c37877491212b14 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 16:54:46 +0200 Subject: [PATCH 06/16] Update docs --- pygmt/src/meca.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index ea273fbea4a..f0dc0c9bfb2 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -232,8 +232,8 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 ``spec`` can be specified in either of the following types: - - *str*: a file name containing focal mechanism parameters as columns. - The meaning of each column is: + - *str*: a file name containing focal mechanism parameters as columns. The + meaning of each column is: - Columns 1 and 2: event longitude and latitude - Column 3: event depth (in kilometers) @@ -261,7 +261,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 *n_azimuth*, *n_plunge*, *p_value*, *p_azimuth*, *p_plunge*, *exponent* A dictionary may contain values for a single focal mechanism or lists of - values for multiple focal mechanisms. + values for multiple focal mechanisms. Both dictionary and pd.DataFrame may optionally contain the keys/column names: ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, @@ -303,32 +303,32 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"deviatoric"``: deviatoric part of the moment tensor (zero trace) longitude : float, list, or 1-D numpy array Longitude(s) of the event location(s). Length must match the number of events. - Will override the ``longitude`` values in ``spec`` if ``spec`` is a dictionary - or pd.DataFrame. + Overrides the ``longitude`` values in ``spec`` if ``spec`` is a dictionary or + pd.DataFrame. latitude : float, list, or 1-D numpy array Latitude(s) of the event location(s). Length must match the number of events. - Will override the ``latitude`` values in ``spec`` if ``spec`` is a dictionary - or pd.DataFrame. + Overrides the ``latitude`` values in ``spec`` if ``spec`` is a dictionary or + pd.DataFrame. depth : float, list, or 1-D numpy array Depth(s) of the event location(s) in kilometers. Length must match the number of events. Overrides the ``depth`` values in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. plot_longitude : float, str, list, or 1-D numpy array Longitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` - is a dictionary or pd.DataFrame. + of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` is + a dictionary or pd.DataFrame. plot_latitude : float, str, list, or 1-D numpy array Latitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` - is a dictionary or pd.DataFrame. + of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` is + a dictionary or pd.DataFrame. event_name : str, list of str, or 1-D numpy array Text string(s), e.g., event name(s) to appear near the beachball(s). Length must match the number of events. Overrides the ``event_name`` labels in ``spec`` if ``spec`` is a dictionary or pd.DataFrame. labelbox : bool or str [*fill*]. - Draw a box behind the label if given via ``event_name``. Use *fill* to give - a fill color [Default is ``"white"``]. + Draw a box behind the label if given via ``event_name``. Use *fill* to give a + fill color [Default is ``"white"``]. offset : bool or str [**+p**\ *pen*][**+s**\ *size*]. Offset beachball(s) to the longitude(s) and latitude(s) specified in the last From e91c633cc71b21aecb6271e89475628454b3e66e Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 23:05:34 +0200 Subject: [PATCH 07/16] Update docs --- pygmt/src/meca.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index f0dc0c9bfb2..6dacc17a86d 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -240,9 +240,9 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - Columns 4 to 3+n: focal mechanism parameters. The number of columns *n* depends on the choice of ``convention``, which is described below. - Columns 4+n and 5+n: longitude and latitude at which to place the - beachball. Using ``0 0`` will plot the beachball at the longitude and - latitude given in columns 1 and 2. [optional; requires ``offset=True``]. - - Text string to appear near the beachball [optional]. + beachball. Using ``0 0`` plots the beachball at longitude and latitude + given in the columns 1 and 2. [optional; requires ``offset=True``]. + - Last Column: text string to appear near the beachball [optional]. - *1-D np.array*: focal mechanism parameters of a single event. The meanings of columns are the same as above. @@ -267,9 +267,9 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, and/or ``event_name``. - If ``spec`` is either a str, a 1-D or 2-D np.array, the ``convention`` parameter - is required to interpret the columns. If ``spec`` is a dictionary or a - pd.DataFrame, ``convention`` is not needed and ignored if specified. + If ``spec`` is either a str or a 1-D or 2-D np.array, the ``convention`` + parameter is required to interpret the columns. If ``spec`` is a dictionary or + a pd.DataFrame, ``convention`` is not needed and ignored if specified. scale : float or str *scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\ [**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*]. From 1c541c685ee28fe4ad9701b6b8da883d937ab54d Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 15 Oct 2024 23:08:57 +0200 Subject: [PATCH 08/16] Update docs --- pygmt/src/meca.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 6dacc17a86d..ae6f069c11a 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -240,7 +240,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - Columns 4 to 3+n: focal mechanism parameters. The number of columns *n* depends on the choice of ``convention``, which is described below. - Columns 4+n and 5+n: longitude and latitude at which to place the - beachball. Using ``0 0`` plots the beachball at longitude and latitude + beachball. ``0 0`` plots the beachball at the longitude and latitude given in the columns 1 and 2. [optional; requires ``offset=True``]. - Last Column: text string to appear near the beachball [optional]. From 2079071c3afbcdaac5e84a5e237da56ada2f9bdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Mon, 21 Oct 2024 16:39:58 +0200 Subject: [PATCH 09/16] Test version_selector (Default should be True) --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index fc26641bd83..aba625d2f9f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -207,7 +207,7 @@ # Theme config html_theme = "sphinx_rtd_theme" -html_theme_options = {} +html_theme_options = {'version_selector': True} repository = "GenericMappingTools/pygmt" repository_url = "https://github.com/GenericMappingTools/pygmt" if __commit__: From 6698490d2ebf1c8d72db96996eb05fc7785009e6 Mon Sep 17 00:00:00 2001 From: actions-bot <58130806+actions-bot@users.noreply.github.com> Date: Mon, 21 Oct 2024 14:46:38 +0000 Subject: [PATCH 10/16] [format-command] fixes --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index aba625d2f9f..d725c1ad3c4 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -207,7 +207,7 @@ # Theme config html_theme = "sphinx_rtd_theme" -html_theme_options = {'version_selector': True} +html_theme_options = {"version_selector": True} repository = "GenericMappingTools/pygmt" repository_url = "https://github.com/GenericMappingTools/pygmt" if __commit__: From 6c4f4cc6f299c6e74489e25ddee0ac687a8a8052 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Tue, 24 Dec 2024 13:50:50 +0100 Subject: [PATCH 11/16] Fix line length --- pygmt/src/meca.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 6ea69e5de22..86cd38135e1 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -250,12 +250,12 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 The meanings of columns are the same as above. - *dictionary or :class:`pandas.DataFrame`*: The dictionary keys or :class:`pandas.DataFrame` column names determine the focal mechanism - convention. For the different conventions, the following combination of - keys/column names are required: + convention. For the different conventions, the following combination of keys/ + column names are required: - ``"aki"``: *strike*, *dip*, *rake*, *magnitude* - - ``"gcmt"``: *strike1*, *dip1*, *rake1*, *strike2*, *dip2*, *rake2*, *mantissa,* - *exponent* + - ``"gcmt"``: *strike1*, *dip1*, *rake1*, *strike2*, *dip2*, *rake2*, + *mantissa*, *exponent* - ``"mt"``: *mrr*, *mtt*, *mff*, *mrt*, *mrf*, *mtf*, *exponent* - ``"partial"``: *strike1*, *dip1*, *strike2*, *fault_type*, *magnitude* - ``"principal_axis"``: *t_value*, *t_azimuth*, *t_plunge*, *n_value*, @@ -270,7 +270,8 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 If ``spec`` is either a str or a 1-D or 2-D numpy array, the ``convention`` parameter is required to interpret the columns. If ``spec`` is a dictionary or - a :class:`pandas.DataFrame`, ``convention`` is not needed and ignored if specified. + a :class:`pandas.DataFrame`, ``convention`` is not needed and ignored if + specified. scale : float or str *scale*\ [**+a**\ *angle*][**+f**\ *font*][**+j**\ *justify*]\ [**+l**][**+m**][**+o**\ *dx*\ [/\ *dy*]][**+s**\ *reference*]. @@ -316,12 +317,12 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 dictionary or :class:`pandas.DataFrame`. plot_longitude : float, str, list, or 1-D numpy array Longitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` is - a dictionary or :class:`pandas.DataFrame`. + of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` is a + dictionary or :class:`pandas.DataFrame`. plot_latitude : float, str, list, or 1-D numpy array Latitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` is - a dictionary or :class:`pandas.DataFrame`. + of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` is a + dictionary or :class:`pandas.DataFrame`. event_name : str, list of str, or 1-D numpy array Text string(s), e.g., event name(s) to appear near the beachball(s). Length must match the number of events. Overrides the ``event_name`` labels in From bb69b5d744ce05cf69e68ddc23ca23667addc300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Tue, 24 Dec 2024 13:52:38 +0100 Subject: [PATCH 12/16] Revert change --- doc/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/conf.py b/doc/conf.py index 55db2a13233..2b41acd3f61 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -206,7 +206,7 @@ # Configure theme html_theme = "sphinx_rtd_theme" -html_theme_options = {"version_selector": True} +html_theme_options = {} repository = "GenericMappingTools/pygmt" repository_url = "https://github.com/GenericMappingTools/pygmt" if __commit__: From ec66e4f62bab579721c609f60e6c6b6489b82345 Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Wed, 25 Dec 2024 17:46:26 +0100 Subject: [PATCH 13/16] Combine docstrings for similar parameters --- pygmt/src/meca.py | 28 ++++++++-------------------- 1 file changed, 8 insertions(+), 20 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 86cd38135e1..315f8d19836 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -303,26 +303,14 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"dc"``: the closest double couple defined from the moment tensor (zero trace and zero determinant) - ``"deviatoric"``: deviatoric part of the moment tensor (zero trace) - longitude : float, list, or 1-D numpy array - Longitude(s) of the event location(s). Length must match the number of events. - Overrides the ``longitude`` values in ``spec`` if ``spec`` is a dictionary or - :class:`pandas.DataFrame`. - latitude : float, list, or 1-D numpy array - Latitude(s) of the event location(s). Length must match the number of events. - Overrides the ``latitude`` values in ``spec`` if ``spec`` is a dictionary or - :class:`pandas.DataFrame`. - depth : float, list, or 1-D numpy array - Depth(s) of the event location(s) in kilometers. Length must match the number - of events. Overrides the ``depth`` values in ``spec`` if ``spec`` is a - dictionary or :class:`pandas.DataFrame`. - plot_longitude : float, str, list, or 1-D numpy array - Longitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_longitude`` values in ``spec`` if ``spec`` is a - dictionary or :class:`pandas.DataFrame`. - plot_latitude : float, str, list, or 1-D numpy array - Latitude(s) at which to place the beachball(s). Length must match the number - of events. Overrides the ``plot_latitude`` values in ``spec`` if ``spec`` is a - dictionary or :class:`pandas.DataFrame`. + longitude / latitude / depth : float, list, or 1-D numpy array + Longitude(s) / latitude(s) / depth(s) of the event(s). Length must match the + number of events. Overrides the ``longitude`` / ``latitude`` / ``depth`` values + in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. + plot_longitude / plot_latitude : float, str, list, or 1-D numpy array + Longitude(s) / Latitude(s) at which to place the beachball(s). Length must match + the number of events. Overrides the ``plot_longitude`` / ``plot_latitude`` + values in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. event_name : str, list of str, or 1-D numpy array Text string(s), e.g., event name(s) to appear near the beachball(s). Length must match the number of events. Overrides the ``event_name`` labels in From 678258353d7695788b94176836934fed93295849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Thu, 26 Dec 2024 09:31:10 +0100 Subject: [PATCH 14/16] Remove whitespaces to make doc look correct Co-authored-by: Dongdong Tian --- pygmt/src/meca.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index 315f8d19836..b87b6c12ec7 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -303,11 +303,11 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"dc"``: the closest double couple defined from the moment tensor (zero trace and zero determinant) - ``"deviatoric"``: deviatoric part of the moment tensor (zero trace) - longitude / latitude / depth : float, list, or 1-D numpy array + longitude/latitude/depth : float, list, or 1-D numpy array Longitude(s) / latitude(s) / depth(s) of the event(s). Length must match the number of events. Overrides the ``longitude`` / ``latitude`` / ``depth`` values in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. - plot_longitude / plot_latitude : float, str, list, or 1-D numpy array + plot_longitude/plot_latitude : float, str, list, or 1-D numpy array Longitude(s) / Latitude(s) at which to place the beachball(s). Length must match the number of events. Overrides the ``plot_longitude`` / ``plot_latitude`` values in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. From e6b0bd62fcaceb780f6663a4072c4dad303a21c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yvonne=20Fr=C3=B6hlich?= <94163266+yvonnefroehlich@users.noreply.github.com> Date: Fri, 27 Dec 2024 22:02:17 +0100 Subject: [PATCH 15/16] Use 'dict' Co-authored-by: Dongdong Tian --- pygmt/src/meca.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index b87b6c12ec7..e5a90d82642 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -248,7 +248,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 The meanings of columns are the same as above. - *2-D np.array*: focal mechanism parameters of multiple events. The meanings of columns are the same as above. - - *dictionary or :class:`pandas.DataFrame`*: The dictionary keys or + - *dict* or :class:`pandas.DataFrame`: The dictionary keys or :class:`pandas.DataFrame` column names determine the focal mechanism convention. For the different conventions, the following combination of keys/ column names are required: From 8d0d4c3799cd6256f4b18bc39ddb1fc45d73503a Mon Sep 17 00:00:00 2001 From: yvonnefroelich Date: Fri, 27 Dec 2024 22:12:26 +0100 Subject: [PATCH 16/16] Use 'dict' --- pygmt/src/meca.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pygmt/src/meca.py b/pygmt/src/meca.py index e5a90d82642..f24ea0bbfbf 100644 --- a/pygmt/src/meca.py +++ b/pygmt/src/meca.py @@ -248,10 +248,10 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 The meanings of columns are the same as above. - *2-D np.array*: focal mechanism parameters of multiple events. The meanings of columns are the same as above. - - *dict* or :class:`pandas.DataFrame`: The dictionary keys or + - *dict* or :class:`pandas.DataFrame`: The dict keys or :class:`pandas.DataFrame` column names determine the focal mechanism - convention. For the different conventions, the following combination of keys/ - column names are required: + convention. For the different conventions, the following combination of + keys / column names are required: - ``"aki"``: *strike*, *dip*, *rake*, *magnitude* - ``"gcmt"``: *strike1*, *dip1*, *rake1*, *strike2*, *dip2*, *rake2*, @@ -261,15 +261,15 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"principal_axis"``: *t_value*, *t_azimuth*, *t_plunge*, *n_value*, *n_azimuth*, *n_plunge*, *p_value*, *p_azimuth*, *p_plunge*, *exponent* - A dictionary may contain values for a single focal mechanism or lists of + A dict may contain values for a single focal mechanism or lists of values for multiple focal mechanisms. - Both dictionary and :class:`pandas.DataFrame` may optionally contain the keys/ + Both dict and :class:`pandas.DataFrame` may optionally contain the keys / column names: ``latitude``, ``longitude``, ``depth``, ``plot_longitude``, ``plot_latitude``, and/or ``event_name``. If ``spec`` is either a str or a 1-D or 2-D numpy array, the ``convention`` - parameter is required to interpret the columns. If ``spec`` is a dictionary or + parameter is required to interpret the columns. If ``spec`` is a dict or a :class:`pandas.DataFrame`, ``convention`` is not needed and ignored if specified. scale : float or str @@ -295,7 +295,7 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 - ``"partial"`` (partial focal mechanism) - ``"principal_axis"`` (principal axis) - Ignored if ``spec`` is a dictionary or :class:`pandas.DataFrame`. + Ignored if ``spec`` is a dict or :class:`pandas.DataFrame`. component : str The component of the seismic moment tensor to plot. @@ -306,15 +306,15 @@ def meca( # noqa: PLR0912, PLR0913, PLR0915 longitude/latitude/depth : float, list, or 1-D numpy array Longitude(s) / latitude(s) / depth(s) of the event(s). Length must match the number of events. Overrides the ``longitude`` / ``latitude`` / ``depth`` values - in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. + in ``spec`` if ``spec`` is a dict or :class:`pandas.DataFrame`. plot_longitude/plot_latitude : float, str, list, or 1-D numpy array Longitude(s) / Latitude(s) at which to place the beachball(s). Length must match the number of events. Overrides the ``plot_longitude`` / ``plot_latitude`` - values in ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. + values in ``spec`` if ``spec`` is a dict or :class:`pandas.DataFrame`. event_name : str, list of str, or 1-D numpy array Text string(s), e.g., event name(s) to appear near the beachball(s). Length - must match the number of events. Overrides the ``event_name`` labels in - ``spec`` if ``spec`` is a dictionary or :class:`pandas.DataFrame`. + must match the number of events. Overrides the ``event_name`` labels in ``spec`` + if ``spec`` is a dict or :class:`pandas.DataFrame`. labelbox : bool or str [*fill*]. Draw a box behind the label if given via ``event_name``. Use *fill* to give a