Skip to content

Commit 2e1e24e

Browse files
authored
Merge branch 'main' into zhanqun/dyna-prev4
2 parents 8050acf + 1f36e5d commit 2e1e24e

File tree

8 files changed

+134
-62
lines changed

8 files changed

+134
-62
lines changed

.github/workflows/ci_cd.yml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- name: PyAnsys documentation style checks
28-
uses: pyansys/actions/doc-style@v3
28+
uses: pyansys/actions/doc-style@v4
2929
with:
3030
token: ${{ secrets.GITHUB_TOKEN }}
3131

@@ -45,7 +45,7 @@ jobs:
4545

4646
- name: Install packages for documentation build
4747
run: |
48-
sudo apt-get install xvfb pandoc
48+
sudo apt-get install xvfb pandoc texlive-latex-extra latexmk
4949
pip install --upgrade build
5050
pip install .[doc]
5151
@@ -56,17 +56,28 @@ jobs:
5656
sleep 10
5757
cd -
5858
59-
- name: Build the documentation
59+
- name: Build the documentation (HTML)
6060
run: |
6161
xvfb-run make -C doc html
6262
63+
- name: Build the documentation (PDF)
64+
run: |
65+
make -C doc pdf
66+
6367
- name: Upload HTML documentation
6468
uses: actions/upload-artifact@v3
6569
with:
6670
name: documentation-html
6771
path: doc/_build/html
6872
retention-days: 7
6973

74+
- name: Upload PDF documentation
75+
uses: actions/upload-artifact@v3
76+
with:
77+
name: documentation-pdf
78+
path: doc/_build/latex/*.pdf
79+
retention-days: 7
80+
7081
- name: Upload the server logs
7182
if: always()
7283
uses: actions/upload-artifact@v3
@@ -79,7 +90,7 @@ jobs:
7990
runs-on: ubuntu-latest
8091
steps:
8192
- name: PyAnsys code style checks
82-
uses: pyansys/actions/code-style@v3
93+
uses: pyansys/actions/code-style@v4
8394
with:
8495
python-version: ${{ env.MAIN_PYTHON_VERSION }}
8596

@@ -95,7 +106,7 @@ jobs:
95106

96107
steps:
97108
- name: Build wheelhouse and perform smoke test
98-
uses: pyansys/actions/build-wheelhouse@v3
109+
uses: pyansys/actions/build-wheelhouse@v4
99110
with:
100111
library-name: ${{ env.PACKAGE_NAME }}
101112
library-namespace: ${{ env.PACKAGE_NAMESPACE }}
@@ -163,7 +174,7 @@ jobs:
163174
runs-on: ubuntu-latest
164175
steps:
165176
- name: Build library source and wheel artifacts
166-
uses: pyansys/actions/build-library@v3
177+
uses: pyansys/actions/build-library@v4
167178
with:
168179
library-name: ${{ env.PACKAGE_NAME }}
169180
python-version: ${{ env.MAIN_PYTHON_VERSION }}
@@ -174,8 +185,15 @@ jobs:
174185
needs: [package]
175186
runs-on: ubuntu-latest
176187
steps:
188+
- name: Release to the private PyPI repository
189+
uses: pyansys/actions/release-pypi-private@v4
190+
with:
191+
library-name: ${{ env.PACKAGE_NAME }}
192+
twine-username: "__token__"
193+
twine-token: ${{ secrets.PYANSYS_PYPI_PRIVATE_PAT }}
194+
177195
- name: Release to GitHub
178-
uses: pyansys/actions/release-github@v3
196+
uses: pyansys/actions/release-github@v4
179197
with:
180198
library-name: ${{ env.PACKAGE_NAME }}
181199

@@ -186,7 +204,7 @@ jobs:
186204
needs: [package]
187205
steps:
188206
- name: Deploy the latest documentation
189-
uses: pyansys/actions/doc-deploy-dev@v3
207+
uses: pyansys/actions/doc-deploy-dev@v4
190208
with:
191209
cname: ${{ env.DOCUMENTATION_CNAME }}
192210
token: ${{ secrets.GITHUB_TOKEN }}
@@ -198,8 +216,8 @@ jobs:
198216
needs: [release]
199217
steps:
200218
- name: Deploy the stable documentation
201-
uses: pyansys/actions/doc-deploy-stable@v3
219+
uses: pyansys/actions/doc-deploy-stable@v4
202220
with:
203221
cname: ${{ env.DOCUMENTATION_CNAME }}
204222
token: ${{ secrets.GITHUB_TOKEN }}
205-
python-version: ${{ env.MAIN_PYTHON_VERSION }}
223+
python-version: ${{ env.MAIN_PYTHON_VERSION }}

.github/workflows/label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676
runs-on: ubuntu-latest
7777
steps:
7878
- name: Suggest to add labels
79-
uses: peter-evans/create-or-update-comment@v2
79+
uses: peter-evans/create-or-update-comment@v3
8080
# Execute only when no labels have been applied to the pull request
8181
if: toJSON(github.event.pull_request.labels.*.name) == '{}'
8282
with:

README.rst

Lines changed: 77 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PyDyna
2-
#############
1+
PyDyna
2+
######
33

44
PyDyna is a pythonic dyna package that aims to provide user a more convenient and complete way to
55
build up ansys-dyna input deck, submit to solver and finally post processing their results.
@@ -37,14 +37,82 @@ detailed description of the package.
3737

3838
Installation
3939
------------
40-
This package is not yet available on PyPI, so for now the only real
41-
option is for you to download the code from GitHub:
40+
41+
PyDyna has three installation modes: user, developer, and offline.
42+
43+
Install in user mode
44+
^^^^^^^^^^^^^^^^^^^^
45+
46+
Before installing PyDyna in user mode, make sure you have the latest version of
47+
`pip`_ with:
48+
49+
.. code:: bash
50+
51+
python -m pip install -U pip
52+
53+
Then, install PyDyna with:
54+
55+
.. code:: bash
56+
57+
python -m pip install ansys-dyna-core
58+
59+
.. caution::
60+
61+
PyDyna is currently hosted in a private PyPI repository. You must provide the index
62+
URL to the private PyPI repository:
63+
64+
* Index URL: ``https://pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/``
65+
66+
If access to this package registry is needed, email `[email protected] <mailto:[email protected]>`_
67+
to request access. The PyAnsys team can provide you a read-only token to be inserted in ``${PRIVATE_PYPI_ACCESS_TOKEN}``.
68+
Once you have it, run the following command:
69+
70+
.. code:: bash
71+
72+
pip install ansys-dyna-core --index-url=https://${PRIVATE_PYPI_ACCESS_TOKEN}@pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple/
73+
74+
Install in developer mode
75+
^^^^^^^^^^^^^^^^^^^^^^^^^
76+
77+
Installing PyDyna in developer mode allows you to modify the source and enhance it.
78+
79+
.. note::
80+
81+
Before contributing to the project, ensure that you are thoroughly familiar
82+
with the `PyAnsys Developer's Guide`_.
83+
84+
Start by cloning the repository
4285

4386
.. code::
4487
4588
git clone https://github.com/pyansys/pyDyna
4689
47-
and copy the required files
90+
and copy the required files.
91+
92+
Install in offline mode
93+
^^^^^^^^^^^^^^^^^^^^^^^
94+
95+
If you lack an internet connection on your installation machine (or you do not have access to the
96+
private Ansys PyPI packages repository), you should install PyDyna by downloading the wheelhouse
97+
archive from the `Releases Page <https://github.com/pyansys/pydyna/releases>`_ for your
98+
corresponding machine architecture.
99+
100+
Each wheelhouse archive contains all the Python wheels necessary to install PyDyna from scratch on Windows
101+
and Linux, from Python 3.7 to 3.10. You can install this on an isolated system with a fresh Python
102+
installation or on a virtual environment.
103+
104+
For example, on Linux with Python 3.7, unzip the wheelhouse archive and install it with:
105+
106+
.. code:: bash
107+
108+
unzip ansys-dyna-core-v0.3.dev0-wheelhouse-Linux-3.7.zip wheelhouse
109+
pip install ansys-dyna-core -f wheelhouse --no-index --upgrade --ignore-installed
110+
111+
If you are on Windows with Python 3.9, unzip the corresponding wheelhouse to a wheelhouse directory
112+
and install using the preceding command.
113+
114+
Consider installing using a `virtual environment <https://docs.python.org/3/library/venv.html>`_.
115+
48116

49117
Documentation
50118
-------------
@@ -115,3 +183,7 @@ License
115183
-------
116184
Distributed under the MIT license. See LICENSE in the root directory
117185
of the repository for details.
186+
187+
.. LINKS AND REFERENCES
188+
.. _pip: https://pypi.org/project/pip/
189+
.. _PyAnsys Developer's Guide: https://dev.docs.pyansys.com/

doc/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# You can set these variables from the command line, and also
55
# from the environment for the first two.
6-
SPHINXOPTS = -j auto -W --color
6+
SPHINXOPTS = -j auto
77
SPHINXBUILD = sphinx-build
88
SOURCEDIR = source
99
BUILDDIR = _build
@@ -27,4 +27,4 @@ clean:
2727
pdf:
2828
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2929
cd $(BUILDDIR)/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
30-
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1
30+
(test -f $(BUILDDIR)/latex/*.pdf && echo pdf exists) || exit 1

doc/source/_templates/sidebar-nav-bs.html

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

doc/source/conf.py

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,14 @@
44
import os
55

66
import pyvista
7-
from ansys_sphinx_theme import pyansys_logo_black, ansys_favicon
7+
from ansys_sphinx_theme import get_version_match, pyansys_logo_black, ansys_favicon
88
from sphinx.builders.latex import LaTeXBuilder
99
from sphinx_gallery.sorting import FileNameSortKey
1010

1111
from ansys.dyna.core import __version__
1212

1313
LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml"]
1414

15-
def get_version_match(semver):
16-
"""Evaluate the version match for the multi-documentation."""
17-
if semver.endswith("dev0"):
18-
return "dev"
19-
major, minor, _ = semver.split(".")
20-
return ".".join([major, minor])
21-
2215

2316
# Project information
2417
project = 'ansys-dyna-core'
@@ -102,9 +95,6 @@ def get_version_match(semver):
10295
# Favicon
10396
html_favicon = ansys_favicon
10497

105-
# We have our own custom templates
106-
templates_path = ['_templates']
107-
10898
# The suffix(es) of source filenames.
10999
source_suffix = '.rst'
110100

@@ -142,9 +132,10 @@ def get_version_match(semver):
142132
}
143133
html_theme_options = {
144134
"switcher": {
145-
"json_url": f"https://{cname}/release/versions.json",
135+
"json_url": f"https://{cname}/versions.json",
146136
"version_match": get_version_match(__version__),
147137
},
138+
"check_switcher": False,
148139
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
149140
"github_url": "https://github.com/pyansys/pydyna",
150141
"show_prev_next": False,
@@ -160,4 +151,4 @@ def get_version_match(semver):
160151
html_static_path = ['_static']
161152

162153
# necessary for pyvista when building the sphinx gallery
163-
pyvista.BUILDING_GALLERY = True
154+
pyvista.BUILDING_GALLERY = True

doc/source/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
PyDyna documentation 0.0.1
2-
===========================
1+
PyDyna documentation |version|
2+
===============================
33

44
.. include:: ../../README.rst
55

pyproject.toml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
name = "ansys-dyna-core"
7-
version = "0.2.dev0"
7+
version = "0.3.dev0"
88
description = "Python interface to LS-DYNA Service"
99
readme = "README.rst"
1010
requires-python = ">=3.7,<4"
@@ -34,42 +34,42 @@ dependencies = [
3434

3535
[project.optional-dependencies]
3636
tests = [
37-
"pyvista==0.38.2",
38-
"matplotlib==3.7.0",
37+
"pyvista==0.38.5",
38+
"matplotlib==3.7.1",
3939
"numpy==1.24.2",
40-
"pytest==7.2.1",
40+
"pytest==7.2.2",
4141
"pytest-cov==4.0.0",
4242
"codecov==2.1.12",
4343
"joblib==1.2.0",
44-
"pandas==1.5.3",
45-
"openpyxl==3.1.1",
46-
"scikit-learn==1.2.1",
47-
"pytest-xdist==3.2.0",
48-
"ipython==8.10.0",
44+
"pandas==2.0.0",
45+
"openpyxl==3.1.2",
46+
"scikit-learn==1.2.2",
47+
"pytest-xdist==3.2.1",
48+
"ipython==8.12.0",
4949
]
5050
doc = [
5151
"recommonmark==0.7.1",
52-
"matplotlib==3.7.0",
53-
"imageio==2.25.1",
52+
"matplotlib==3.7.1",
53+
"imageio==2.27.0",
5454
"imageio-ffmpeg==0.4.8",
55-
"pyvista==0.38.2",
55+
"pyvista==0.38.5",
5656
"numpydoc==1.5.0",
5757
"Sphinx==5.3.0",
5858
"sphinx-autobuild==2021.3.14",
5959
"sphinxcontrib-websupport==1.2.4",
6060
"pytest-sphinx==0.5.0",
6161
"sphinx-notfound-page==0.8.3",
6262
"sphinx-copybutton==0.5.1",
63-
"sphinx-gallery==0.11.1",
63+
"sphinx-gallery==0.12.2",
6464
"sphinx-autodoc-typehints==1.22",
65-
"ansys-sphinx-theme==0.8.2",
66-
"pypandoc==1.10",
67-
"nbsphinx==0.8.12",
68-
"ipywidgets==8.0.4",
65+
"ansys-sphinx-theme==0.9.6",
66+
"pypandoc==1.11",
67+
"nbsphinx==0.9.1",
68+
"ipywidgets==8.0.6",
6969
"joblib==1.2.0",
70-
"scikit-learn==1.2.1",
71-
"ipython==8.10.0",
72-
"jupyterlab==3.6.1",
70+
"scikit-learn==1.2.2",
71+
"ipython==8.12.0",
72+
"jupyterlab==3.6.3",
7373
]
7474

7575
[project.urls]

0 commit comments

Comments
 (0)