Skip to content

Commit

Permalink
Rename validate_output_type to validate_output_table_type
Browse files Browse the repository at this point in the history
  • Loading branch information
seisman committed Oct 30, 2023
1 parent e60e4df commit becbb73
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion pygmt/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion pygmt/helpers/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/filter1d.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
build_arg_string,
fmt_docstring,
use_alias,
validate_output_type,
validate_output_table_type,
)


Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/grd2xyz.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
fmt_docstring,
kwargs_to_strings,
use_alias,
validate_output_type,
validate_output_table_type,
)

__doctest_skip__ = ["grd2xyz"]
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/grdhisteq.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
fmt_docstring,
kwargs_to_strings,
use_alias,
validate_output_type,
validate_output_table_type,
)
from pygmt.io import load_dataarray

Expand Down Expand Up @@ -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'.")
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/grdvolume.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
fmt_docstring,
kwargs_to_strings,
use_alias,
validate_output_type,
validate_output_table_type,
)

__doctest_skip__ = ["grdvolume"]
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions pygmt/src/triangulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
fmt_docstring,
kwargs_to_strings,
use_alias,
validate_output_type,
validate_output_table_type,
)
from pygmt.io import load_dataarray

Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit becbb73

Please sign in to comment.