Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
1356a3c
Adding warnings
clatapie Jan 9, 2023
a656eaa
Adding the favicon + fixing Sphinx version
clatapie Jan 10, 2023
c21a765
Creating the documentation skeleton
clatapie Jan 11, 2023
2fe0e44
Merge branch 'main' into fix/documentation
clatapie Jan 11, 2023
f75f4b9
Adding the documentation content
clatapie Jan 11, 2023
774fca3
Merge branch 'fix/documentation' of https://github.com/pyansys/ansys-…
clatapie Jan 11, 2023
08c80fa
Fixing typos and updating README.rst
clatapie Jan 11, 2023
011d71b
Fixing vale errors
clatapie Jan 11, 2023
aa783c9
Fixing the vale error
clatapie Jan 11, 2023
d7b5c3b
Merge branch 'main' into fix/documentation
clatapie Jan 11, 2023
53c2c5e
Apply suggestions from code review
clatapie Jan 12, 2023
eced37f
Changes from Roberto's review
clatapie Jan 12, 2023
73e6939
Merge branch 'fix/documentation' of https://github.com/pyansys/ansys-…
clatapie Jan 12, 2023
a38ef8b
Code style changes
clatapie Jan 12, 2023
55cf4b9
Fixing an issue with the README.rst
clatapie Jan 12, 2023
82404df
Fixing a typo
clatapie Jan 12, 2023
cbf2e0c
Apply suggestions from code review
clatapie Jan 13, 2023
f3982fe
Apply suggestions from code review
clatapie Jan 13, 2023
479b964
Apply suggestions from code review
clatapie Jan 13, 2023
78ee81f
Code style changes
clatapie Jan 13, 2023
301e407
Flake8 changes
clatapie Jan 13, 2023
262560f
Apply suggestions from code review
clatapie Jan 13, 2023
93b5076
Changing 'APDLMath' into 'AnsMath' obj for clarity
clatapie Jan 13, 2023
380af34
Fixing typos in the doc
clatapie Jan 13, 2023
5dfe6fe
Update examples/scipy_sparse_matrix.py
clatapie Jan 16, 2023
efc7270
Apply changes from Kathy's review
clatapie Jan 16, 2023
5d49c4f
Merge branch 'main' into fix/documentation
clatapie Jan 16, 2023
777dbdf
Modifying the project name to PyAnsys-Math
clatapie Jan 16, 2023
e2b24ce
Merge branch 'fix/documentation' of https://github.com/pyansys/ansys-…
clatapie Jan 16, 2023
69a791b
Fixing issues with the repository name
clatapie Jan 16, 2023
b028e48
Fixing a typo
clatapie Jan 16, 2023
2885ecb
Fixing issues
clatapie Jan 16, 2023
eef5c07
Fixing a documentation issue
clatapie Jan 16, 2023
1926cd7
Fixing the building error
clatapie Jan 16, 2023
25f62f6
Apply suggestions from code review
clatapie Jan 17, 2023
cf0e721
Apply suggestions from code review
clatapie Jan 17, 2023
cd17af3
Changes from Kathy's review
clatapie Jan 17, 2023
e78e82d
Merge branch 'fix/documentation' of https://github.com/pyansys/ansys-…
clatapie Jan 17, 2023
7de45a9
Apply suggestions from code review
clatapie Jan 17, 2023
398eb52
Fixing the format of sentences
clatapie Jan 17, 2023
6322cbf
Merge branch 'main' into fix/documentation
clatapie Jan 17, 2023
30c1559
Chainging `PyAnsys-Math` name into `PyAnsys Math`
clatapie Jan 17, 2023
b24c934
Fixing Unit Test issues
clatapie Jan 17, 2023
4413fbb
Modifying the mat function init default value
clatapie Jan 17, 2023
81adfba
Apply suggestions from code review - Examples files
clatapie Jan 18, 2023
9978412
Apply suggestions from code review
clatapie Jan 18, 2023
70b4858
Fixing the _autosummary warnings
clatapie Jan 18, 2023
114a5c6
Merge branch 'fix/documentation' of https://github.com/pyansys/ansys-…
clatapie Jan 18, 2023
7501bf1
First commit from Kathy's review
clatapie Jan 18, 2023
03a60f5
Fixing the warning issue
clatapie Jan 18, 2023
9c0e7cd
Second commit from Kathy's review - math.py file
clatapie Jan 18, 2023
1543cbb
Third commit from Kathy's review - math.py file
clatapie Jan 18, 2023
f6a2fb8
Precising the needed Ansys license
clatapie Jan 19, 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
1 change: 1 addition & 0 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ jobs:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
checkout: false
skip-install: true
sphinxopts: -j auto


doc-deploy-dev:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ var/
# autogenerated docs
_autosummary


# Testing
.coverage
.tox/
*,cover
test-output.xml
.pytest_cache/
tests/__pycache__

\#*
.\#*
Expand Down
31 changes: 20 additions & 11 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,22 @@ repos:


- repo: https://github.com/psf/black
rev: 22.10.0
rev: 22.12.0
hooks:
- id: black
args:
- --line-length=120
- --line-length=100

- repo: https://github.com/adamchainz/blacken-docs
rev: v1.12.1
hooks:
- id: blacken-docs
additional_dependencies: [black==22.12.0]
args:
- --line-length=100

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.11.4
hooks:
- id: isort

Expand All @@ -27,6 +35,15 @@ repos:
args: ["--toml", "pyproject.toml"]
additional_dependencies: ["tomli"]

# To be activated after quick dev cycles
#
# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# additional_dependencies: [toml]
# exclude: "tests/"

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
Expand All @@ -38,11 +55,3 @@ repos:
rev: 0.19.2
hooks:
- id: check-github-workflows

# - repo: https://github.com/pycqa/pydocstyle
# rev: 6.1.1
# hooks:
# - id: pydocstyle
# files: ^pyoptics/
# args: ["--ignore=D205,D100,D213"]
# additional_dependencies: [toml]
77 changes: 57 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Ansys Math
==========
PyAnsys Math
============

|pyansys| |pypi| |PyPIact| |GH-CI| |codecov| |zenodo| |MIT| |black|

Expand Down Expand Up @@ -30,36 +30,73 @@ Ansys Math
:alt: black


Overview
--------
PyAnsys Math is a Python repository holding Ansys mathematical libraries.
To use them, you must have a local installation of Ansys Mechanical APDL.

Ansys Math is a Python repository holding Ansys mathematical libraries.
For more information on getting a licensed copy of Ansys Mechanical APDL, visit
the `Ansys web site <ansys_>` .


Code Style
----------
Code style can be checked by running:

.. code-block:: text
Installation
------------

tox -e style
For users
~~~~~~~~~
The ``ansys.math.core`` package currently supports Python 3.7 through
Python 3.10 on Windows, Mac OS, and Linux.

Previous command will run `pre-commit <https://pre-commit.com/>`_ for checking code quality.
.. code::

pip install ansys-math-core

Documentation
-------------
Documentation can be rendered by running:
Alternatively, install the latest from
`PyAnsys Math GitHub <pymath_github_>`_ via:

.. code-block:: text
.. code::

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

The resultant HTML files can be inspected using your favorite web browser:

.. code-block:: text

<browser> .tox/doc_out_html/index.html
For developers
~~~~~~~~~~~~~~
For a local *development* version, install with:

Previous will open the rendered documentation in the desired browser.
.. code::

git clone https://github.com/pyansys/ansys-math.git
cd ansys-math
pip install -e .

This allows you to install and edit the ``ansys-math-core`` module locally.
The changes that you make are reflected in your setup
after restarting the Python kernel.


Verify your installation
------------------------

Check that you can start PyAnsys Math from Python by running this code:

.. code:: python

import ansys.math.core.math as pymath

# Start PyAnsys Math.
mm = pymath.AnsMath()
print(mm)


If you see a response from the server, congratulations. You're ready
to start using PyAnsys Math as a service.

Ansys software requirements
---------------------------

You must have a copy of Ansys 2021 R1 or later installed locally.

.. note::

The latest versions of Ansys provide significantly better support
and features. PyAnsys Math is not supported on Ansys versions earlier than 2021 R1.
11 changes: 11 additions & 0 deletions doc/source/api_ref/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

.. _ref_index_api:

API reference
=============

This section provides an overview of the public PyAnsys Math classes,
functions, and attributes.

.. include:: math.rst
:start-line: 5
16 changes: 16 additions & 0 deletions doc/source/api_ref/math.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.. _ref_math:

PyAnsys Math
============

.. currentmodule:: ansys.math.core

.. autosummary::
:toctree: _autosummary

math.AnsMath
math.AnsMathObj
math.AnsVec
math.AnsMat
math.AnsSolver

43 changes: 28 additions & 15 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
"""Sphinx documentation configuration file."""
from datetime import datetime
import os
import warnings

from ansys_sphinx_theme import ansys_favicon, get_version_match, pyansys_logo_black
import numpy as np
import pyvista
from sphinx_gallery.sorting import FileNameSortKey

from ansys.math import core as amath
from ansys.math.core import __version__
import ansys.math.core.math as pymath

# Manage errors
pyvista.set_error_output_file("errors.txt")
Expand All @@ -26,9 +27,16 @@

# necessary when building the sphinx gallery
pyvista.BUILDING_GALLERY = True
amath.BUILDING_GALLERY = True
pymath.BUILDING_GALLERY = True

# Project information
# suppress annoying matplotlib bug
warnings.filterwarnings(
"ignore",
category=UserWarning,
message="Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.",
)

# -- Project information -----------------------------------------------------
project = "ansys-math-core"
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
author = "ANSYS, Inc."
Expand All @@ -37,7 +45,7 @@
# Select desired logo, theme, and declare the html title
html_logo = pyansys_logo_black
html_theme = "ansys_sphinx_theme"
html_short_title = html_title = "Ansys Math"
html_short_title = html_title = "PyAnsys Math"

cname = os.getenv("DOCUMENTATION_CNAME", "<DEFAULT_CNAME>")
"""The canonical name of the webpage hosting the documentation."""
Expand All @@ -48,6 +56,8 @@
"github_url": "https://github.com/pyansys/ansys-math",
"show_prev_next": False,
"show_breadcrumbs": True,
"collapse_navigation": True,
"use_edit_page_button": True,
"additional_breadcrumbs": [
("PyAnsys", "https://docs.pyansys.com/"),
],
Expand All @@ -65,6 +75,14 @@
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
}

html_context = {
"display_github": True, # Integrate GitHub
"github_user": "pyansys",
"github_repo": "ansys-math",
"github_version": "main",
"doc_path": "doc/source",
}

# Sphinx extensions
extensions = [
"jupyter_sphinx",
Expand Down Expand Up @@ -105,17 +123,20 @@
# 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),
# kept here as an example
# "scipy": ("https://docs.scipy.org/doc/scipy/reference", None),
# "numpy": ("https://numpy.org/devdocs", None),
# "matplotlib": ("https://matplotlib.org/stable", None),
# "pandas": ("https://pandas.pydata.org/pandas-docs/stable", None),
# "pyvista": ("https://docs.pyvista.org/", None),
# "grpc": ("https://grpc.github.io/grpc/python/", None),
}

suppress_warnings = ["label.*"]
# numpydoc configuration
numpydoc_use_plots = True
numpydoc_show_class_members = False
numpydoc_class_members_toctree = False
numpydoc_xref_param_type = True

# Consider enabling numpydoc validation. See:
Expand Down Expand Up @@ -184,18 +205,10 @@
copybutton_prompt_text = r">>> ?|\.\.\. "
copybutton_prompt_is_regexp = True


html_context = {
"display_github": True, # Integrate GitHub
"github_user": "pyansys",
"github_repo": "ansys-math",
"github_version": "main",
"doc_path": "doc/source",
}
# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = "ansysmathdoc"
htmlhelp_basename = "pyansysmathdoc"

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
Expand Down
Loading