Skip to content

Shorten the list of supported argument types in docstrings #2718

@seisman

Description

@seisman

I'll take the spacing parameter as an example, which is used in the xyz2grd and many other functions.

Here is the source code of the spacing docstrings:

"spacing": r"""
spacing : int or float or str or list or tuple
*x_inc*\ [**+e**\|\ **n**][/\ *y_inc*\ [**+e**\|\ **n**]].

Here is what it looks like:
image

As you can see, currently, spacing is documented to support 5 types: int, float, str, list and tuple.

My thoughts:

  1. Simplify int or float to float. If an argument can accept float (e.g., 1.0), it definitely can accept int (e.g., 1). It's not necessary to list both.
  2. Simplify list or tuple to list or tuple or something else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions