Skip to content

Commit 32abbf0

Browse files
authored
pygmt.info: Migrate the 'per_column' parameter to the new alias system (#4361)
1 parent 3a2c9c3 commit 32abbf0

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

pygmt/src/info.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,15 @@
99
from pygmt._typing import PathLike, TableLike
1010
from pygmt.alias import Alias, AliasSystem
1111
from pygmt.clib import Session
12-
from pygmt.helpers import (
13-
GMTTempFile,
14-
build_arg_list,
15-
fmt_docstring,
16-
use_alias,
17-
)
12+
from pygmt.helpers import GMTTempFile, build_arg_list, fmt_docstring, use_alias
1813

1914

2015
@fmt_docstring
21-
@use_alias(C="per_column", T="nearest_multiple", a="aspatial", f="coltypes")
16+
@use_alias(T="nearest_multiple", a="aspatial", f="coltypes")
2217
def info(
2318
data: PathLike | TableLike,
2419
spacing: Sequence[float] | str | None = None,
20+
per_column: bool = False,
2521
registration: Literal["gridline", "pixel"] | bool = False,
2622
verbose: Literal["quiet", "error", "warning", "timing", "info", "compat", "debug"]
2723
| bool = False,
@@ -47,6 +43,7 @@ def info(
4743
Full GMT docs at :gmt-docs:`gmtinfo.html`.
4844
4945
$aliases
46+
- C = per_column
5047
- I = spacing
5148
- V = verbose
5249
- i = incols
@@ -57,8 +54,9 @@ def info(
5754
data
5855
Pass in either a file name to an ASCII data table, a 1-D/2-D
5956
$table_classes.
60-
per_column : bool
61-
Report the min/max values per column in separate columns.
57+
per_column
58+
Report the min/max values per column in separate columns [Default is the format
59+
<min/max>].
6260
spacing
6361
[**b**\|\ **p**\|\ **f**\|\ **s**]\ *dx*\[/*dy*\[/*dz*...]].
6462
Compute the min/max values of the first n columns to the nearest
@@ -87,6 +85,7 @@ def info(
8785
- str if none of the above parameters are used.
8886
"""
8987
aliasdict = AliasSystem(
88+
C=Alias(per_column, name="per_column"),
9089
I=Alias(spacing, name="spacing", sep="/"),
9190
).add_common(
9291
V=verbose,
@@ -105,7 +104,7 @@ def info(
105104
result = tmpfile.read()
106105

107106
if (
108-
kwargs.get("C") is not None
107+
kwargs.get("C", per_column) is not False
109108
or kwargs.get("I", spacing) is not None
110109
or kwargs.get("T") is not None
111110
):

0 commit comments

Comments
 (0)