Skip to content

Commit 830778b

Browse files
committed
merge with main; bump to v0.2.3
2 parents 84a7194 + 2defc33 commit 830778b

25 files changed

+258
-126
lines changed

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip" # See documentation for possible values
4+
directory: "/" # Location of package manifests
5+
insecure-external-code-execution: allow
6+
schedule:
7+
interval: "daily"
8+
labels:
9+
- "maintenance"
10+
- "dependencies"

.github/workflows/ci-build.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- main
1010

1111
jobs:
12-
stylecheck:
12+
precommit:
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -20,10 +20,11 @@ jobs:
2020
with:
2121
python-version: 3.9
2222

23-
- name: Check Style
24-
run: |
25-
pip install -r requirements_style.txt --disable-pip-version-check
26-
make
23+
- name: Install pre-commit
24+
run: pip install pre-commit
25+
26+
- name: Run pre-commit
27+
run: pre-commit run --all-files || ( git status --short ; git diff ; exit 1 )
2728

2829
build:
2930
runs-on: ubuntu-latest
@@ -68,11 +69,11 @@ jobs:
6869
BRANCH: gh-pages
6970
FOLDER: doc/build/html
7071
CLEAN: true
71-
single-commit: true
72+
SINGLE-COMMIT: true
7273

7374
Release:
7475
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
75-
needs: [stylecheck, build]
76+
needs: [precommit, build]
7677
runs-on: ubuntu-latest
7778
steps:
7879
- uses: actions/checkout@v2

.pre-commit-config.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 21.12b0
4+
hooks:
5+
- id: black
6+
exclude: "^({{cookiecutter.project_slug}}/)"
7+
- repo: https://github.com/asottile/reorder_python_imports
8+
rev: v2.6.0
9+
hooks:
10+
- id: reorder-python-imports
11+
args: ["--py37-plus"]
12+
exclude: "^({{cookiecutter.project_slug}}/)"
13+
- repo: https://gitlab.com/PyCQA/flake8
14+
rev: 3.9.2
15+
hooks:
16+
- id: flake8
17+
exclude: "^({{cookiecutter.project_slug}}/)"
18+
- repo: https://github.com/codespell-project/codespell
19+
rev: v2.1.0
20+
hooks:
21+
- id: codespell
22+
- repo: https://github.com/pycqa/pydocstyle
23+
rev: 6.1.1
24+
hooks:
25+
- id: pydocstyle
26+
additional_dependencies: [toml]
27+
exclude: "^({{cookiecutter.project_slug}}/)"

LICENSE

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License
1+
MIT License
22

3-
ANSYS INC. Copyright Copyright (c) 1986-2021
3+
Copyright (c) 2022 ANSYS, Inc. All rights reserved.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in
13-
all copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21-
THE SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Makefile

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.rst

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ PyAnsys Sphinx Theme
33

44
Introduction and Purpose
55
------------------------
6-
The PyAnsys documentation theme is an extension of the popular `PyData
6+
The PyAnsys Sphinx theme is an extension of the popular `PyData
77
Sphinx Theme <https://pydata-sphinx-theme.readthedocs.io/>`_ used by
88
`numpy <https://numpy.org/doc/stable/>`_, `pandas
99
<https://pandas.pydata.org/docs/>`_, `PyVista
1010
<https://docs.pyvista.org>`_ and a variety other packages. This theme
11-
was packaged a consistent documentation pattern and "feel" across the
12-
all PyAnsys packages.
11+
was packaged so that all PyAnsys packages would look and behave
12+
consistently.
1313

1414

1515
Documentation
1616
~~~~~~~~~~~~~
17-
Full documentation for the theme can found at `PyAnsys Sphinx Documentation <https://sphinxdocs.pyansys.com>`_. The webpage was
17+
Full documentation can found at `PyAnsys Sphinx Theme Documentation <https://sphinxdocs.pyansys.com>`_. The webpage was
1818
also built using the ``pyansys-sphinx-theme``, so visit the site for a
1919
preview of the theme.
2020

21-
Other Sites Using the PyAnsys theme:
21+
Other PyAnsys packages using the PyAnsys theme include:
2222

2323
- `PyMAPDL <https://mapdldocs.pyansys.com/>`__
2424
- `PyAEDT <https://aedtdocs.pyansys.com/>`__
@@ -36,9 +36,35 @@ Install this theme with:
3636
pip install pyansys-sphinx-theme
3737
3838
Next, modify your sphinx ``conf.py`` to use ``html_theme =
39-
'pyansys_sphinx_theme'``. If you are just getting started using
40-
sphinx, follow the directions at `Sphinx Quickstart
41-
<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_.
39+
'pyansys_sphinx_theme'``. If you are new to using
40+
Sphinx, see `Sphinx Getting Started
41+
<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_
42+
documentation.
4243

43-
For further details, visit `PyAnsys Sphinx Theme Usage
44+
For usage information, seee `Using this Theme
4445
<https://sphinxdocs.pyansys.com/usage.html>`_
46+
47+
48+
Development and Contributing
49+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50+
Feel free to add features or post issues. To develop this theme::
51+
52+
git clone https://github.com/pyansys/pyansys-sphinx-theme.git
53+
pip install -r requirements_docs.txt
54+
make -C doc html
55+
56+
Or for Windows::
57+
58+
cd doc
59+
./make.bat
60+
61+
We use `pre-commit <https://pre-commit.com/>`_ to simplfy style checks. You can
62+
optionally use this by following the `installation
63+
<https://pre-commit.com/#install>`_ and `usage
64+
<https://pre-commit.com/#usage>`_ guides.
65+
66+
67+
License
68+
~~~~~~~
69+
This theme is licened under the `MIT License
70+
<https://raw.githubusercontent.com/pyansys/pyansys-sphinx-theme/main/LICENSE>`_.

doc/source/class_documentation.rst

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@ User Guide Documentation Method
77

88
There are two main ways of documenting a class using Sphinx. The
99
first approach is to detail its usage via a "User Guide", or manually
10-
created example designed to be read within documentation. This
10+
created example designed to be read within documentation. This
1111
approach works when demonstrating the usage of a class. For example,
12-
using the ``.. code:: python`` directive:
13-
14-
.. code::
12+
using the ``.. code:: python`` directive::
1513

1614
Initialize ``my_module.MyClass`` with initial parameters. These
1715
parameters are automatically assigned to the class.
@@ -38,7 +36,7 @@ parameters are automatically assigned to the class.
3836
Autoclass Directive
3937
~~~~~~~~~~~~~~~~~~~
4038

41-
The "user guide" approach works for explaining the "why" and "how" of a class. As
39+
The "User Guide" approach works for explaining the "why" and "how" of a class. As
4240
for the "what" of a class, you can describe the API automatically
4341
using the ``autoclass`` directive:
4442

@@ -57,8 +55,8 @@ using the ``autoclass`` directive:
5755
Autosummary Directive
5856
~~~~~~~~~~~~~~~~~~~~~
5957
Simple classes can be easily represented using the ``autoclass``
60-
directive, but more complex classes with many methods should be
61-
documented via the ``autosummary`` directive. For example,
58+
directive. However, more complex classes with many methods should be
59+
documented via the ``autosummary`` directive. For example:
6260

6361
.. code::
6462
@@ -68,7 +66,7 @@ documented via the ``autosummary`` directive. For example,
6866
pyansys_sphinx_theme.samples.Complex
6967
7068
71-
Will generate the following documentation:
69+
This code will generate the following documentation:
7270

7371
.. autosummary::
7472
:toctree: _autosummary

doc/source/coding_style.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Aside from pyansys specific directives, the best coding practice is to simply
2323
follow established guidelines from `PEP8 <https://www.python.org/dev/peps/pep-0008/>`__.
2424

2525

26-
Deprecation Best-Practice
26+
Deprecation Best Practice
2727
-------------------------
2828
Whenever a method, class, or function is deprecated, we must provide
2929
an old method that calls the new method and raises a warning, or raise
@@ -108,11 +108,11 @@ Then simply use that inplace of ``Exception``
108108
"""
109109
raise DeprecationError('`my_function` has been deprecated')
110110
111-
Imports Best-Practice
111+
Imports Best Practice
112112
---------------------
113113

114114
Following the `PEP8 guidelines <https://www.python.org/dev/peps/pep-0008/#imports>`_,
115-
imports should be added at the top of the file and should be grouped in the following order:
115+
imports should be added at the top of the file and should be grouped in this order:
116116

117117
1. Standard library imports.
118118
2. Related third party imports.
@@ -136,7 +136,7 @@ For example, consider the unorganized imports below:
136136
from ansys.mapdl.core.commands import Commands
137137
from ansys.mapdl.core.inline_functions import Query
138138
139-
Organizing those same imports into groups vastly improves readibilty:
139+
Organizing these same imports into groups vastly improves readibilty:
140140

141141
.. code:: python
142142
@@ -156,9 +156,9 @@ Organizing those same imports into groups vastly improves readibilty:
156156
from ansys.mapdl.core.commands import Commands
157157
from ansys.mapdl.core.inline_functions import Query
158158
159-
It is also recommended that the imports within a section be organized alphabetically.
160-
Following this convention makes imports easily searchable. This standard is optional
161-
and will not be enforced, but it may be preferred in some projects.
159+
We also recommend that the imports within a section be organized alphabetically.
160+
Following this convention makes imports easily searchable. While this standard is optional,
161+
it may be preferred in some projects.
162162

163163
.. code:: python
164164
@@ -178,7 +178,7 @@ and will not be enforced, but it may be preferred in some projects.
178178
from ansys.mapdl.core.plotting import general_plotter
179179
from ansys.mapdl.core.post import PostProcessing
180180
181-
Additionally, it is recommended to use absolute imports over relative imports, since they are
181+
Additionally, we recommend to use absolute imports over relative imports because they are
182182
more readable and reliable:
183183

184184
.. code:: python
@@ -201,7 +201,7 @@ method or feature is added, changed, or removed, the minor version
201201
should be bumped.
202202

203203
To avoid constantly bumping the minor version, one approach to for
204-
source-control branching is to create release branches where only
204+
source control branching is to create release branches where only
205205
patch fixes are pushed to, and API changes occur between minor
206206
releases. See `Trunk Based Development
207207
<https://trunkbaseddevelopment.com/>`_. In summary, the mainline
@@ -218,7 +218,7 @@ update any projects dependent on the API while still being treated as
218218
multiple "release branches" in a repository, the number of active
219219
release branches should be between one and three.
220220

221-
Docstring Examples Best-Practice
221+
Docstring Examples Best Practice
222222
--------------------------------
223223
Defining docstring examples for methods and classes are extremely
224224
useful. The examples give users an easy place to start when trying
@@ -228,7 +228,7 @@ also be used to perform regression testing to verify that the code is
228228
executing as expected.
229229

230230
This is an important feature of maintainable documentation as examples
231-
must always match the API they are documenting, and any changes within
231+
must always match the API that they are documenting. Any changes within
232232
the API without a corresponding change in the documentation will
233233
trigger doctest failures.
234234

@@ -252,11 +252,11 @@ execute them to verify that they function as written.
252252
Using ``pytest`` Fixtures
253253
~~~~~~~~~~~~~~~~~~~~~~~~~
254254
To define a setup sequence before the ``doctest`` run or before a given
255-
module is tested, ``pytest`` fixtures can be used. Fixtures allow docstring
256-
examples to access shared objects, so there is no need to repeat the setup
255+
module is tested, you can use ``pytest`` fixtures. Because fixtures allow docstring
256+
examples to access shared objects, there is no need to repeat the setup
257257
in each example.
258258

259-
``pytest`` fixtures can defined in a ``conftest.py`` file next to the source
259+
You can define ``pytest`` fixtures in a ``conftest.py`` file next to the source
260260
code. The following example shows a fixture that is run automatically for
261261
each ``doctest`` session.
262262

@@ -276,7 +276,7 @@ each ``doctest`` session.
276276
yield desktop
277277
desktop.force_close_desktop()
278278
279-
Fixtures can also be defined in a separate Python file from
279+
You can also define fixtures in a separate Python file from
280280
``conftest.py``. This may help keep the fixtures more organized. Fixtures
281281
from other files need to be imported in the main ``conftest.py`` file. The
282282
following example shows how to import fixtures defined in an
@@ -345,7 +345,7 @@ example, by referencing the key ``icepak``.
345345
Examples
346346
--------
347347
348-
Create an opening boundary for the faces of the "USB_GND" object.
348+
Create an opening boundary for the faces of the ``USB_GND`` object.
349349
350350
>>> faces = icepak.modeler.primitives["USB_GND"].faces
351351
>>> face_names = [face.id for face in faces]
@@ -358,7 +358,7 @@ example, by referencing the key ``icepak``.
358358
Useful Features
359359
~~~~~~~~~~~~~~~
360360

361-
Ellipses For Random Output
361+
Ellipses for Random Output
362362
**************************
363363
If the output of some operation in an example cannot be verified exactly,
364364
an ellipsis (``...``) can be used in the expected output. This allows it

0 commit comments

Comments
 (0)