Functions convention_code, convention_name, convention_params are defined in meca.py and they can also be used when wrapping coupe (#2019). So it's better to move these shared functions into pygmt/src/_common.py as proposed in #3357.
Instead of simply moving the functions, this PR adds the private _FocalMechanismConvention class which does the same thing as the three functions. With this new class, the Figure.meca source codes can be simplified.
It's likely the Figure.meca method can be further simplified, but will leave it to future PRs to make this PR small for reviewing.
Functions
convention_code
,convention_name
,convention_params
are defined inmeca.py
and they can also be used when wrappingcoupe
(#2019). So it's better to move these shared functions intopygmt/src/_common.py
as proposed in #3357.Instead of simply moving the functions, this PR adds the private
_FocalMechanismConvention
class which does the same thing as the three functions. With this new class, theFigure.meca
source codes can be simplified.It's likely the
Figure.meca
method can be further simplified, but will leave it to future PRs to make this PR small for reviewing.