Skip to content

Commit b59c03a

Browse files
committed
Remove an unneeded if-statement and pylint disable argument
1 parent 0dbea69 commit b59c03a

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

pygmt/src/meca.py

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def data_format_code(convention, component="full"):
110110
)
111111
@kwargs_to_strings(R="sequence", c="sequence_comma", p="sequence")
112112
def meca(
113-
self, # pylint: disable=unused-argument
113+
self,
114114
spec,
115115
scale,
116116
longitude=None,
@@ -284,23 +284,21 @@ def update_pointers(data_pointers):
284284
"plot_latitude": plot_latitude,
285285
}
286286

287-
# make a DataFrame copy to check convention if it contains
288-
# other parameters
289-
if isinstance(spec, (dict, pd.DataFrame)):
290-
# check if a copy is necessary
291-
copy = False
292-
drop_list = []
293-
for pointer in data_pointers:
294-
if pointer in spec:
295-
copy = True
296-
drop_list.append(pointer)
297-
if copy:
298-
spec_conv = spec.copy()
299-
# delete optional parameters from copy for convention check
300-
for item in drop_list:
301-
del spec_conv[item]
302-
else:
303-
spec_conv = spec
287+
# make a DataFrame copy to check convention if it contains other params
288+
# check if a copy is necessary
289+
copy = False
290+
drop_list = []
291+
for pointer in data_pointers:
292+
if pointer in spec:
293+
copy = True
294+
drop_list.append(pointer)
295+
if copy:
296+
spec_conv = spec.copy()
297+
# delete optional parameters from copy for convention check
298+
for item in drop_list:
299+
del spec_conv[item]
300+
else:
301+
spec_conv = spec
304302

305303
# set convention and focal parameters based on spec convention
306304
for conv in list(param_conventions):

0 commit comments

Comments
 (0)