-
Notifications
You must be signed in to change notification settings - Fork 234
Add the Box class for specifying the box of GMT embellishments #3995
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
Conversation
dd01578 to
d9ccd1f
Compare
7aa3bf8 to
37ed709
Compare
Co-authored-by: Michael Grund <23025878+michaelgrund@users.noreply.github.com> Co-authored-by: Yvonne Fröhlich <94163266+yvonnefroehlich@users.noreply.github.com>
311c83f to
926a690
Compare
…iasSystem/params/base
|
@GenericMappingTools/pygmt-maintainers Please give this PR a high priority, since many PRs are waiting for it. |
weiji14
left a comment
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.
Looks good. Just two suggestions, one on ordering the docs, another one on making class BaseParam and AbstractBaseClass.
pygmt/params/base.py
Outdated
| """ | ||
|
|
||
|
|
||
| class BaseParam: |
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.
Probably should make this an AbstractBaseClass (was debating between ABC or a Protocol).
| class BaseParam: | |
| from abc import ABC, abstractmethod, abstractproperty | |
| class BaseParam(ABC): |
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.
I've applied the suggestions but also made some changes in c6bd16f. The main changes are:
abstractpropertyis deprecated https://docs.python.org/3/library/abc.html#abc.abstractproperty. Now use@propertyand@abstractmethod.@abstractmethodmeans subclasses must implement the method/property, so theNotImplementedErroris not needed and can be removed.- The
_validatemethod is meant to be optional, so we can't use@abstractmethod. Then ruff reports theB027error, and it's ignored by adding thenoqaflag.
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
Co-authored-by: Wei Ji <23487320+weiji14@users.noreply.github.com>
- abstractproperty is deprecated - _validate is optional, so we can't use @AbstractMethod - improve docstrings
This PR implements the
Boxclass that can be used in modules likecoast/image/legend/colorbar/....The full GMT CLI syntax is (https://docs.generic-mapping-tools.org/6.6/colorbar.html#f):
The upstream long-form names are available at:
https://github.com/GenericMappingTools/gmt/blob/7026382558e11f89e2238bb345e1d0af325c12aa/src/longopt/psscale_inc.h#L35
The
Boxclass follows the upstream long-form names, but useinner_gap/inner_penfor+iandshade_offset/shade_fillfor+s.Preview: