Skip to content
Merged
Show file tree
Hide file tree
Changes from 24 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
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]
79 changes: 59 additions & 20 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Ansys Math
==========
AnsysMath
=========

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

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


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

Ansys Math is a Python repository holding Ansys mathematical libraries.
For more information on getting a licensed copy of Ansys, 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
`AnsysMath GitHub <amath_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:

.. 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 AnsysMath from Python by running:

.. code:: python

import ansys.math.core.math as amath

# Start AnsysMath
mm = amath.AnsMath()
print(mm)


If you see a response from the server, congratulations. You're ready
to get started using AnsysMath 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. AnsysMath is not supported on Ansys versions earlier than 2021 R1.

Previous will open the rendered documentation in the desired browser.

15 changes: 15 additions & 0 deletions doc/source/api_ref/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

.. _ref_index_api:

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

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



.. toctree::
:maxdepth: 1

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

.. currentmodule:: ansys.math.core

.. autosummary::
:toctree: _autosummary

math.AnsMath
math.AnsMathObj
math.AnsVec
math.AnsMat
math.AnsSolver
35 changes: 23 additions & 12 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""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
Expand Down Expand Up @@ -28,7 +29,14 @@
pyvista.BUILDING_GALLERY = True
amath.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 = "AnsysMath"

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,15 +123,16 @@
# 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_show_class_members = False
numpydoc_xref_param_type = True
Expand Down Expand Up @@ -184,14 +203,6 @@
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.
Expand Down
83 changes: 83 additions & 0 deletions doc/source/contributing/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
.. _ref_contributing:

Contributing
============

Overall guidance on contributing to a PyAnsys library appears in the
`Contributing <dev_guide_contributing_>`_ topic
in the *PyAnsys Developer's Guide*. Ensure that you are thoroughly familiar
with it before attempting to contribute to PyMAPDL.

The following contribution information is specific to AnsysMath.

Cloning the repository
--------------------------------

Run this code to clone and install the latest version of AnsysMath in development mode::

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

Posting issues
--------------

Use the `AnsysMath Issues <amath_issues_>`_ page to submit questions,
report bugs, and request new features. When possible, use these issue
templates:

* Bug report template
* Feature request template

If your issue does not fit into one of these categories, create your own issue.

To reach the PyAnsys support team, email `pyansys.support@ansys.com <pyansys_support_>`_.


Building documentation
----------------------

To build the AnsysMath documentation locally, in the root directory of the repository, run::

pip install .[doc]
.\doc\make.bat html

Documentation for the latest stable release of AnsysMath is hosted at
`AnsysMath Documentation <amath_docs_>`_.

Documentation for the latest development version, which tracks the
``main`` branch, is hosted at
`Development AnsysMath Documentation <amath_dev_docs_>`_.
This version is automatically kept up to date via GitHub actions.


Code style
----------

AnsysMath follows the PEP8 standard as outlined in the `PyAnsys Development Guide
<dev_guide_pyansys_>`_ and implements style checking using
`pre-commit <precommit_>`_.

To ensure your code meets minimum code styling standards, run::

pip install pre-commit
pre-commit run --all-files

You can also install this as a pre-commit hook by running::

pre-commit install

This way, it's not possible for you to push code that fails the style checks. For example::

$ pre-commit install
$ git commit -am "added my cool feature"
black....................................................................Passed
blacken-docs.............................................................Passed
isort....................................................................Passed
flake8...................................................................Passed
codespell................................................................Passed
check for merge conflicts................................................Passed
debug statements (python)................................................Passed
Validate GitHub Workflows................................................Passed

Loading