Skip to content

Commit

Permalink
PYTHON: Address flake8 issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gsjaardema committed Sep 28, 2023
1 parent 27869a8 commit d5a78ec
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions packages/seacas/scripts/exomerge3.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ def _delete_elements(self, element_block_id, element_indices):
used_nodes.extend(
connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
)
Expand Down Expand Up @@ -851,7 +851,7 @@ def _delete_elements(self, element_block_id, element_indices):
new_connectivity.extend(
connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
)
Expand Down Expand Up @@ -1655,7 +1655,7 @@ def _convert_side_set_to_triangle_block(
face_element_map = face_mapping[face_index]
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
local_node = tuple(local_node[x] for x in face_element_map[1])
Expand Down Expand Up @@ -1740,7 +1740,7 @@ def _partition_triangle_block_from_node_field(
new_connectivity = []
element_interval_values = []
triangles = [
tuple(connectivity[x * 3 : (x + 1) * 3]) for x in range(element_count)
tuple(connectivity[x * 3: (x + 1) * 3]) for x in range(element_count)
]
for index, upper_bound in enumerate(interval_list):
# hold new vertices we have to create
Expand Down Expand Up @@ -2096,7 +2096,7 @@ def export_stl_file(
output.write(b" " * 80)
output.write(struct.pack("<l", len(connectivity) // 3))
for element_index in range(len(connectivity) // 3):
tri = connectivity[element_index * 3 : (element_index + 1) * 3]
tri = connectivity[element_index * 3: (element_index + 1) * 3]
normal = (
c[tri[1]][1] * c[tri[2]][2] - c[tri[2]][1] * c[tri[1]][2],
c[tri[1]][2] * c[tri[2]][0] - c[tri[2]][2] * c[tri[1]][0],
Expand Down Expand Up @@ -2282,7 +2282,7 @@ def _calculate_element_field_extreme(
element_index = values.index(extreme)
extreme_node_indices = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
if extreme is None:
Expand Down Expand Up @@ -2865,7 +2865,7 @@ def _translate_element_blocks(self, element_block_translation_list):
nodes_per_element = self.get_nodes_per_element(id_)
# iterate over each element
for local_node in [
connectivity[x : x + nodes_per_element]
connectivity[x: x + nodes_per_element]
for x in range(0, len(connectivity), nodes_per_element)
]:
# iterate over each new averaged node formula
Expand All @@ -2892,7 +2892,7 @@ def _translate_element_blocks(self, element_block_translation_list):
# create the connectivity for the new element block
new_connectivity = []
for local_node in [
connectivity[x : x + nodes_per_element]
connectivity[x: x + nodes_per_element]
for x in range(0, len(connectivity), nodes_per_element)
]:
for new_element in scheme:
Expand Down Expand Up @@ -3103,7 +3103,7 @@ def _translate_element_type(self, element_block_id, new_element_type, scheme):
for element_index in range(element_count):
local_node = connectivity[
element_index
* old_nodes_per_element : (element_index + 1)
* old_nodes_per_element: (element_index + 1)
* old_nodes_per_element
]
for new_element in scheme:
Expand Down Expand Up @@ -3131,7 +3131,7 @@ def _translate_element_type(self, element_block_id, new_element_type, scheme):
for element_index in range(element_count):
local_node = connectivity[
element_index
* old_nodes_per_element : (element_index + 1)
* old_nodes_per_element: (element_index + 1)
* old_nodes_per_element
]
for new_element in scheme:
Expand Down Expand Up @@ -4724,7 +4724,7 @@ def _transform_expression(self, expression):
new_expression = expression[:left_index]
left_expression = expression[left_index:separator_index].strip()
right_expression = expression[
separator_index + len(separator) : right_index
separator_index + len(separator): right_index
].strip()
for c in transform:
if c == "L":
Expand Down Expand Up @@ -5381,7 +5381,7 @@ def _get_internal_faces(self, element_block_ids="all", set_of_nodes=None):
for element_index in range(element_count):
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
for face_index, (face_type, face_mapping) in enumerate(face_mappings):
Expand Down Expand Up @@ -6582,7 +6582,7 @@ def calculate_element_volumes(
# get local node values
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
# get local coordinates
Expand Down Expand Up @@ -7491,7 +7491,7 @@ def delete_duplicate_elements(self, element_block_ids="all"):
duplicates = []
for x in range(0, element_count):
start = x * nodes_per_element
element = set(connectivity[start : start + nodes_per_element])
element = set(connectivity[start: start + nodes_per_element])
element = tuple(sorted(element))
if element in elements:
duplicates.append(x)
Expand Down Expand Up @@ -8528,7 +8528,7 @@ def _create_element_blocks_from_side_sets(self, side_set_ids):
new_elements[face_type] = []
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
new_elements[face_type].extend(
Expand Down Expand Up @@ -8623,7 +8623,7 @@ def get_element_edge_length_info(self, element_block_ids="all"):
for element_index in range(element_count):
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
for edge in endpoints:
Expand Down Expand Up @@ -8847,7 +8847,7 @@ def count_degenerate_elements(self, element_block_ids="all"):
for element_index in range(element_count):
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
if len(set(local_node)) != nodes_per_element:
Expand All @@ -8874,7 +8874,7 @@ def count_disconnected_blocks(self, element_block_ids="all"):
element_count = self.get_element_count(element_block_id)
for i in range(element_count):
local_node = connectivity[
i * nodes_per_element : (i + 1) * nodes_per_element
i * nodes_per_element: (i + 1) * nodes_per_element
]
# find lowest index master out of these
low = min(local_node)
Expand Down Expand Up @@ -8919,7 +8919,7 @@ def _get_mating_faces(self, side_set_members_one, side_set_members_two):
for element_index, face_index in members:
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
face_nodes = [local_node[x] for x in face_mapping[face_index][1]]
Expand All @@ -8933,7 +8933,7 @@ def _get_mating_faces(self, side_set_members_one, side_set_members_two):
for element_index, face_index in members:
local_node = connectivity[
element_index
* nodes_per_element : (element_index + 1)
* nodes_per_element: (element_index + 1)
* nodes_per_element
]
face_nodes = [local_node[x] for x in face_mapping[face_index][1]]
Expand Down

0 comments on commit d5a78ec

Please sign in to comment.