Skip to content

Commit

Permalink
PYTHON: Clean up based on linter
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Aug 24, 2023
1 parent feea6b3 commit fced10b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/seacas/scripts/exodus3.in.py
Original file line number Diff line number Diff line change
Expand Up @@ -5783,7 +5783,7 @@ def __ex_put_block(
numAttrsPerElem):
obj_type = ctypes.c_int(get_entity_type(object_type))
block_id = ctypes.c_longlong(object_id)
if type(eType) is str:
if isinstance(eType, str):
eType = eType.encode('ascii')
elem_type = ctypes.create_string_buffer(eType.upper(), MAX_NAME_LENGTH + 1)
num_elem_this_blk = ctypes.c_longlong(numElems)
Expand Down
4 changes: 2 additions & 2 deletions packages/seacas/scripts/exomerge3.py
Original file line number Diff line number Diff line change
Expand Up @@ -1432,7 +1432,7 @@ def _convert_side_set_to_triangle_block(self,
1) *
nodes_per_element]
local_node = tuple(local_node[x] for x in face_element_map[1])
if not face_element_map[0] in faces:
if face_element_map[0] not in faces:
faces[face_element_map[0]] = [local_node]
else:
faces[face_element_map[0]].append(local_node)
Expand Down Expand Up @@ -6545,7 +6545,7 @@ def _replace_name_case(self, new_list, original_list):
'identical lowercase representations. One will be '
'chosen at random.')
for item in new_list:
if not item.lower() in original_case:
if item.lower() not in original_case:
self._bug(
'Unrecognized string.',
'The string "%s" appears in the new list but '
Expand Down
13 changes: 7 additions & 6 deletions packages/seacas/scripts/tests/exomerge_unit_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
"""
This file performs unit tests of functions within Exomerge.
Copyright 2018, 2021, 2022 National Technology and Engineering Solutions of Sandia. Under
the terms of Contract DE-NA-0003525, there is a non-exclusive license for use
of this work by or on behalf of the U.S. Government. Export of this program
may require a license from the United States Government.
Copyright 2018, 2021, 2022 National Technology and Engineering
Solutions of Sandia. Under the terms of Contract DE-NA-0003525, there
is a non-exclusive license for use of this work by or on behalf of the
U.S. Government. Export of this program may require a license from
the United States Government.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -1783,7 +1784,7 @@ def test(self):
matched_unit_tests = []
for unit_test in unit_tests:
(test, _) = unit_test
if not test[6:] in public_functions:
if test[6:] not in public_functions:
unmatched.append(test)
else:
matched_unit_tests.append(unit_test)
Expand All @@ -1803,7 +1804,7 @@ def test(self):
unmatched = []
unit_test_names = [x[0] for x in unit_tests]
for name in public_functions:
if not "_test_" + name in unit_test_names:
if "_test_" + name not in unit_test_names:
unmatched.append(name)
if unmatched:
print(
Expand Down

0 comments on commit fced10b

Please sign in to comment.