4343
4444
4545def _validate_data_input ( # noqa: PLR0912
46- data = None , x = None , y = None , z = None , ncols = 2 , required_data = True , kind = None
46+ data = None , x = None , y = None , z = None , mincols = 2 , required_data = True , kind = None
4747) -> None :
4848 """
4949 Check if the combination of data/x/y/z is valid.
@@ -66,29 +66,29 @@ def _validate_data_input( # noqa: PLR0912
6666 Traceback (most recent call last):
6767 ...
6868 pygmt.exceptions.GMTInvalidInput: Must provide both x and y.
69- >>> _validate_data_input(x=[1, 2, 3], y=[4, 5, 6], ncols =3)
69+ >>> _validate_data_input(x=[1, 2, 3], y=[4, 5, 6], mincols =3)
7070 Traceback (most recent call last):
7171 ...
7272 pygmt.exceptions.GMTInvalidInput: Must provide x, y, and z.
7373 >>> import numpy as np
7474 >>> import pandas as pd
7575 >>> import xarray as xr
7676 >>> data = np.arange(8).reshape((4, 2))
77- >>> _validate_data_input(data=data, ncols =3, kind="matrix")
77+ >>> _validate_data_input(data=data, mincols =3, kind="matrix")
7878 Traceback (most recent call last):
7979 ...
8080 pygmt.exceptions.GMTInvalidInput: data must provide x, y, and z columns.
8181 >>> _validate_data_input(
8282 ... data=pd.DataFrame(data, columns=["x", "y"]),
83- ... ncols =3,
83+ ... mincols =3,
8484 ... kind="vectors",
8585 ... )
8686 Traceback (most recent call last):
8787 ...
8888 pygmt.exceptions.GMTInvalidInput: data must provide x, y, and z columns.
8989 >>> _validate_data_input(
9090 ... data=xr.Dataset(pd.DataFrame(data, columns=["x", "y"])),
91- ... ncols =3,
91+ ... mincols =3,
9292 ... kind="vectors",
9393 ... )
9494 Traceback (most recent call last):
@@ -116,7 +116,7 @@ def _validate_data_input( # noqa: PLR0912
116116 GMTInvalidInput
117117 If the data input is not valid.
118118 """
119- required_z = ncols >= 3
119+ required_z = mincols >= 3
120120 if data is None : # data is None
121121 if x is None and y is None : # both x and y are None
122122 if required_data : # data is not optional
0 commit comments