Skip to content

Commit 71204d1

Browse files
committed
Remove the check_kind code block from virtualfile_in
1 parent 57d275b commit 71204d1

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

pygmt/clib/session.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1755,7 +1755,7 @@ def virtualfile_from_stringio(
17551755
@deprecate_parameter(
17561756
"required_data", "required", "v0.16.0", remove_version="v0.20.0"
17571757
)
1758-
def virtualfile_in( # noqa: PLR0912
1758+
def virtualfile_in(
17591759
self,
17601760
check_kind=None,
17611761
data=None,
@@ -1847,7 +1847,7 @@ def virtualfile_in( # noqa: PLR0912
18471847
)
18481848
mincols = 3
18491849

1850-
kind = data_kind(data, required=required)
1850+
kind = data_kind(data, required=required, check_kind=check_kind)
18511851
_validate_data_input(
18521852
data=data,
18531853
x=x,
@@ -1858,16 +1858,6 @@ def virtualfile_in( # noqa: PLR0912
18581858
kind=kind,
18591859
)
18601860

1861-
if check_kind:
1862-
valid_kinds = ("file", "arg") if required is False else ("file",)
1863-
if check_kind == "raster":
1864-
valid_kinds += ("grid", "image")
1865-
elif check_kind == "vector":
1866-
valid_kinds += ("empty", "matrix", "vectors", "geojson")
1867-
if kind not in valid_kinds:
1868-
msg = f"Unrecognized data type for {check_kind}: {type(data)}."
1869-
raise GMTInvalidInput(msg)
1870-
18711861
# Decide which virtualfile_from_ function to use
18721862
_virtualfile_from = {
18731863
"arg": contextlib.nullcontext,

0 commit comments

Comments
 (0)