From becbb739b8c78d28684583bf7686e597917dd7b0 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Mon, 30 Oct 2023 10:58:00 +0800 Subject: [PATCH] Rename validate_output_type to validate_output_table_type --- pygmt/helpers/__init__.py | 2 +- pygmt/helpers/validators.py | 2 +- pygmt/src/filter1d.py | 4 ++-- pygmt/src/grd2xyz.py | 4 ++-- pygmt/src/grdhisteq.py | 4 ++-- pygmt/src/grdvolume.py | 4 ++-- pygmt/src/triangulate.py | 4 ++-- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/pygmt/helpers/__init__.py b/pygmt/helpers/__init__.py index bd3b9680257..8b8891cb63f 100644 --- a/pygmt/helpers/__init__.py +++ b/pygmt/helpers/__init__.py @@ -21,4 +21,4 @@ launch_external_viewer, non_ascii_to_octal, ) -from pygmt.helpers.validators import validate_output_type +from pygmt.helpers.validators import validate_output_table_type diff --git a/pygmt/helpers/validators.py b/pygmt/helpers/validators.py index 9e204af8c59..c400163fee8 100644 --- a/pygmt/helpers/validators.py +++ b/pygmt/helpers/validators.py @@ -6,7 +6,7 @@ from pygmt.exceptions import GMTInvalidInput -def validate_output_type(output_type, outfile=None): +def validate_output_table_type(output_type, outfile=None): """ Check if the ``output_type`` and ``outfile`` parameters are valid. diff --git a/pygmt/src/filter1d.py b/pygmt/src/filter1d.py index 1a82a88a694..f9555c3db86 100644 --- a/pygmt/src/filter1d.py +++ b/pygmt/src/filter1d.py @@ -10,7 +10,7 @@ build_arg_string, fmt_docstring, use_alias, - validate_output_type, + validate_output_table_type, ) @@ -115,7 +115,7 @@ def filter1d(data, output_type="pandas", outfile=None, **kwargs): if kwargs.get("F") is None: raise GMTInvalidInput("Pass a required argument to 'filter_type'.") - output_type = validate_output_type(output_type, outfile=outfile) + output_type = validate_output_table_type(output_type, outfile=outfile) with GMTTempFile() as tmpfile: with Session() as lib: diff --git a/pygmt/src/grd2xyz.py b/pygmt/src/grd2xyz.py index 236290c698f..e339573b46f 100644 --- a/pygmt/src/grd2xyz.py +++ b/pygmt/src/grd2xyz.py @@ -12,7 +12,7 @@ fmt_docstring, kwargs_to_strings, use_alias, - validate_output_type, + validate_output_table_type, ) __doctest_skip__ = ["grd2xyz"] @@ -143,7 +143,7 @@ def grd2xyz(grid, output_type="pandas", outfile=None, **kwargs): 0 10.0 25.0 863.0 1 10.5 25.0 985.5 """ - output_type = validate_output_type(output_type, outfile=outfile) + output_type = validate_output_table_type(output_type, outfile=outfile) if kwargs.get("o") is not None and output_type == "pandas": raise GMTInvalidInput( diff --git a/pygmt/src/grdhisteq.py b/pygmt/src/grdhisteq.py index e66ebe79daa..cf5a9ada852 100644 --- a/pygmt/src/grdhisteq.py +++ b/pygmt/src/grdhisteq.py @@ -12,7 +12,7 @@ fmt_docstring, kwargs_to_strings, use_alias, - validate_output_type, + validate_output_table_type, ) from pygmt.io import load_dataarray @@ -321,7 +321,7 @@ def compute_bins( This method does a weighted histogram equalization for geographic grids to account for node area varying with latitude. """ - output_type = validate_output_type(output_type, outfile=outfile) + output_type = validate_output_table_type(output_type, outfile=outfile) if header is not None and output_type != "file": raise GMTInvalidInput("'header' is only allowed with output_type='file'.") diff --git a/pygmt/src/grdvolume.py b/pygmt/src/grdvolume.py index 77f7881b8ff..a38b257b263 100644 --- a/pygmt/src/grdvolume.py +++ b/pygmt/src/grdvolume.py @@ -9,7 +9,7 @@ fmt_docstring, kwargs_to_strings, use_alias, - validate_output_type, + validate_output_table_type, ) __doctest_skip__ = ["grdvolume"] @@ -101,7 +101,7 @@ def grdvolume(grid, output_type="pandas", outfile=None, **kwargs): 3 350 2.018302e+12 5.222640e+14 258.764032 4 400 1.857370e+12 4.252699e+14 228.963499 """ - output_type = validate_output_type(output_type, outfile=outfile) + output_type = validate_output_table_type(output_type, outfile=outfile) with GMTTempFile() as tmpfile: with Session() as lib: diff --git a/pygmt/src/triangulate.py b/pygmt/src/triangulate.py index 60661b1242a..8c29324524a 100644 --- a/pygmt/src/triangulate.py +++ b/pygmt/src/triangulate.py @@ -12,7 +12,7 @@ fmt_docstring, kwargs_to_strings, use_alias, - validate_output_type, + validate_output_table_type, ) from pygmt.io import load_dataarray @@ -357,7 +357,7 @@ def delaunay_triples( # pylint: disable=too-many-arguments,too-many-locals ``triangulate`` is a Cartesian or small-geographic area operator and is unaware of periodic or polar boundary conditions. """ - output_type = validate_output_type(output_type, outfile) + output_type = validate_output_table_type(output_type, outfile) # Return a pandas.DataFrame if ``outfile`` is not set with GMTTempFile(suffix=".txt") as tmpfile: