diff --git a/.ci/display_test.py b/.ci/display_test.py index 9144c8caa0..3e3e1f40ac 100644 --- a/.ci/display_test.py +++ b/.ci/display_test.py @@ -1,4 +1,5 @@ """Quickly check if VTK off screen plotting works.""" + import pyvista from pyvista.plotting import system_supports_plotting diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b947d81cca..6fea7ebf98 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -26,7 +26,7 @@ repos: ) - repo: https://github.com/psf/black - rev: 23.12.1 # If version changes --> modify "blacken-docs" manually as well. + rev: 24.1.1 # If version changes --> modify "blacken-docs" manually as well. hooks: - id: black args: diff --git a/doc/source/conf.py b/doc/source/conf.py index 766a3b33f5..e2ac8f0860 100755 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -1,4 +1,5 @@ """Sphinx documentation configuration file.""" + from datetime import datetime import os import warnings diff --git a/doc/validate_png.py b/doc/validate_png.py index 921d5d3b85..d8e4cf2bd6 100644 --- a/doc/validate_png.py +++ b/doc/validate_png.py @@ -3,6 +3,7 @@ Removes invalid PNGs (probably GIF) """ + from glob import glob import os diff --git a/src/ansys/mapdl/core/commands.py b/src/ansys/mapdl/core/commands.py index 1bc7ec8610..22ba55e48e 100644 --- a/src/ansys/mapdl/core/commands.py +++ b/src/ansys/mapdl/core/commands.py @@ -482,7 +482,6 @@ class Commands( map_cmd.MapCommand, InqFunctions, ): - """Wrapped MAPDL commands""" diff --git a/src/ansys/mapdl/core/component.py b/src/ansys/mapdl/core/component.py index 646da80222..96301bdde6 100644 --- a/src/ansys/mapdl/core/component.py +++ b/src/ansys/mapdl/core/component.py @@ -250,7 +250,9 @@ def __init__(self, mapdl: Mapdl) -> None: self._mapdl_weakref: weakref.ReferenceType[Mapdl] = weakref.ref(mapdl) self.__comp: UNDERLYING_DICT = {} self._update_always: bool = True - self._autoselect_components: bool = False # if True, PyMAPDL will try to select the CM first if it does not appear in the CMLIST output. + self._autoselect_components: bool = ( + False # if True, PyMAPDL will try to select the CM first if it does not appear in the CMLIST output. + ) self._default_entity: ENTITIES_TYP = "NODES" self._default_entity_warning: bool = True diff --git a/src/ansys/mapdl/core/database/database.py b/src/ansys/mapdl/core/database/database.py index e492fd5b4d..3323a664d1 100644 --- a/src/ansys/mapdl/core/database/database.py +++ b/src/ansys/mapdl/core/database/database.py @@ -40,7 +40,6 @@ class WithinBeginLevel: - """Context manager to run MAPDL within the being level.""" def __init__(self, mapdl): @@ -86,7 +85,6 @@ def wrapper(self, *args, **kwargs): class DBDef(Enum): # From MAPDL ansysdef.inc include file - """Database type definitions.""" DB_SELECTED = 1 @@ -104,7 +102,6 @@ class DBDef(Enum): # From MAPDL ansysdef.inc include file class MapdlDb: - """ Abstract mapdl database class. Created from a ``Mapdl`` instance. diff --git a/src/ansys/mapdl/core/database/elems.py b/src/ansys/mapdl/core/database/elems.py index 46d5570f6d..3339d6728c 100644 --- a/src/ansys/mapdl/core/database/elems.py +++ b/src/ansys/mapdl/core/database/elems.py @@ -36,7 +36,6 @@ class DbElems: - """ Abstract mapdl database element class. diff --git a/src/ansys/mapdl/core/database/nodes.py b/src/ansys/mapdl/core/database/nodes.py index 4e2d30f501..d256bd0b1e 100644 --- a/src/ansys/mapdl/core/database/nodes.py +++ b/src/ansys/mapdl/core/database/nodes.py @@ -40,7 +40,6 @@ class DbNodes: - """ Abstract mapdl db nodes class. diff --git a/src/ansys/mapdl/core/errors.py b/src/ansys/mapdl/core/errors.py index dd1af3322a..a2c660879e 100644 --- a/src/ansys/mapdl/core/errors.py +++ b/src/ansys/mapdl/core/errors.py @@ -201,7 +201,6 @@ def __init__(self, msg=""): class MapdlError(MapdlException): - """General MAPDL Error""" def __init__(self, msg=""): @@ -209,7 +208,6 @@ def __init__(self, msg=""): class MapdlWarning(MapdlException): - """General MAPDL warning""" def __init__(self, msg=""): @@ -217,7 +215,6 @@ def __init__(self, msg=""): class MapdlNote(MapdlException): - """General MAPDL note""" def __init__(self, msg=""): @@ -225,7 +222,6 @@ def __init__(self, msg=""): class MapdlInfo(MapdlException): - """General MAPDL info message""" def __init__(self, msg=""): @@ -233,7 +229,6 @@ def __init__(self, msg=""): class MapdlVersionError(MapdlException): - """Incompatible MAPDL version""" def __init__(self, msg=""): diff --git a/src/ansys/mapdl/core/misc.py b/src/ansys/mapdl/core/misc.py index b92359b5bc..d9ef258ecd 100644 --- a/src/ansys/mapdl/core/misc.py +++ b/src/ansys/mapdl/core/misc.py @@ -1009,9 +1009,13 @@ def _get_title(self): def _get_stitles(self): return [ - re.search(f"SUBTITLE {i}=(.*)", self._get_titles()).groups(1)[0].strip() - if re.search(f"SUBTITLE {i}=(.*)", self._get_titles()) - else "" + ( + re.search(f"SUBTITLE {i}=(.*)", self._get_titles()) + .groups(1)[0] + .strip() + if re.search(f"SUBTITLE {i}=(.*)", self._get_titles()) + else "" + ) for i in range(1, 5) ] diff --git a/src/ansys/mapdl/core/parameters.py b/src/ansys/mapdl/core/parameters.py index acd8cf7f05..39e1c27d84 100644 --- a/src/ansys/mapdl/core/parameters.py +++ b/src/ansys/mapdl/core/parameters.py @@ -836,9 +836,9 @@ def interp_star_status(status): elif len(items) == 4: # it is an array or string array if is_array_listing(status): - myarray[ - int(items[0]) - 1, int(items[1]) - 1, int(items[2]) - 1 - ] = float(items[3]) + myarray[int(items[0]) - 1, int(items[1]) - 1, int(items[2]) - 1] = ( + float(items[3]) + ) elif is_string_array: elements.append(items[-1]) diff --git a/src/ansys/mapdl/core/plotting.py b/src/ansys/mapdl/core/plotting.py index 68548cb6cd..ea9a77283e 100644 --- a/src/ansys/mapdl/core/plotting.py +++ b/src/ansys/mapdl/core/plotting.py @@ -1096,13 +1096,13 @@ def bc_nodes_plotter( for id_, values in zip(bc_num, bc_values): if not bc_point_labels[id_]: - bc_point_labels[ - id_ - ] = f"Node: {id_}\n{each_label}: {values[0]:6.3f}, {values[1]:6.3f}" + bc_point_labels[id_] = ( + f"Node: {id_}\n{each_label}: {values[0]:6.3f}, {values[1]:6.3f}" + ) else: - bc_point_labels[ - id_ - ] = f"{bc_point_labels[id_]}\n{each_label}: {values[0]:6.3f}, {values[1]:6.3f}" + bc_point_labels[id_] = ( + f"{bc_point_labels[id_]}\n{each_label}: {values[0]:6.3f}, {values[1]:6.3f}" + ) if plot_bc_labels: pcloud = pv.PolyData(nodes_xyz)