-
Notifications
You must be signed in to change notification settings - Fork 232
pygmt.params.Pattern: Set default pattern value to 1 plus extra validation checks #4134
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
Set default pattern value as None to fix autodoc warning about `AttributeError: type object 'Pattern' has no attribute 'pattern'`. Add proper validation to ensure non-int and non-PathLike values will raise a GMTValueError.
Originally posted by @yvonnefroehlich in #4100
@yvonnefroehlich, I've fixed the AttributeError, but the Windows docs build still shows as failing at https://github.com/GenericMappingTools/pygmt/actions/runs/18149651674/job/51657848578#step:7:1735 with |
What about default to pattern 1? |
Great, thanks 🙂! |
Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
/format |
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.
OK to merge after the CI passes.
/format |
/format |
Looks good! No warnings anymore 🙂. |
Description of proposed changes
Set default pattern value as 1 to fix autodoc warning about
AttributeError: type object 'Pattern' has no attribute 'pattern'
. Add proper validation to ensure non-int and non-PathLike values will raise a GMTValueError.Addresses #4100 (comment), patches #4020
Preview: https://pygmt-dev--4134.org.readthedocs.build/en/4134/api/generated/pygmt.params.Pattern.html
Reminders
make format
andmake check
to make sure the code follows the style guide.doc/api/index.rst
.Slash Commands
You can write slash commands (
/command
) in the first line of a comment to performspecific operations. Supported slash command is:
/format
: automatically format and lint the code