Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix closing animation window crash python #113

Merged
merged 5 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/testing-and-deployment.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GH Actions
name: Actions

# repo specific gh actions
env:
Expand Down Expand Up @@ -29,6 +29,7 @@ jobs:
run: |
pip install -r requirements_style.txt --disable-pip-version-check
make

doc_build:
name: Build Documentation
runs-on: ubuntu-latest
Expand All @@ -47,13 +48,15 @@ jobs:
sudo apt-get install libgl1-mesa-glx xvfb
pip install pyvista
xvfb-run python -c "import pyvista; print(pyvista.Report())"

- name: Install ansys-mapdl-reader
run: |
pip install -r requirements_build.txt --disable-pip-version-check
python setup.py bdist_wheel
pip install dist/ansys*.whl --disable-pip-version-check
cd tests/
xvfb-run python -c "from ansys.mapdl import reader as pymapdl_reader; print(pymapdl_reader.Report())"

- name: Build Documentation
run: |
sudo apt install pandoc -qy
Expand All @@ -62,6 +65,7 @@ jobs:
sudo apt install zip
cd doc/build/html/
zip ../../../${{ env.PACKAGE_NAME }}-HTML.zip ./*

- name: Upload
uses: actions/upload-artifact@v2
with:
Expand All @@ -85,7 +89,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10']
python-version: ['3.7', '3.8', '3.9', '3.10']
os: [ubuntu-latest, windows-latest]

steps:
Expand Down
10 changes: 10 additions & 0 deletions ansys/mapdl/reader/rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Used:
.../ansys/customize/include/fdresu.inc
"""
import os
from collections.abc import Iterable, Sequence
import time
import warnings
Expand Down Expand Up @@ -2841,7 +2842,16 @@ def q_callback():
"""exit when user wants to leave"""
self._animating = False

def exit_callback(plotter, RenderWindowInteractor, event):
"""exit when user wants to leave"""
self._animating = False
plotter.close()

plotter.add_key_event("q", q_callback)
if os.name == 'nt':
# Adding closing window callback
plotter.iren.add_observer(vtk.vtkCommand.ExitEvent,
lambda render, event: exit_callback(plotter, render, event))

first_loop = True
cached_normals = [None for _ in range(n_frames)]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def compiler_name():
language='c++'),
],

python_requires='>=3.6.*',
python_requires='>=3.7.*',
keywords='vtk MAPDL ANSYS cdb full rst',
package_data={'ansys.mapdl.reader.examples': ['TetBeam.cdb',
'HexBeam.cdb',
Expand Down