Skip to content

Commit b2c37aa

Browse files
chore: pre-commit automatic update (#154)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 41f6613 commit b2c37aa

File tree

5 files changed

+26
-51
lines changed

5 files changed

+26
-51
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ repos:
1515
- "max_line_length=180,retain_line_breaks=true,retain_line_breaks_single=true"
1616

1717
- repo: https://github.com/psf/black-pre-commit-mirror
18-
rev: 25.12.0
18+
rev: 26.1.0
1919
hooks:
2020
- id: black
2121

fluent-mechanical/wf_fm_01_fluent.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
7575
""" # noqa: D400, D415
7676

77-
7877
# Perform required imports
7978
# ------------------------
8079
# Perform required imports, which includes downloading the mesh file from the

fluent-mechanical/wf_fm_02_mechanical.py

Lines changed: 24 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -160,8 +160,7 @@ def display_image(image_name):
160160
# -----------------------------------
161161
#
162162

163-
mechanical.run_python_script(
164-
"""
163+
mechanical.run_python_script("""
165164
ExtAPI.Graphics.Camera.SetSpecificViewOrientation(
166165
Ansys.Mechanical.DataModel.Enums.ViewOrientationType.Iso
167166
)
@@ -175,16 +174,14 @@ def display_image(image_name):
175174
settings_720p.Width = 1280
176175
settings_720p.Height = 720
177176
settings_720p.CurrentGraphicsDisplay = False
178-
"""
179-
)
177+
""")
180178

181179
###############################################################################
182180
# Import geometry
183181
# ---------------
184182
#
185183

186-
mechanical.run_python_script(
187-
"""
184+
mechanical.run_python_script("""
188185
import os
189186
geometry_import_group = Model.GeometryImportGroup
190187
geometry_import = geometry_import_group.AddGeometryImport()
@@ -204,8 +201,7 @@ def display_image(image_name):
204201
ExtAPI.Graphics.ExportImage(
205202
os.path.join(project_directory, "geometry.png"), image_export_format, settings_720p
206203
)
207-
"""
208-
)
204+
""")
209205

210206
# Download the geometry image and display it
211207
mechanical.download(files=os.path.join(project_directory, "geometry.png"), target_dir=OUTPUT_DIR)
@@ -217,8 +213,7 @@ def display_image(image_name):
217213
# Import material, assign it to the bodies and create Named Selections
218214
# --------------------------------------------------------------------
219215
#
220-
mechanical.run_python_script(
221-
"""
216+
mechanical.run_python_script("""
222217
materials = ExtAPI.DataModel.Project.Model.Materials
223218
materials.Import(material_path)
224219
materials.RefreshMaterials()
@@ -255,15 +250,13 @@ def display_image(image_name):
255250
EM_OUTER_SURFACE_NS = [x for x in ExtAPI.DataModel.Tree.AllObjects if x.Name == "em_outer_surface"][
256251
0
257252
]
258-
"""
259-
)
253+
""")
260254

261255
###############################################################################
262256
# Set up the mesh and generate
263257
# ----------------------------
264258
#
265-
mechanical.run_python_script(
266-
"""
259+
mechanical.run_python_script("""
267260
MESH = Model.Mesh
268261
269262
MESH.UseAdaptiveSizing = True
@@ -278,8 +271,7 @@ def display_image(image_name):
278271
ExtAPI.Graphics.ExportImage(
279272
os.path.join(project_directory, "mesh.png"), image_export_format, settings_720p
280273
)
281-
"""
282-
)
274+
""")
283275

284276
# Download the mesh image and display it
285277
mechanical.download(files=os.path.join(project_directory, "mesh.png"), target_dir=OUTPUT_DIR)
@@ -291,8 +283,7 @@ def display_image(image_name):
291283
# ---------------------------------------------------------------
292284
#
293285

294-
mechanical.run_python_script(
295-
"""
286+
mechanical.run_python_script("""
296287
Model.AddTransientThermalAnalysis()
297288
298289
# Store all main tree nodes as variables
@@ -475,23 +466,19 @@ def display_image(image_name):
475466
group_list = [External_Convection_Load_1, External_Convection_Load_2, External_Convection_Load_3]
476467
grouping_folder = Tree.Group(group_list)
477468
tree_grouping_folder_70 = DataModel.GetObjectsByName("New Folder")
478-
"""
479-
)
469+
""")
480470

481471
###############################################################################
482472
# Use the output from Fluent to import the temperature and HTC data
483473
# -----------------------------------------------------------------
484474
#
485475
# Add imported convection
486-
result = mechanical.run_python_script(
487-
"""
476+
result = mechanical.run_python_script("""
488477
Imported_Load_Group = TRANS_THERM.AddImportedLoadExternalData()
489478
imported_load_group_61=Imported_Load_Group
490479
imported_convection_62 = Imported_Load_Group.AddImportedConvection()
491-
"""
492-
)
493-
result = mechanical.run_python_script(
494-
"""
480+
""")
481+
result = mechanical.run_python_script("""
495482
external_data_files = Ansys.Mechanical.ExternalData.ExternalDataFileCollection()
496483
external_data_files.SaveFilesWithProject = False
497484
@@ -604,11 +591,9 @@ def display_image(image_name):
604591
)
605592
606593
imported_load_group_61.ImportExternalDataFiles(external_data_files)
607-
"""
608-
)
594+
""")
609595

610-
result = mechanical.run_python_script(
611-
"""
596+
result = mechanical.run_python_script("""
612597
table = imported_load_group_61.Children[0].GetTableByName("Film Coefficient")
613598
numofsteps = 15
614599
Film_Coeff = [
@@ -638,20 +623,17 @@ def display_image(image_name):
638623
imported_convection_62.Location = selection
639624
imported_load_id = imported_convection_62.ObjectId
640625
imported_load = DataModel.GetObjectById(imported_load_id)
641-
"""
642-
)
626+
""")
643627

644-
mechanical.run_python_script(
645-
"""
628+
mechanical.run_python_script("""
646629
imported_load.ImportLoad()
647630
648631
Tree.Activate([imported_load])
649632
ExtAPI.Graphics.Camera.SetFit()
650633
ExtAPI.Graphics.ExportImage(
651634
os.path.join(project_directory, "imported_temperature.png"), image_export_format, settings_720p
652635
)
653-
"""
654-
)
636+
""")
655637
mechanical.download(
656638
files=os.path.join(project_directory, "imported_temperature.png"), target_dir=OUTPUT_DIR
657639
)
@@ -662,8 +644,7 @@ def display_image(image_name):
662644
# Solve and post-process the results
663645
# ----------------------------------
664646
#
665-
mechanical.run_python_script(
666-
"""
647+
mechanical.run_python_script("""
667648
# Insert results objects
668649
669650
Temp = TRANS_THERM_SOLN.AddTemperature()
@@ -683,8 +664,7 @@ def display_image(image_name):
683664
ExtAPI.Graphics.ExportImage(
684665
os.path.join(project_directory, "temperature.png"), image_export_format, settings_720p
685666
)
686-
"""
687-
)
667+
""")
688668

689669
# Download the temperature image and display it
690670
mechanical.download(files=os.path.join(project_directory, "temperature.png"), target_dir=OUTPUT_DIR)
@@ -696,8 +676,7 @@ def display_image(image_name):
696676
# Setup Structural Analysis
697677
# -------------------------
698678
#
699-
mechanical.run_python_script(
700-
"""
679+
mechanical.run_python_script("""
701680
Model.AddStaticStructuralAnalysis()
702681
703682
# Define analysis settings
@@ -756,15 +735,13 @@ def display_image(image_name):
756735
Fixed_Support = STAT_STRUC.AddFixedSupport()
757736
selection = NS_GRP.Children[3]
758737
Fixed_Support.Location = selection
759-
"""
760-
)
738+
""")
761739

762740
###############################################################################
763741
# Solve and post-process the results
764742
# ----------------------------------
765743
#
766-
mechanical.run_python_script(
767-
"""
744+
mechanical.run_python_script("""
768745
SOLN = STAT_STRUC.Solution
769746
770747
TOT_DEF1 = SOLN.AddTotalDeformation()
@@ -803,8 +780,7 @@ def display_image(image_name):
803780
ExtAPI.Graphics.ExportImage(
804781
os.path.join(project_directory, "plastic_strain.png"), image_export_format, settings_720p
805782
)
806-
"""
807-
)
783+
""")
808784

809785
# Download the results images to local directory
810786
mechanical.download(files=os.path.join(project_directory, "deformation.png"), target_dir=OUTPUT_DIR)

geometry-mechanical-dpf/wf_gmd_03_dpf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
and analyze them.
3030
3131
""" # noqa: D400, D415
32+
3233
import os
3334
from pathlib import Path
3435

geometry-mesh/wf_gm_01_geometry.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
3333
""" # noqa: D400, D415
3434

35-
3635
import os
3736
from pathlib import Path
3837

0 commit comments

Comments
 (0)