diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index ac75505e..0a00f1ba 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,6 +1,6 @@ repos: - repo: https://github.com/psf/black - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black diff --git a/ansys/mapdl/reader/archive.py b/ansys/mapdl/reader/archive.py index 2289fd9c..b6c2ae2c 100644 --- a/ansys/mapdl/reader/archive.py +++ b/ansys/mapdl/reader/archive.py @@ -1,4 +1,5 @@ """Module to read ANSYS ASCII block formatted CDB files.""" + from functools import wraps import io import logging diff --git a/ansys/mapdl/reader/cell_quality.py b/ansys/mapdl/reader/cell_quality.py index 1afea6ee..bb1af4ae 100644 --- a/ansys/mapdl/reader/cell_quality.py +++ b/ansys/mapdl/reader/cell_quality.py @@ -1,6 +1,7 @@ """Provides a basic interface to computing the minimum scaled Jacobian cell quality from VTK unstructured grids. """ + import numpy as np import pyvista as pv diff --git a/ansys/mapdl/reader/common.py b/ansys/mapdl/reader/common.py index b9ecb009..dfbaa2a1 100644 --- a/ansys/mapdl/reader/common.py +++ b/ansys/mapdl/reader/common.py @@ -1,4 +1,5 @@ """Methods common to binary files""" + from collections import Counter import pathlib import struct diff --git a/ansys/mapdl/reader/cyclic_reader.py b/ansys/mapdl/reader/cyclic_reader.py index 216275a7..39b9f4b8 100644 --- a/ansys/mapdl/reader/cyclic_reader.py +++ b/ansys/mapdl/reader/cyclic_reader.py @@ -1,4 +1,5 @@ """Supports reading cyclic structural result files from ANSYS""" + from functools import wraps import numpy as np diff --git a/ansys/mapdl/reader/dis_result.py b/ansys/mapdl/reader/dis_result.py index 4d964ad7..ef0a1e7d 100644 --- a/ansys/mapdl/reader/dis_result.py +++ b/ansys/mapdl/reader/dis_result.py @@ -1,4 +1,5 @@ """Handle result files from a distributed MAPDL analysis""" + from functools import wraps import glob from inspect import currentframe diff --git a/ansys/mapdl/reader/elements.py b/ansys/mapdl/reader/elements.py index 6d4352dd..15b954f3 100644 --- a/ansys/mapdl/reader/elements.py +++ b/ansys/mapdl/reader/elements.py @@ -222,6 +222,7 @@ PLANE293 USER300 """ + import numpy as np # element type to VTK conversion function call map diff --git a/ansys/mapdl/reader/emat.py b/ansys/mapdl/reader/emat.py index 0e6db32f..1a17b293 100644 --- a/ansys/mapdl/reader/emat.py +++ b/ansys/mapdl/reader/emat.py @@ -311,6 +311,7 @@ c kygrf global restoring force matrix calculate key """ + import pathlib import numpy as np diff --git a/ansys/mapdl/reader/examples/downloads.py b/ansys/mapdl/reader/examples/downloads.py index f1b18df2..6186ec8d 100644 --- a/ansys/mapdl/reader/examples/downloads.py +++ b/ansys/mapdl/reader/examples/downloads.py @@ -1,5 +1,6 @@ """Functions to download sample datasets from the pymapdl data repository """ + import os import shutil import urllib.request diff --git a/ansys/mapdl/reader/examples/examples.py b/ansys/mapdl/reader/examples/examples.py index 3af84291..bb3d3591 100644 --- a/ansys/mapdl/reader/examples/examples.py +++ b/ansys/mapdl/reader/examples/examples.py @@ -1,4 +1,5 @@ """PyMAPDL-Reader example files""" + import inspect import os import sys diff --git a/ansys/mapdl/reader/full.py b/ansys/mapdl/reader/full.py index c91227b3..eff4118b 100644 --- a/ansys/mapdl/reader/full.py +++ b/ansys/mapdl/reader/full.py @@ -4,6 +4,7 @@ See: /ansys/customize/include/fdfull.inc """ + import pathlib from typing import Union import warnings diff --git a/ansys/mapdl/reader/mesh.py b/ansys/mapdl/reader/mesh.py index 838fa094..f25092e5 100644 --- a/ansys/mapdl/reader/mesh.py +++ b/ansys/mapdl/reader/mesh.py @@ -1,4 +1,5 @@ """Module for common class between Archive, and result mesh.""" + import numpy as np import pyvista as pv diff --git a/ansys/mapdl/reader/misc.py b/ansys/mapdl/reader/misc.py index fc84ca22..b7ea7eae 100644 --- a/ansys/mapdl/reader/misc.py +++ b/ansys/mapdl/reader/misc.py @@ -1,4 +1,5 @@ """Module for miscellaneous functions and methods""" + import os import random import string diff --git a/ansys/mapdl/reader/plotting.py b/ansys/mapdl/reader/plotting.py index f521c014..9c770424 100644 --- a/ansys/mapdl/reader/plotting.py +++ b/ansys/mapdl/reader/plotting.py @@ -1,4 +1,5 @@ """Plotting helper for MAPDL using pyvista""" + import numpy as np import pyvista as pv diff --git a/ansys/mapdl/reader/rst.py b/ansys/mapdl/reader/rst.py index fb75c31c..46c0e970 100644 --- a/ansys/mapdl/reader/rst.py +++ b/ansys/mapdl/reader/rst.py @@ -3,6 +3,7 @@ Used: .../ansys/customize/include/fdresu.inc """ + from collections.abc import Iterable, Sequence from functools import wraps import os diff --git a/ansys/mapdl/reader/rst_avail.py b/ansys/mapdl/reader/rst_avail.py index 693c8119..e4f09d30 100644 --- a/ansys/mapdl/reader/rst_avail.py +++ b/ansys/mapdl/reader/rst_avail.py @@ -44,7 +44,6 @@ """ - DESCRIPTION = { "EMS": "miscellaneous summable items(normally includes face pressures)", "ENF": "nodal forces", diff --git a/examples/00-read_binary/custom_visualization.py b/examples/00-read_binary/custom_visualization.py index a27debfe..9ca788a4 100644 --- a/examples/00-read_binary/custom_visualization.py +++ b/examples/00-read_binary/custom_visualization.py @@ -6,6 +6,7 @@ Display custom scalars using an existing mesh. """ + import numpy as np from ansys.mapdl.reader import examples diff --git a/examples/00-read_binary/load_corner_result.py b/examples/00-read_binary/load_corner_result.py index 3d88182e..ff400017 100644 --- a/examples/00-read_binary/load_corner_result.py +++ b/examples/00-read_binary/load_corner_result.py @@ -8,6 +8,7 @@ MAPDL (e.g. ``RSYS, 1``). """ + ################################################################################ # Download a small result file containing the corner of a thick pipe from ansys.mapdl.reader import examples diff --git a/examples/00-read_binary/load_shaft_result.py b/examples/00-read_binary/load_shaft_result.py index 47af483d..0cdd5b2f 100644 --- a/examples/00-read_binary/load_shaft_result.py +++ b/examples/00-read_binary/load_shaft_result.py @@ -7,6 +7,7 @@ Visualize a shaft modal analysis """ + # sphinx_gallery_thumbnail_number = 6 from ansys.mapdl.reader import examples diff --git a/examples/00-read_binary/load_thermal_result.py b/examples/00-read_binary/load_thermal_result.py index 62114907..b140b39d 100644 --- a/examples/00-read_binary/load_thermal_result.py +++ b/examples/00-read_binary/load_thermal_result.py @@ -7,6 +7,7 @@ Visualize the result of verification manual test 33. """ + from ansys.mapdl.reader import examples ################################################################################ diff --git a/examples/00-read_binary/pontoon.py b/examples/00-read_binary/pontoon.py index fb1736b6..e4583d54 100644 --- a/examples/00-read_binary/pontoon.py +++ b/examples/00-read_binary/pontoon.py @@ -6,6 +6,7 @@ Visualize a shell static analysis """ + # download the pontoon example from ansys.mapdl.reader import examples diff --git a/examples/01-cyclic_results/academic_sector_nd.py b/examples/01-cyclic_results/academic_sector_nd.py index 8a74fd19..1f0102c4 100644 --- a/examples/01-cyclic_results/academic_sector_nd.py +++ b/examples/01-cyclic_results/academic_sector_nd.py @@ -9,6 +9,7 @@ multi-bladed sectors from a modal analysis. """ + # sphinx_gallery_thumbnail_number = 2 import numpy as np diff --git a/examples/01-cyclic_results/academic_sector_stress_strain.py b/examples/01-cyclic_results/academic_sector_stress_strain.py index 4c811a96..85a7b484 100644 --- a/examples/01-cyclic_results/academic_sector_stress_strain.py +++ b/examples/01-cyclic_results/academic_sector_stress_strain.py @@ -8,6 +8,7 @@ modal analysis. """ + # sphinx_gallery_thumbnail_number = 2 from ansys.mapdl.reader import examples diff --git a/examples/01-cyclic_results/sector_model.py b/examples/01-cyclic_results/sector_model.py index 84c39d04..ca6df892 100644 --- a/examples/01-cyclic_results/sector_model.py +++ b/examples/01-cyclic_results/sector_model.py @@ -9,6 +9,7 @@ First, load the rotor. Notice how printing the rotor class reveals the details of the rotor result file. """ + # sphinx_gallery_thumbnail_number = 2 from ansys.mapdl.reader import examples diff --git a/setup.py b/setup.py index 8d64d8f3..cbef48f0 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ """Installation file for ansys-mapdl-reader""" + from io import open as io_open import os diff --git a/tests/elements/plane_182_183/test_plane182_183.py b/tests/elements/plane_182_183/test_plane182_183.py index 6810a485..280f4dc1 100644 --- a/tests/elements/plane_182_183/test_plane182_183.py +++ b/tests/elements/plane_182_183/test_plane182_183.py @@ -4,6 +4,7 @@ Need to add ansys results for verification... """ + import os import numpy as np diff --git a/tests/elements/shell181/test_shell181.py b/tests/elements/shell181/test_shell181.py index e9a227ee..f571198c 100644 --- a/tests/elements/shell181/test_shell181.py +++ b/tests/elements/shell181/test_shell181.py @@ -76,6 +76,7 @@ """ + import os import numpy as np diff --git a/tests/elements/shell181/test_shell181_element_coord.py b/tests/elements/shell181/test_shell181_element_coord.py index 4941d4c9..3fc51db1 100644 --- a/tests/elements/shell181/test_shell181_element_coord.py +++ b/tests/elements/shell181/test_shell181_element_coord.py @@ -26,6 +26,7 @@ coordinate system. """ + import os import numpy as np diff --git a/tests/test_rst.py b/tests/test_rst.py index 9dc64df0..df136b69 100644 --- a/tests/test_rst.py +++ b/tests/test_rst.py @@ -32,6 +32,7 @@ mapdl.modal_analysis(nmode=1) """ + import os import pathlib import platform diff --git a/tests/testfiles/dist_rst/static/build.py b/tests/testfiles/dist_rst/static/build.py index 9d16aaee..688e988c 100644 --- a/tests/testfiles/dist_rst/static/build.py +++ b/tests/testfiles/dist_rst/static/build.py @@ -1,6 +1,7 @@ """ These example files were built with the following script. """ + import os import numpy as np