Skip to content

Commit

Permalink
Merge branch 'main' into refactor/annotate-files
Browse files Browse the repository at this point in the history
  • Loading branch information
germa89 authored Dec 13, 2024
2 parents 9008021 + 1d80426 commit b25ae57
Show file tree
Hide file tree
Showing 26 changed files with 486 additions and 128 deletions.
110 changes: 109 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ jobs:
- name: "Unit testing requirements installation"
run: |
python -m pip install pytest pytest-rerunfailures pytest-cov pytest-random-order
python -m pip install pytest pytest-rerunfailures pytest-cov pytest-random-order pyfakefs
- name: "Unit testing"
env:
Expand Down Expand Up @@ -865,6 +865,114 @@ jobs:
path: ./${{ matrix.mapdl-version }}-minimal.xml


build-test-ubuntu-console:
name: "Local-min-console: ${{ matrix.mapdl-version }}"
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
needs: [smoke-tests, build-test-local-minimal-matrix]
timeout-minutes: 75
strategy:
fail-fast: false
matrix: ${{fromJson(needs.build-test-local-minimal-matrix.outputs.matrix)}}
container:
image: ghcr.io/ansys/mapdl:${{ matrix.mapdl-version }}
options: -u=0:0 --oom-kill-disable --memory=6656MB --memory-swap=16896MB --shm-size=1gb --entrypoint /bin/bash
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
ON_LOCAL: true
ON_UBUNTU: true
TESTING_MINIMAL: true
ON_CONSOLE: true

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4.2.2
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: "Get if running student version"
id: student_check
run: |
if [[ "${{ matrix.mapdl-version }}" == *"student"* ]];
then export ON_STUDENT=true; export TAG_STUDENT="student";
else export ON_STUDENT=false; export TAG_STUDENT="non-student";
fi
echo "ON_STUDENT: $ON_STUDENT"
echo "TAG_STUDENT: $TAG_STUDENT"
echo "ON_STUDENT=$(echo $ON_STUDENT)" >> $GITHUB_OUTPUT
echo "TAG_STUDENT=$(echo $TAG_STUDENT)" >> $GITHUB_OUTPUT
- name: "Installing missing package"
run: |
sudo apt-get update
sudo apt-get install -y libgomp1
- name: "Setup Python"
uses: actions/setup-python@v5
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Checking Python"
run: |
python --version
python -m pip install --upgrade pip
- name: "Install ansys-mapdl-core"
run: |
python -m pip install . --no-deps
python -m pip install -r minimum_requirements.txt
python -c "from ansys.mapdl import core as pymapdl; print('Import successfull')"
- name: "Unit testing requirements installation"
run: |
python -m pip install pytest pytest-rerunfailures pytest-cov pytest-random-order
- name: "Unit testing"
env:
ANSYSLMD_LICENSE_FILE: "1055@${{ secrets.LICENSE_SERVER }}"
ON_STUDENT: ${{ steps.student_check.outputs.ON_STUDENT }}
run: |
echo "ON_UBUNTU: $ON_UBUNTU"
echo "ON_STUDENT: $ON_STUDENT"
# Because there is no 'ansys-tools-path' we need to input the
# executable path with the env var: PYMAPDL_MAPDL_EXEC.
if [[ "${{ matrix.mapdl-version }}" == *"latest-ubuntu"* ]] ; then
version=${{ env.LATEST_VERSION }}
else
version=$(echo "${{ matrix.mapdl-version }}" | head -c 5 | tail -c 4 | tr -d '.')
fi;
echo "Version: $version"
export PYMAPDL_MAPDL_EXEC=/ansys_inc/v"$version"/ansys/bin/ansys"$version"
echo "$PYMAPDL_MAPDL_EXEC"
unset PYMAPDL_START_INSTANCE
pytest -k "console" \
${{ env.PYTEST_ARGUMENTS }} \
--cov-report=xml:${{ matrix.mapdl-version }}-minimal-console.xml
- uses: codecov/codecov-action@v5
name: "Upload coverage to Codecov"
with:
token: ${{ secrets.CODECOV_TOKEN }} # required
root_dir: ${{ github.workspace }}
name: ${{ matrix.mapdl-version }}-minimal-console.xml
flags: ubuntu,local,${{ matrix.mapdl-version }},minimal,console,${{ steps.student_check.outputs.TAG_STUDENT }},dmp

- name: "Upload coverage artifacts"
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.mapdl-version }}-minimal-console.xml
path: ./${{ matrix.mapdl-version }}-minimal-console.xml


test-windows:
# Skipped
if: github.repository == ''
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/3509.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
test: faking-v150
1 change: 1 addition & 0 deletions doc/changelog.d/3583.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: avoiding long names in test arguments
1 change: 1 addition & 0 deletions doc/changelog.d/3586.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: console launching
1 change: 1 addition & 0 deletions doc/changelog.d/3596.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: redirect MAPDL console output to a file
1 change: 1 addition & 0 deletions doc/changelog.d/3601.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump grpcio from 1.68.0 to 1.68.1 in the grpc-deps group
1 change: 1 addition & 0 deletions doc/changelog.d/3603.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump pytest from 8.3.3 to 8.3.4 in the testing group
1 change: 1 addition & 0 deletions doc/changelog.d/3604.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump pyfakefs from 5.7.1 to 5.7.2
1 change: 1 addition & 0 deletions doc/changelog.d/3606.miscellaneous.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
feat: avoid errors when retrieving invalid routine
1 change: 1 addition & 0 deletions doc/changelog.d/3612.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump the core group across 1 directory with 3 updates
1 change: 1 addition & 0 deletions doc/changelog.d/3617.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fix: exit getting frozen if routine is not finished
1 change: 1 addition & 0 deletions doc/changelog.d/3619.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build: bump numpy from 2.1.3 to 2.2.0 in the minimal group
2 changes: 1 addition & 1 deletion minimum_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ansys-api-mapdl==0.5.2
numpy==2.1.3
numpy==2.2.0
platformdirs==4.3.6
psutil==6.1.0
pyansys-tools-versioning==0.6.0
17 changes: 8 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,34 +55,33 @@ jupyter = [

tests = [
"ansys-dpf-core==0.10.1",
"ansys-tools-visualization-interface==0.5.0",
"ansys-tools-visualization-interface==0.6.0",
"autopep8==2.3.1",
"matplotlib==3.9.2",
"matplotlib==3.9.3",
"pandas==2.2.3",
"pyansys-tools-report==0.8.1",
"pyfakefs==5.7.1",
"pyfakefs==5.7.2",
"pyiges[full]==0.3.1",
"pytest-cov==6.0.0",
"pytest-memprof<0.3.0",
"pytest-pyvista==0.1.9",
"pytest-random-order==1.1.1",
"pytest-rerunfailures==15.0",
"pytest==8.3.3",
"pytest==8.3.4",
"scipy==1.14.1",
"vtk==9.3.1",
]
doc = [
"ansys-dpf-core==0.10.1",
"ansys-mapdl-reader==0.54.2",
"ansys-sphinx-theme==1.2.2",
"ansys-tools-visualization-interface==0.5.0",
"grpcio==1.68.0",
"ansys-sphinx-theme==1.2.3",
"ansys-tools-visualization-interface==0.6.0",
"grpcio==1.68.1",
"imageio-ffmpeg==0.5.1",
"imageio==2.36.1",
"jupyter_sphinx==0.5.3",
"jupyter==1.1.1",
"jupyterlab>=3.2.8",
"matplotlib==3.9.2",
"matplotlib==3.9.3",
"nbformat==5.10.4",
"numpydoc==1.8.0",
"pandas==2.2.3",
Expand Down
5 changes: 5 additions & 0 deletions src/ansys/mapdl/core/information.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import weakref

from ansys.mapdl import core as pymapdl
from ansys.mapdl.core.errors import MapdlExitedError


def update_information_first(update: bool = False) -> Callable:
Expand Down Expand Up @@ -122,7 +123,11 @@ def _update(self) -> None:
self._stats = stats
self._mapdl._log.debug("Information class: Updated")


def __repr__(self) -> str:
if self._mapdl.is_console and self._mapdl.exited:
return "MAPDL exited"

if not self._stats:
self._update()

Expand Down
Loading

0 comments on commit b25ae57

Please sign in to comment.