Skip to content

Conversation

@yvonnefroehlich
Copy link
Member

Description of proposed changes

This PRs aims to shorten the supported argument types in docstrings:

  • Change int or float to float
  • Change list or tuple to list
  • Change type1 or typ2 or typ3 to type1, typ2, or typ3

Fixes #2718

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 wrapping a new module, open a 'Wrap new GMT module' issue and submit reasonably-sized PRs.
  • If adding new functionality, add an example to docstrings or tutorials.
  • Use underscores (not hyphens) in names of Python files and directories.

Slash Commands

You can write slash commands (/command) in the first line of a comment to perform
specific operations. Supported slash commands are:

  • /format: automatically format and lint the code
  • /test-gmt-dev: run full tests on the latest GMT development version

@yvonnefroehlich yvonnefroehlich added documentation Improvements or additions to documentation skip-changelog Skip adding Pull Request to changelog labels Oct 14, 2023
@seisman seisman added this to the 0.11.0 milestone Oct 15, 2023
@yvonnefroehlich yvonnefroehlich self-assigned this Oct 15, 2023
@seisman
Copy link
Member

seisman commented Oct 16, 2023

Need to fix line 419 in pygmt/helpers/decorators.py:

=================================== FAILURES ===================================
_______________ [doctest] pygmt.helpers.decorators.fmt_docstring _______________
404     ...         Pass in either a file name to an ASCII data table, a 2-D
405     ...         {table-classes}.
406     ...     {region}
407     ...     {projection}
408     ...
409     ...     {aliases}
410     ...     '''
411     ...     pass
412     ...
413     >>> print(gmtinfo.__doc__)
Differences (unified diff with -expected +actual):
    @@ -4,5 +4,5 @@
     Parameters
     ----------
    -data : str or numpy.ndarray or pandas.DataFrame or xarray.Dataset or geo...
    +data : str or numpy.ndarray, pandas.DataFrame, xarray.Dataset, or geopandas.GeoDataFrame
         Pass in either a file name to an ASCII data table, a 2-D
         :class:`numpy.ndarray`, a :class:`pandas.DataFrame`, an

@yvonnefroehlich
Copy link
Member Author

yvonnefroehlich commented Oct 16, 2023

Need to fix line 419 in pygmt/helpers/decorators.py:

Thanks @seisman! This is updated in the commits 213d4b7 and 1e3abc9.

Co-authored-by: Dongdong Tian <seisman.info@gmail.com>
@seisman seisman merged commit 9217078 into main Oct 16, 2023
@seisman seisman deleted the shorten-input-types branch October 16, 2023 08:14
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 skip-changelog Skip adding Pull Request to changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Shorten the list of supported argument types in docstrings

3 participants