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

maint: updating cicd and start_mapdl files #223

Merged
merged 28 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
5642e44
maint: updating cicd and `start_mapdl` files
clatapie Nov 21, 2023
93eb763
maint: install `libgomp1`
clatapie Nov 21, 2023
5ad8811
fix: cicd
clatapie Nov 21, 2023
9953f59
Testing missing library
germa89 Nov 21, 2023
a2a18a0
fixing library
germa89 Nov 21, 2023
c300917
Using newer docker images and installing missing library locally
germa89 Nov 22, 2023
e9a5e96
maint: ci_cd
clatapie Nov 22, 2023
af75e2d
maint: ci_cd.yml
clatapie Nov 22, 2023
f20587b
fixing registry and using newer docker image for doc build
germa89 Nov 22, 2023
c19c5ba
maint: cicd
clatapie Nov 22, 2023
dd3f11d
fix: kron unit test
clatapie Nov 23, 2023
9716f95
fix: `test_kron_product_unsupported_dtype`
clatapie Nov 23, 2023
51171c0
maint: fix dependencies
clatapie Nov 23, 2023
c5d191e
maint: updating `vtk`
clatapie Nov 23, 2023
2fd8032
maint: update `trame`
clatapie Nov 23, 2023
03d4390
doc: removing `DynamicScraper`
clatapie Nov 23, 2023
2ee4263
maint: reset cache
clatapie Nov 23, 2023
e6f1ef1
maint: fixing cicd
clatapie Nov 23, 2023
df9f6ee
maint: fixing dependencies
clatapie Nov 23, 2023
ae04a3c
maint: removing `xvfb` installation in doc build
clatapie Nov 23, 2023
9cdba98
maint: using `sudo apt`
clatapie Nov 23, 2023
6fe67c1
fix: `ansys-math_vs_scipy.py` file
clatapie Nov 24, 2023
bca0ae4
maint: fixing cicd
clatapie Nov 24, 2023
c841e7c
test: debugging `test_solve_eigs_km`
clatapie Nov 24, 2023
8e2452b
fix: tests
clatapie Nov 24, 2023
e210c00
Update doc/source/conf.py
clatapie Nov 27, 2023
444f7d1
Merge branch 'main' into fix/cicd
clatapie Nov 28, 2023
58a5f13
maint: cleaning code
clatapie Nov 28, 2023
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
11 changes: 8 additions & 3 deletions .ci/start_mapdl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ docker run \
-e ANSYS_LOCK="OFF" \
-p $PYMAPDL_PORT:50052 \
-p $PYMAPDL_DB_PORT:50055 \
--shm-size=1gb \
-e I_MPI_SHM_LMT=shm \
-e P_SCHEMA=/ansys_inc/ansys/ac4/schema \
--oom-kill-disable \
--memory=6656MB \
--memory-swap=16896MB \
$MAPDL_IMAGE \
-smp > log.txt &
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
# python -c "from ansys.mapdl.core import launch_mapdl; print(launch_mapdl())"
-$DISTRIBUTED_MODE -np 2 > log.txt &
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
10 changes: 8 additions & 2 deletions .ci/start_mapdl_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,13 @@ docker run \
-e ANSYS_LOCK="OFF" \
-p $PYMAPDL_PORT:50052 \
-p $PYMAPDL_DB_PORT:50055 \
--shm-size=1gb \
-e I_MPI_SHM_LMT=shm \
-e P_SCHEMA=/ansys_inc/v222/ansys/ac4/schema \
-w /jobs \
-u=0:0 \
$MAPDL_IMAGE /ansys_inc/v222/ansys/bin/mapdl -grpc -dir /jobs -smp -np 2 > log.txt &
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
--oom-kill-disable \
--memory=6656MB \
--memory-swap=16896MB \
$MAPDL_IMAGE /ansys_inc/v222/ansys/bin/mapdl -grpc -dir /jobs -$DISTRIBUTED_MODE -np 2 > log.txt &
grep -q 'Server listening on' <(timeout 60 tail -f log.txt)
24 changes: 12 additions & 12 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ env:
MAIN_PYTHON_VERSION: '3.10'
PACKAGE_NAME: 'ansys-math-core'
PACKAGE_NAMESPACE: 'ansys.math.core'
DOCKER_PACKAGE: ghcr.io/ansys/pymapdl/mapdl
DOCKER_IMAGE_VERSION_DOCS_BUILD: v22.2.0
DOCKER_PACKAGE: ghcr.io/ansys/mapdl
DOCKER_IMAGE_VERSION_DOCS_BUILD: v23.1.0
DOCUMENTATION_CNAME: 'math.docs.pyansys.com'
PYMAPDL_START_INSTANCE: FALSE
PYMAPDL_PORT: 21000 # default won't work on GitHub runners
PYMAPDL_DB_PORT: 21001 # default won't work on GitHub runners
RESET_AUTOSUMMARY_CACHE: 3
RESET_EXAMPLES_CACHE: 3
RESET_DOC_BUILD_CACHE: 3
RESET_PIP_CACHE: 3
RESET_AUTOSUMMARY_CACHE: 9
RESET_EXAMPLES_CACHE: 9
RESET_DOC_BUILD_CACHE: 9
RESET_PIP_CACHE: 9
clatapie marked this conversation as resolved.
Show resolved Hide resolved

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
cancel-in-progress: false # to be moodified
clatapie marked this conversation as resolved.
Show resolved Hide resolved

jobs:

Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
needs: [smoke-tests]
strategy:
matrix:
mapdl-version: ['v21.1.1', 'v21.2.1', 'v22.1.0', 'v22.2.0', 'v22.2-ubuntu']
mapdl-version: ['v23.1.0', 'v23.2.0', 'v24.1.0']

steps:
- name: "Install Git and checkout project"
Expand All @@ -94,10 +94,10 @@ jobs:
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Install os packages"
- name: "Install OS packages"
run: |
sudo apt update
sudo apt-get install pandoc
sudo apt-get update
sudo apt-get install -y pandoc xvfb libgl1-mesa-glx

- name: "Cache pip"
uses: actions/cache@v3
Expand Down Expand Up @@ -365,4 +365,4 @@ jobs:
with:
cname: ${{ env.DOCUMENTATION_CNAME }}
token: ${{ secrets.GITHUB_TOKEN }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
2 changes: 2 additions & 0 deletions doc/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ if "%SPHINXBUILD%" == "" (
)
set SOURCEDIR=source
set BUILDDIR=_build
set EXAMPDIR=source\examples

if "%1" == "" goto help
if "%1" == "clean" goto clean
Expand All @@ -31,6 +32,7 @@ goto end

:clean
rmdir /s /q %BUILDDIR% > /NUL 2>&1
rmdir /s /q %EXAMPDIR% > /NUL 2>&1
for /d /r %SOURCEDIR% %%d in (_autosummary) do @if exist "%%d" rmdir /s /q "%%d"
goto end

Expand Down
4 changes: 2 additions & 2 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black
import numpy as np
import pyvista
from pyvista.plotting.utilities.sphinx_gallery import DynamicScraper
from sphinx_gallery.sorting import FileNameSortKey

from ansys.math.core import __version__
Expand All @@ -29,6 +28,7 @@

# Ensure that offscreen rendering is used for docs generation
pyvista.OFF_SCREEN = True
pyvista.set_plot_theme("document")

# suppress annoying matplotlib bug
warnings.filterwarnings(
Expand Down Expand Up @@ -113,7 +113,7 @@
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "ansys-math-core",
"image_scrapers": (DynamicScraper(), "matplotlib"),
"image_scrapers": ("pyvista", "matplotlib"),
"ignore_pattern": "flycheck*",
"thumbnail_size": (350, 350),
}
Expand Down
4 changes: 2 additions & 2 deletions examples/ansys-math_vs_scipy.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import math
import time

from ansys.mapdl.core import examples
from ansys.mapdl.core.examples import examples
import matplotlib.pylab as plt
import numpy as np
import scipy
Expand All @@ -37,7 +37,7 @@
# ~~~~~~~~~~~~~~~~~~~
# Load the input file using MAPDL.

print(mm._mapdl.input(examples.examples.wing_model))
print(mm._mapdl.input(examples.wing_model))


###############################################################################
Expand Down
14 changes: 7 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,35 +36,35 @@ dependencies = [

[project.optional-dependencies]
tests = [
"ansys-mapdl-core==0.66.0",
"ansys-mapdl-core==0.67.0",
"numpy==1.26.1",
"scipy==1.11.3",
"pyansys-tools-report==0.7.0",
"pytest==7.4.3",
"pytest-cov==4.1.0",
"pytest-rerunfailures==12.0",
"pyvista==0.42.3",
"vtk==9.2.6",
"vtk==9.3.0",
]
doc = [
"Sphinx==7.2.6",
"ansys-mapdl-core==0.66.0",
"ansys-mapdl-core==0.67.0",
"ansys-mapdl-reader==0.52.20",
"ansys-sphinx-theme==0.12.3",
"ansys-sphinx-theme==0.12.5",
"jupyter_sphinx==0.4.0",
"jupyterlab==4.0.6",
"numpydoc==1.6.0",
"pypandoc==1.12",
"pytest-sphinx==0.5.0",
"pyvista[jupyter,trame]==0.42.2",
"pyvista[jupyter,trame]==0.42.3",
"scipy==1.11.3",
"sphinx-autobuild==2021.3.14",
"sphinx-autodoc-typehints==1.24.0",
"sphinx-copybutton==0.5.2",
"sphinx-notfound-page==1.0.0",
"sphinx-gallery==0.14.0",
"trame==3.2.7",
"vtk==9.2.6",
"trame==3.3.0",
"vtk==9.3.0",
]

[tool.flit.module]
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/math/core/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -1416,7 +1416,7 @@ def kron(self, obj):
if mapdl_version < 23.2: # pragma: no cover
raise VersionError("``kron`` requires MAPDL version 2023R2")

if not isinstance(obj, AnsMath):
if not isinstance(obj, AnsMathObj):
raise TypeError("Must be an AnsMath object.")

if not isinstance(self, (AnsMat, AnsVec)):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_math.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ def test_kron_product_unsupported_dtype(mm):
if mapdl_version < 23.2:
pytest.skip("Requires MAPDL 2023 R2 or later.")

with pytest.raises(TypeError, match=r"Must be an ApdlMathObj"):
with pytest.raises(TypeError, match=r"Must be an AnsMath object."):
m1 = mm.rand(3, 3)
m1.kron(2)

Expand Down Expand Up @@ -481,7 +481,7 @@ def test_solve_alt(mm, cube_solve):
def test_solve_eigs_km(mapdl, mm, cube_solve):
mapdl.post1()
resp = mapdl.set("LIST")
w_n = np.array(re.findall(r"\s\d*\.\d\s", resp), np.float32)
w_n = np.array(re.findall(r"\s\d*\.\d*\s", resp), np.float32)

k = mm.stiff()
m = mm.mass()
Expand All @@ -493,7 +493,7 @@ def test_solve_eigs_km(mapdl, mm, cube_solve):
def test_solve_py(mapdl, mm, cube_solve):
mapdl.post1()
resp = mapdl.set("LIST")
w_n = np.array(re.findall(r"\s\d*\.\d\s", resp), np.float32)
w_n = np.array(re.findall(r"\s\d*\.\d*\s", resp), np.float32)

# load by default from file.full
k = mm.stiff()
Expand Down