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

Complete most of documentation for makecpt #676

Merged
merged 9 commits into from
Nov 3, 2020
Merged

Conversation

weiji14
Copy link
Member

@weiji14 weiji14 commented Oct 29, 2020

Description of proposed changes

Finish up aliasing most arguments for makecpt, improving the documentattion to be better than what we currently have at https://www.pygmt.org/v0.2.0/api/generated/pygmt.makecpt.html! For reference, upstream GMT docs is at https://docs.generic-mapping-tools.org/6.1/makecpt.html and https://github.com/GenericMappingTools/gmt/blame/master/doc/rst/source/makecpt.rst.

Live documentation preview is at https://pygmt-git-complete-docs-makecpt.gmt.vercel.app/api/generated/pygmt.makecpt.html

TODO:

Arguments/Aliases to document (see also https://www.generic-mapping-tools.org/GMT.jl/latest/makecpt/). New aliases are highlighted in bold:

  • A - transparency
  • C - cmap
  • D - background/foreground?
  • E - data_levels/nlevels?
  • F - color_model
  • G - truncate
  • H - output
  • I - reverse
  • M - overrule_bg?
  • N - no_bg?
  • Q - log
  • S - auto
  • T - series
  • V - verbose
  • W - categorical
  • Ww - cyclic
  • Z - continuous

Fixes #

Reminders

  • Run make format and make check to make sure the code follows the style guide.
  • Add tests for new features or tests that would have caught the bug that you're fixing.
  • Add new public functions/methods/classes to doc/api/index.rst.
  • Write detailed docstrings for all functions/methods.
  • If adding new functionality, add an example to docstrings or tutorials.

Notes

  • You can write /format in the first line of a comment to lint the code automatically

Starting to properly document all major arguments for `makecpt` as per upstream GMT docs at https://docs.generic-mapping-tools.org/6.1/makecpt.html. Begin by refreshing current aliases series (T), truncate (G), reverse (I) and continuous (Z).
@weiji14 weiji14 added the documentation Improvements or additions to documentation label Oct 29, 2020
@weiji14 weiji14 mentioned this pull request Oct 29, 2020
5 tasks
@weiji14
Copy link
Member Author

weiji14 commented Nov 2, 2020

  • E - data_levels/nlevels?
  • S - auto

These two flags (-E and -S) require a file input (or pandas.DataFrame table), but this isn't implemented in pygmt.makecpt yet. Probably best to leave the implementation to a separate PR?

@weiji14 weiji14 marked this pull request as ready for review November 2, 2020 04:32
@seisman
Copy link
Member

seisman commented Nov 2, 2020

For makecpt, each option does too many things. Not sure if these are good choices:

D - background/foreground
W - categorical

@weiji14
Copy link
Member Author

weiji14 commented Nov 2, 2020

For makecpt, each option does too many things. Not sure if these are good choices:

D - background/foreground
W - categorical

Yeah, it does get confusing. I couldn't think of a word that covers background/foreground (and NaN) though. Same with W which could be categorical/wrap/cyclic :/

@seisman
Copy link
Member

seisman commented Nov 2, 2020

For -W, we could use categorical (True or False) for -W and cyclic (True or False) for -Ww.

@weiji14
Copy link
Member Author

weiji14 commented Nov 2, 2020

For -W, we could use categorical (True or False) for -W and cyclic (True or False) for -Ww.

Sure, I did think of that actually, but we'll need an extra check so that categorical (W) and cyclic (Ww) are not used at the same time.

pygmt/mathops.py Outdated Show resolved Hide resolved
@weiji14 weiji14 changed the title Complete documentation of makecpt Complete most of documentation for makecpt Nov 3, 2020
@weiji14 weiji14 merged commit 0ea9886 into master Nov 3, 2020
@weiji14 weiji14 deleted the complete-docs/makecpt branch November 3, 2020 00:47
@seisman seisman added this to the 0.2.1 milestone Nov 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants