Skip to content

Commit

Permalink
flake8
Browse files Browse the repository at this point in the history
  • Loading branch information
GBenedett committed Nov 21, 2023
1 parent 0cbb4d7 commit b8ff3bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
2 changes: 1 addition & 1 deletion ceasiompy/CPACS2GMSH/cpacs2gmsh.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def cpacs2gmsh(cpacs_path, cpacs_out_path):
n_power_factor = get_value_or_default(cpacs.tixi, GMSH_N_POWER_FACTOR_XPATH, 2)
n_power_field = get_value_or_default(cpacs.tixi, GMSH_N_POWER_FIELD_XPATH, 0.9)
fuselage_mesh_size_factor = get_value_or_default(
cpacs.tixi,
cpacs.tixi,
GMSH_MESH_SIZE_FACTOR_FUSELAGE_XPATH,
1,
)
Expand Down
21 changes: 3 additions & 18 deletions ceasiompy/CPACS2SUMO/cpacs2sumo.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):
sec_transf.get_cpacs_transf(tixi, sec_xpath)

if sec_transf.rotation.x or sec_transf.rotation.y or sec_transf.rotation.z:

log.warning(
f"Sections '{sec_uid}' is rotated, it is"
"not possible to take that into account in SUMO !"
Expand Down Expand Up @@ -308,7 +307,7 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):

# if body_frm_height < 0.01:
# body_frm_height = 0.01

body_frm_width = (
prof_size_y
* 2
Expand Down Expand Up @@ -629,10 +628,7 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):

# to avoid double zero, not accepted by SUMO
prof_str += (
str(round(prof_vect_x[0], 4))
+ " "
+ str(round(prof_vect_z[0], 4))
+ " "
str(round(prof_vect_x[0], 4)) + " " + str(round(prof_vect_z[0], 4)) + " "
)

for i in range(1, len(prof_vect_x)):
Expand Down Expand Up @@ -889,10 +885,7 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):

# to avoid double zero, not accepted by SUMO
prof_str += (
str(round(prof_vect_x[0], 4))
+ " "
+ str(round(prof_vect_z[0], 4))
+ " "
str(round(prof_vect_x[0], 4)) + " " + str(round(prof_vect_z[0], 4)) + " "
)
for i in range(1, len(prof_vect_x)):
dx_squared = (prof_vect_x[i] - prof_vect_x[i - 1]) ** 2
Expand Down Expand Up @@ -959,13 +952,11 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):
engineparts = [engine.nacelle.fancowl, engine.nacelle.corecowl, engine.nacelle.centercowl]

for engpart in engineparts:

if not engpart.isengpart:
log.info("This engine part is not define.")
continue

if engpart.iscone:

xcontours = engpart.pointlist.xlist
ycontours = engpart.pointlist.ylist

Expand All @@ -975,7 +966,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):
zsectransl = 0

else:

xlist = engpart.section.pointlist.xlist
ylist = engpart.section.pointlist.ylist

Expand Down Expand Up @@ -1031,7 +1021,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):

# Add section
for i_sec in range(len(xcontours)):

namesec = "section_" + str(i_sec + 1)
# Only circle profiles
prof_str = " 0 -1 0.7071 -0.7071 1 0 0.7071 0.7071 0 1"
Expand All @@ -1056,7 +1045,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):
sumo_add_engine_bc(sumo, "Engine", engpart.uid)

if engine.sym:

sumo.createElementAtIndex("/Assembly", "BodySkeleton", i_fus + 1)
body_xpath = "/Assembly/BodySkeleton[" + str(i_fus + 1) + "]"

Expand All @@ -1073,7 +1061,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):

# Add section
for i_sec in range(len(xcontours)):

namesec = "section_" + str(i_sec + 1)
# Only circle profiles
prof_str = " 0 -1 0.7071 -0.7071 1 0 0.7071 0.7071 0 1"
Expand Down Expand Up @@ -1115,7 +1102,6 @@ def convert_cpacs_to_sumo(cpacs_path, cpacs_out_path):


def main(cpacs_path, cpacs_out_path):

log.info("----- Start of " + MODULE_NAME + " -----")

convert_cpacs_to_sumo(cpacs_path, cpacs_out_path)
Expand All @@ -1124,7 +1110,6 @@ def main(cpacs_path, cpacs_out_path):


if __name__ == "__main__":

cpacs_path = get_toolinput_file_path(MODULE_NAME)
cpacs_out_path = get_tooloutput_file_path(MODULE_NAME)

Expand Down

0 comments on commit b8ff3bb

Please sign in to comment.