Skip to content

Commit 22d52c9

Browse files
committed
Merge branch 'main' into release/0.52
2 parents dc5ca44 + 0dbc420 commit 22d52c9

File tree

12 files changed

+47
-39
lines changed

12 files changed

+47
-39
lines changed

.github/workflows/testing-and-deployment.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,6 @@ jobs:
275275
uses: softprops/action-gh-release@v1
276276
with:
277277
files: |
278-
./**/*.tar.gz
279278
./**/*.whl
280279
./**/*.zip
281280
./**/*.pdf

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
*.o
99
*.cache
1010

11+
# virtual environment
12+
venv/
13+
.venv/
14+
1115
# OS generated files #
1216
######################
1317
.fuse_hidden*
@@ -65,4 +69,7 @@ examples/.local
6569
.ipynb_checkpoints/
6670

6771
# docker
68-
docker/mapdl/v211
72+
docker/mapdl/v211
73+
74+
# Visual studio code local settings
75+
.vscode/

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
repos:
22
- repo: https://github.com/psf/black
3-
rev: 22.12.0
3+
rev: 23.1.0
44
hooks:
55
- id: black
66

77
- repo: https://github.com/pycqa/isort
8-
rev: 5.11.4
8+
rev: 5.12.0
99
hooks:
1010
- id: isort
1111
args: [
@@ -40,6 +40,6 @@ repos:
4040

4141
# this validates our github workflow files
4242
- repo: https://github.com/python-jsonschema/check-jsonschema
43-
rev: 0.20.0
43+
rev: 0.21.0
4444
hooks:
4545
- id: check-github-workflows

ansys/mapdl/reader/archive.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,6 @@ def save_as_archive(
642642

643643
if include_components:
644644
with open(filename, "a") as fid:
645-
646645
# write node components
647646
for node_key in grid.point_data:
648647
arr = grid.point_data[node_key]

ansys/mapdl/reader/common.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,10 +309,8 @@ def two_ints_to_long(intl, inth):
309309
def read_standard_header(filename):
310310
"""Reads standard header"""
311311
with open(filename, "rb") as f:
312-
313312
endian = "<"
314313
if np.fromfile(f, dtype="<i", count=1) != 100:
315-
316314
# Check if big enos
317315
f.seek(0)
318316
if np.fromfile(f, dtype=">i", count=1) == 100:

ansys/mapdl/reader/full.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,6 @@ def load_km(self, as_sparse=True, sort=False):
428428

429429
# output as a sparse matrix
430430
if as_sparse:
431-
432431
if kdata is not None:
433432
k = coo_matrix((self.neqn,) * 2)
434433
k.data = kdata # data has to be set first

ansys/mapdl/reader/mesh.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def _parse_vtk(
187187

188188
if allowable_types is None or 200 in allowable_types:
189189
for etype_ind, etype in self._ekey:
190-
191190
# MESH200
192191
if etype == 200 and etype_ind in self.key_option:
193192
# keyoption 1 contains various cell types

ansys/mapdl/reader/rst.py

Lines changed: 16 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import numpy as np
1616
import pyvista as pv
1717
from pyvista import _vtk as vtk
18+
from pyvista.themes import DefaultTheme
1819
from tqdm import tqdm
1920

2021
from ansys.mapdl.reader import _binary_reader, _reader, elements
@@ -60,7 +61,7 @@ def access_bit(data, num):
6061

6162
EMAIL_ME = """Please raise an issue at:
6263
https://github.com/pyansys/pymapdl-reader/issues
63-
Or email the developer at alexander.kaszynski@ansys.com
64+
Or email the PyAnsys support team at pyansys.support@ansys.com
6465
"""
6566
np.seterr(divide="ignore", invalid="ignore")
6667

@@ -3020,7 +3021,8 @@ def _plot_point_scalars(
30203021
plotter.add_axes()
30213022

30223023
# set background
3023-
plotter.background_color = kwargs.pop("background", None)
3024+
theme = DefaultTheme()
3025+
theme.background = kwargs.pop("background", None)
30243026

30253027
# remove extra keyword args
30263028
kwargs.pop("node_components", None)
@@ -3034,14 +3036,13 @@ def _plot_point_scalars(
30343036

30353037
# set scalar bar text colors
30363038
if text_color:
3037-
text_color = pv.parse_color(text_color)
3038-
plotter.scalar_bar.GetLabelTextProperty().SetColor(text_color)
3039-
plotter.scalar_bar.GetAnnotationTextProperty().SetColor(text_color)
3040-
plotter.scalar_bar.GetTitleTextProperty().SetColor(text_color)
3039+
theme = DefaultTheme()
3040+
theme.color = text_color
3041+
pv.global_theme.load_theme(theme)
30413042

30423043
# NAN/missing data are white
30433044
# plotter.renderers[0].SetUseDepthPeeling(1) # <-- for transparency issues
3044-
plotter.mapper.GetLookupTable().SetNanColor(1, 1, 1, 1)
3045+
theme.nan_color = [1, 1, 1, 1]
30453046

30463047
if cpos:
30473048
plotter.camera_position = cpos
@@ -3103,7 +3104,6 @@ def exit_callback(plotter, RenderWindowInteractor, event):
31033104
first_loop = True
31043105
cached_normals = [None for _ in range(n_frames)]
31053106
while self._animating:
3106-
31073107
for j, angle in enumerate(np.linspace(0, np.pi * 2, n_frames + 1)[:-1]):
31083108
mag_adj = np.sin(angle)
31093109
if scalars is not None:
@@ -3121,12 +3121,8 @@ def exit_callback(plotter, RenderWindowInteractor, event):
31213121
copied_mesh.point_data["Normals"][:] = cached_normals[j]
31223122

31233123
if add_text:
3124-
# 2 maps to vtk.vtkCornerAnnotation.UpperLeft
3125-
plotter.textActor.SetText(
3126-
2,
3127-
"%s\nPhase %.1f Degrees"
3128-
% (result_text, (angle * 180 / np.pi)),
3129-
)
3124+
phase = angle * 180 / np.pi
3125+
plotter.add_text(f"{result_text} \nPhase {phase} Degrees")
31303126

31313127
# at max supported framerate
31323128
plotter.update(1, force_redraw=True)
@@ -3264,7 +3260,8 @@ def _animate_point_scalars(
32643260
plotter.add_axes()
32653261

32663262
# set background
3267-
plotter.background_color = kwargs.pop("background", None)
3263+
theme = DefaultTheme()
3264+
theme.background = kwargs.pop("background", None)
32683265

32693266
# remove extra keyword args
32703267
kwargs.pop("node_components", None)
@@ -3279,14 +3276,12 @@ def _animate_point_scalars(
32793276

32803277
# set scalar bar text colors
32813278
if text_color:
3282-
text_color = pv.parse_color(text_color)
3283-
plotter.scalar_bar.GetLabelTextProperty().SetColor(text_color)
3284-
plotter.scalar_bar.GetAnnotationTextProperty().SetColor(text_color)
3285-
plotter.scalar_bar.GetTitleTextProperty().SetColor(text_color)
3279+
theme.color = text_color
3280+
pv.global_theme.load_theme(theme)
32863281

32873282
# NAN/missing data are white
32883283
# plotter.renderers[0].SetUseDepthPeeling(1) # <-- for transparency issues
3289-
plotter.mapper.GetLookupTable().SetNanColor(1, 1, 1, 1)
3284+
theme.nan_color = [1, 1, 1, 1]
32903285

32913286
if cpos:
32923287
plotter.camera_position = cpos
@@ -3335,8 +3330,7 @@ def q_callback():
33353330
copied_mesh.active_scalars[:] = data
33363331

33373332
if text is not None:
3338-
# 2 maps to vtk.vtkCornerAnnotation.UpperLeft
3339-
plotter.textActor.SetText(2, text[i])
3333+
plotter.add_text(text[i])
33403334

33413335
# at max supported framerate
33423336
plotter.update(1, force_redraw=True)

requirements/requirements_docs.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
Sphinx==6.1.3
2-
ansys-sphinx-theme==0.8.1
1+
Sphinx<6
2+
ansys-sphinx-theme==0.8.2
33
notfound==1.0.2
44
pypandoc==1.10
5-
pyvista==0.37.0
5+
pyvista==0.38.1
66
sphinx-copybutton==0.5.1
77
sphinx-gallery==0.11.1
88
sphinx-notfound-page==0.8.3

requirements/requirements_test.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ansys-mapdl-core>=0.60.4
2-
matplotlib
3-
pytest
4-
pytest-cov
5-
scipy
2+
matplotlib>=3.5.3
3+
pytest==7.2.1
4+
pytest-cov==4.0.0
5+
scipy>=1.7.3

0 commit comments

Comments
 (0)