Skip to content

Commit

Permalink
[pre-commit.ci] pre-commit autoupdate (#2716)
Browse files Browse the repository at this point in the history
* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/psf/black: 23.12.1 → 24.1.1](psf/black@23.12.1...24.1.1)

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
pre-commit-ci[bot] authored Jan 30, 2024
1 parent 0a35cee commit 4e2f0fa
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 25 deletions.
1 change: 1 addition & 0 deletions .ci/display_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Quickly check if VTK off screen plotting works."""

import pyvista
from pyvista.plotting import system_supports_plotting

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Sphinx documentation configuration file."""

from datetime import datetime
import os
import warnings
Expand Down
1 change: 1 addition & 0 deletions doc/validate_png.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Removes invalid PNGs (probably GIF)
"""

from glob import glob
import os

Expand Down
1 change: 0 additions & 1 deletion src/ansys/mapdl/core/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ class Commands(
map_cmd.MapCommand,
InqFunctions,
):

"""Wrapped MAPDL commands"""


Expand Down
4 changes: 3 additions & 1 deletion src/ansys/mapdl/core/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 0 additions & 3 deletions src/ansys/mapdl/core/database/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@


class WithinBeginLevel:

"""Context manager to run MAPDL within the being level."""

def __init__(self, mapdl):
Expand Down Expand Up @@ -86,7 +85,6 @@ def wrapper(self, *args, **kwargs):


class DBDef(Enum): # From MAPDL ansysdef.inc include file

"""Database type definitions."""

DB_SELECTED = 1
Expand All @@ -104,7 +102,6 @@ class DBDef(Enum): # From MAPDL ansysdef.inc include file


class MapdlDb:

"""
Abstract mapdl database class. Created from a ``Mapdl`` instance.
Expand Down
1 change: 0 additions & 1 deletion src/ansys/mapdl/core/database/elems.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@


class DbElems:

"""
Abstract mapdl database element class.
Expand Down
1 change: 0 additions & 1 deletion src/ansys/mapdl/core/database/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@


class DbNodes:

"""
Abstract mapdl db nodes class.
Expand Down
5 changes: 0 additions & 5 deletions src/ansys/mapdl/core/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,39 +201,34 @@ def __init__(self, msg=""):


class MapdlError(MapdlException):

"""General MAPDL Error"""

def __init__(self, msg=""):
super().__init__(msg)


class MapdlWarning(MapdlException):

"""General MAPDL warning"""

def __init__(self, msg=""):
super().__init__(msg)


class MapdlNote(MapdlException):

"""General MAPDL note"""

def __init__(self, msg=""):
super().__init__(msg)


class MapdlInfo(MapdlException):

"""General MAPDL info message"""

def __init__(self, msg=""):
super().__init__(msg)


class MapdlVersionError(MapdlException):

"""Incompatible MAPDL version"""

def __init__(self, msg=""):
Expand Down
10 changes: 7 additions & 3 deletions src/ansys/mapdl/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
]

Expand Down
6 changes: 3 additions & 3 deletions src/ansys/mapdl/core/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])

Expand Down
12 changes: 6 additions & 6 deletions src/ansys/mapdl/core/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4e2f0fa

Please sign in to comment.