Skip to content

Commit de4c98a

Browse files
committed
Remove unneeded tmpfile variable and unused imports to fix lint error
1 parent b7269ec commit de4c98a

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

pygmt/base_plotting.py

+10-14
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
Does not define any special non-GMT methods (savefig, show, etc).
44
"""
55
import contextlib
6-
import csv
76
import numpy as np
8-
import pandas as pd
97

108
from .clib import Session
119
from .exceptions import GMTInvalidInput
@@ -14,7 +12,6 @@
1412
dummy_context,
1513
data_kind,
1614
fmt_docstring,
17-
GMTTempFile,
1815
use_alias,
1916
kwargs_to_strings,
2017
)
@@ -970,14 +967,13 @@ def text(
970967
if position is not None and isinstance(position, str):
971968
kwargs["F"] += f'+c{position}+t"{text}"'
972969

973-
with GMTTempFile(suffix=".txt") as tmpfile:
974-
with Session() as lib:
975-
if kind == "file" or (kind == "vectors" and position is not None):
976-
file_context = dummy_context(textfiles)
977-
elif kind == "vectors" and position is None:
978-
file_context = lib.virtualfile_from_vectors(
979-
np.atleast_1d(x), np.atleast_1d(y), np.atleast_1d(text)
980-
)
981-
with file_context as fname:
982-
arg_str = " ".join([fname, build_arg_string(kwargs)])
983-
lib.call_module("text", arg_str)
970+
with Session() as lib:
971+
if kind == "file" or (kind == "vectors" and position is not None):
972+
file_context = dummy_context(textfiles)
973+
elif kind == "vectors" and position is None:
974+
file_context = lib.virtualfile_from_vectors(
975+
np.atleast_1d(x), np.atleast_1d(y), np.atleast_1d(text)
976+
)
977+
with file_context as fname:
978+
arg_str = " ".join([fname, build_arg_string(kwargs)])
979+
lib.call_module("text", arg_str)

0 commit comments

Comments
 (0)