Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5efcc9a
doc: using pyvista.DynamicScraper()
clatapie Aug 18, 2023
ffebf0d
Merge branch 'main' into doc/dynamic-examples
clatapie Aug 28, 2023
953dd19
maint: updating intersphinx_mapping
clatapie Aug 28, 2023
46d2f87
maint: updating cicd
clatapie Aug 28, 2023
e91a288
doc: adding missing docstrings
clatapie Aug 28, 2023
826d863
doc: fixing intersphinx mapping
clatapie Aug 28, 2023
b5df545
maint: printing `pip list` in CICD
clatapie Aug 29, 2023
4049511
doc: updating links
clatapie Aug 29, 2023
1796279
Update README.rst
clatapie Sep 6, 2023
2d89d0c
Update README.rst
clatapie Sep 6, 2023
f47f2cd
maint: updating pyvista
clatapie Sep 6, 2023
dffc6f4
Merge branch 'main' into doc/dynamic-examples
clatapie Sep 6, 2023
3e6e6b9
maint: remove cache
clatapie Sep 6, 2023
5e9981f
maitn: reset cache
clatapie Sep 6, 2023
aec8398
Merge branch 'main' into doc/dynamic-examples
clatapie Sep 6, 2023
611c0b6
maint: adding `image/_static` directory
clatapie Sep 6, 2023
f22bda1
maint: removing empty file
clatapie Sep 6, 2023
22f003f
maint: readding an empty file in `image/_static` directory
clatapie Sep 6, 2023
8588555
maint: using same version as pyvista
clatapie Sep 6, 2023
4f994d0
maint: move README.rst file
clatapie Sep 6, 2023
10cd12a
doc: identical version as pyvista
clatapie Sep 6, 2023
104d82c
doc: fixing dependencies
clatapie Sep 6, 2023
54af532
doc: fixing intersphinx
clatapie Sep 6, 2023
8357938
doc: trying to fix dynamic scraper
clatapie Sep 6, 2023
bbe353c
doc: update pyvista
clatapie Sep 6, 2023
462fe02
doc: fixing pyvista.DynamicScraper
clatapie Sep 6, 2023
fec2c3b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 6, 2023
6544a5c
doc: restoring window size
clatapie Sep 6, 2023
159db81
doc: cleaning the code
clatapie Sep 6, 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
22 changes: 12 additions & 10 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
- main

env:
MAIN_PYTHON_VERSION: '3.9'
MAIN_PYTHON_VERSION: '3.11'
PACKAGE_NAME: 'ansys-math-core'
PACKAGE_NAMESPACE: 'ansys.math.core'
DOCKER_PACKAGE: ghcr.io/ansys/pymapdl/mapdl
Expand All @@ -20,10 +20,10 @@ env:
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: 0
RESET_EXAMPLES_CACHE: 0
RESET_DOC_BUILD_CACHE: 0
RESET_PIP_CACHE: 0
RESET_AUTOSUMMARY_CACHE: 1
RESET_EXAMPLES_CACHE: 1
RESET_DOC_BUILD_CACHE: 1
RESET_PIP_CACHE: 1

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -293,12 +293,14 @@ jobs:
- name: "Install docs build requirements"
run: |
pip install .[doc]

- name: Install VTK
run: |
pip uninstall vtk -y
pip install --extra-index-url https://wheels.vtk.org vtk-osmesa

# If DPF server is needed, uncomment
# - name: "DPF server activation"
# run: |
# docker pull ghcr.io/ansys/dpf-core:22.2dev
# docker run -d --name dpfserver -p ${{ env.DPF_PORT }}:50052 ghcr.io/ansys/dpf-core:22.2dev && echo "DPF Server active on port ${{ env.DPF_PORT }}."
- name: List
run: pip list

- name: "Run Ansys documentation building action"
uses: ansys/actions/doc-build@v4
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ Install the latest package for use with this command:
pip install ansys-math-core

Alternatively, install the latest
`PyAnsys Math GitHub <https://github.com/ansys/pyansys-math.git>`_ package
`PyAnsys Math GitHub <https://github.com/ansys/pyansys-math>`_ package
with this command:

.. code::

pip install git+https://github.com/ansys/pyansys-math.git
pip install git+https://github.com/ansys/pyansys-math



Expand Down
14 changes: 10 additions & 4 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
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 @@ -24,6 +25,7 @@
# for compatibility with pyvista < 0.40
pyvista.rcParams["window_size"] = np.array([1024, 768])

pyvista.set_plot_theme("document")
# Save figures in specified directory
pyvista.FIGURE_PATH = os.path.join(os.path.abspath("./images/"), "auto-generated/")
if not os.path.exists(pyvista.FIGURE_PATH):
Expand All @@ -32,6 +34,7 @@
# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
pymath.BUILDING_GALLERY = True
os.environ["PYVISTA_BUILDING_GALLERY"] = "true"

# suppress annoying matplotlib bug
warnings.filterwarnings(
Expand All @@ -52,6 +55,7 @@
html_logo = pyansys_logo_black
html_theme = "ansys_sphinx_theme"
html_short_title = html_title = "PyAnsys Math"
html_static_path = ["images/_static"]

# specify the location of your github repo
html_theme_options = {
Expand Down Expand Up @@ -97,6 +101,7 @@
"sphinx_copybutton",
"sphinx_gallery.gen_gallery",
"sphinx.ext.graphviz",
"pyvista.ext.viewer_directive",
]

# -- Sphinx Gallery Options ---------------------------------------------------
Expand All @@ -117,16 +122,17 @@
"backreferences_dir": None,
# Modules for which function level galleries are created. In
"doc_module": "ansys-math-core",
"image_scrapers": ("pyvista", "matplotlib"),
"image_scrapers": (DynamicScraper(), "matplotlib"),
"ignore_pattern": "flycheck*",
"thumbnail_size": (350, 350),
"reset_modules_order": "both",
}

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/dev", None),
"scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
"numpy": ("https://numpy.org/devdocs", None),
"python": ("https://docs.python.org/3/", None),
"scipy": ("https://docs.scipy.org/doc/scipy/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
# kept here as an example
# "matplotlib": ("https://matplotlib.org/stable", None),
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
Expand Down
2 changes: 1 addition & 1 deletion doc/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
.. _pymath_docs: https://math.docs.pyansys.com/
.. _pymath_dev_docs: https://math.docs.pyansys.com/dev/
.. _pymath_issues: https://github.com/ansys/pyansys-math/issues
.. _pymath_github: https://github.com/ansys/pyansys-math.git
.. _pymath_github: https://github.com/ansys/pyansys-math

.. #MAPDL related
.. _mapdl_tech_show: https://ansyshelp.ansys.com/account/secured?returnurl=/Views/Secured/corp/v222/en/wb_wbtec/wb_wbtec.html
Expand Down
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,18 @@ doc = [
"pandas==2.0.3",
"pypandoc==1.11",
"pytest-sphinx==0.5.0",
"pyvista==0.41.1",
"pyvista[jupyter,trame]==0.41.1",
"sphinx-autobuild==2021.3.14",
"sphinx-autodoc-typehints==1.24.0",
"sphinx-copybutton==0.5.2",
"sphinx-design==0.5.0",
"sphinx-notfound-page==0.8.3",
"sphinx-gallery==0.14.0",
"sphinx-toolbox==3.5.0",
"sphinxcontrib-asciinema==0.3.7",
"sphinxcontrib-websupport==1.2.6",
"trame==3.2.4",
"vtk==9.2.6",
"typed-ast==1.5.5",
]

[tool.flit.module]
Expand Down
6 changes: 6 additions & 0 deletions src/ansys/math/core/math.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ class AnsMath:
"""

def __init__(self, mapdl=None, **kwargs):
"""Initiate a common class for abstract math object."""
if mapdl is None:
mapdl = launch_mapdl(**kwargs)

Expand Down Expand Up @@ -1274,6 +1275,7 @@ class AnsMathObj:
"""Provides the common class for AnsMath objects."""

def __init__(self, id_, mapdl=None, dtype=ObjType.GEN):
"""Initiate a common class for AnsMath objects."""
if mapdl is None:
mapdl = launch_mapdl()
self.id = id_
Expand Down Expand Up @@ -1495,6 +1497,7 @@ class AnsVec(AnsMathObj):
"""Provides the AnsMath vector objects."""

def __init__(self, id_, mapdl, dtype=np.double, init=None):
"""Initiate an AnsMath vector object."""
AnsMathObj.__init__(self, id_, mapdl, ObjType.VEC)

if init not in ["ones", "zeros", "rand", None]:
Expand Down Expand Up @@ -1641,6 +1644,7 @@ class AnsMat(AnsMathObj):
"""Provides the AnsMath matrix objects."""

def __init__(self, id_, mapdl, type_=ObjType.DMAT):
"""Initiate an AnsMath matrix object."""
AnsMathObj.__init__(self, id_, mapdl, type_)

@property
Expand Down Expand Up @@ -1809,6 +1813,7 @@ class AnsDenseMat(AnsMat):
"""Provides the AnsMath dense matrix objects."""

def __init__(self, uid, mapdl):
"""Initiate an AnsMath dense matrix object."""
AnsMat.__init__(self, uid, mapdl, ObjType.DMAT)

def __array__(self):
Expand All @@ -1827,6 +1832,7 @@ class AnsSparseMat(AnsMat):
"""Provides the AnsMath sparse matrix objects."""

def __init__(self, uid, mapdl):
"""Initiate an AnsMath sparse matrix object."""
AnsMat.__init__(self, uid, mapdl, ObjType.SMAT)

def __repr__(self):
Expand Down