Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/pip/sphinx-copybutton-0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RobPasMue authored Jul 31, 2023
2 parents 69ae97d + 01738a2 commit 1f8a9ab
Show file tree
Hide file tree
Showing 12 changed files with 72 additions and 69 deletions.
56 changes: 29 additions & 27 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,28 +23,27 @@ concurrency:
cancel-in-progress: true

jobs:
style:
name: Code style

code-style:
name: "Code style"
runs-on: ubuntu-latest
steps:
- name: PyAnsys code style checks
uses: ansys/actions/code-style@v4
- uses: ansys/actions/code-style@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

docs-style:
name: Documentation Style Check
doc-style:
name: "Doc style"
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
uses: ansys/actions/doc-style@v4
- uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}

smoke-tests:
name: Build and Smoke tests
name: "Wheelhouse for ${{ matrix.os }} and ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
needs: [style]
needs: code-style
strategy:
fail-fast: false
matrix:
Expand All @@ -64,11 +63,15 @@ jobs:
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

build_and_test:
name: Build & test
tests:
name: "Test ${{ matrix.python-version }} with ${{ matrix.os }}"
needs: [smoke-tests]
runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
Expand All @@ -85,16 +88,16 @@ jobs:
env:
ANSYSLMD_LICENSE_FILE: ${{ format('1055@{0}', secrets.LICENSE_SERVER) }}
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
requires-xvfb: true

- uses: codecov/codecov-action@v3
name: 'Upload coverage to CodeCov'

docs:
name: Build docs
doc:
name: "Doc build"
runs-on: ubuntu-latest
needs: [smoke-tests]
needs: doc-style
steps:
- uses: actions/checkout@v3

Expand All @@ -115,13 +118,12 @@ jobs:
with:
sphinxopts: '-j auto'

package:
name: Package library
needs: [build_and_test, docs]
build-library:
name: "Build library"
needs: [doc, tests]
runs-on: ubuntu-latest
steps:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v4
- uses: ansys/actions/build-library@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -130,7 +132,7 @@ jobs:
name: "Deploy development documentation"
# Deploy development only when merging to main
if: github.ref == 'refs/heads/main'
needs: [package]
needs: build-library
runs-on: ubuntu-latest
steps:
- name: "Deploy the latest documentation"
Expand All @@ -142,7 +144,7 @@ jobs:
release:
name: Release
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [package]
needs: build-library
runs-on: ubuntu-latest
steps:
# Upload first to the private PyPi, at least up until we release
Expand All @@ -169,7 +171,7 @@ jobs:
# Deploy release documentation when creating a new tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags')
runs-on: ubuntu-latest
needs: [package]
needs: release
steps:
- name: "Deploy the stable documentation"
uses: ansys/actions/doc-deploy-stable@v4
Expand All @@ -180,7 +182,7 @@ jobs:
build-failure:
name: Teams notify on failure
if: failure() && (github.event_name == 'pull_request' || github.ref == 'refs/heads/main' || github.ref_type == 'tag')
needs: [smoke-tests, build_and_test ]
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ dist/
# autogenerated docs
_autosummary
_examples
_build

# Testing
.coverage
Expand Down
8 changes: 4 additions & 4 deletions doc/source/calc_functions.rst
Original file line number Diff line number Diff line change
Expand Up @@ -898,13 +898,13 @@ The distance normal from the surface to where :math:`u/U=0.995`.
* - ymax
- constant number (> 0 = Baldwin-Lomax-Spalart algorithm, 0 = convergence algorithm)

See the algorithm note that follows.
See the algorithm note that follows.

* - grad
- -1 = flags the computing of the
velocity-magnitude gradient via three-point interpolation

vector variable = Grad(velocity magnitude) See :ref:`BL_aGradfVelMag <BL_aGradOfVelMag>`.
vector variable = Grad(velocity magnitude) See :ref:`BL_aGradfVelMag <BL_aGradOfVelMag>`.


.. note::
Expand Down Expand Up @@ -999,7 +999,7 @@ thickness :math:`\delta`. It is defined as:
* - ymax
- constant number (> 0 = Baldwin-Lomax-Spalart algorithm, 0 = convergence algorithm)

See the algorithm note under :ref:`Boundary Layer Thickness <BL_Thick>`.
See the algorithm note under :ref:`Boundary Layer Thickness <BL_Thick>`.

* - comp
- constant number (0 = velocity vector at edge of boundary layer, 1 = decomposed
Expand All @@ -1009,7 +1009,7 @@ thickness :math:`\delta`. It is defined as:
- -1 flags the computing of the
velocity-magnitude gradient via four-point interpolation

vector variable = Grad(velocity magnitude) See :ref:`BL_aGradfVelMag <BL_aGradOfVelMag>`.
vector variable = Grad(velocity magnitude) See :ref:`BL_aGradfVelMag <BL_aGradOfVelMag>`.


.. note::
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
html_theme_options = {
"check_switcher": False,
"switcher": {
"json_url": f"https://{cname}/release/versions.json",
"json_url": f"https://{cname}/versions.json",
"version_match": get_version_match(__version__),
},
"navbar_end": ["version-switcher", "theme-switcher", "navbar-icon-links"],
Expand Down
2 changes: 1 addition & 1 deletion doc/source/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ to verify the code style. You can use this command to verify the code style:

.. code:: bash
python pybuild.py precommit
pre-commit run --all-files
2 changes: 1 addition & 1 deletion doc/source/user_guide/object_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Unlike the native API, the object API does not require a "current selection" as
the target of all operations is explicit. The object API supports SELECTED attributes
and selection group objects. These directly represent the state of the EnSight GUI.
In cases where one would like to use both APIs in a single script, it can become
necessary to synchronize these two selections. See: `selection_transfer`_ for details
necessary to synchronize these two selections. See: :ref:`selection_transfer` for details
on how this can be done.


Expand Down
24 changes: 11 additions & 13 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ dev = [
"dill>=0.3.5.1",
"pre-commit>=3.3.3",
]

tests = [
"pytest==7.1.2",
"pytest-cov==3.0.0",
Expand All @@ -55,7 +54,6 @@ tests = [
"requests>=2.28.2",
"pyansys-docker>=5.0.4",
]

doc = [
"Sphinx==7.0.1",
"numpydoc==1.5.0",
Expand All @@ -71,6 +69,16 @@ doc = [
"sphinxcontrib-openapi==0.8.1"
]

[project.urls]
Documentation = "https://ensight.docs.pyansys.com/"
Homepage = "https://github.com/ansys/pyensight"
Source = "https://github.com/ansys/pyensight"
Tracker = "https://github.com/ansys/pyensight/issues"
Changelog = "https://github.com/ansys/pyensight/blob/main/CHANGELOG.rst"

[tool.flit.module]
name = "ansys.pyensight.core"

[tool.coverage.run]
branch = true

Expand All @@ -91,16 +99,6 @@ show_missing = true
[tool.coverage.html]
show_contexts = true

[project.urls]
Documentation = "https://ensight.docs.pyansys.com/"
Homepage = "https://github.com/ansys/pyensight"
Source = "https://github.com/ansys/pyensight"
Tracker = "https://github.com/ansys/pyensight/issues"
Changelog = "https://github.com/ansys/pyensight/blob/main/CHANGELOG.rst"

[tool.flit.module]
name = "ansys.pyensight.core"

[tool.black]
line-length = 100
src_paths = ["src/ansys", "doc"]
Expand Down Expand Up @@ -169,4 +167,4 @@ module = ["grpc",
ignore_missing_imports = true

[pydocstyle]
convention = "numpy"
convention = "numpy"
2 changes: 1 addition & 1 deletion src/ansys/pyensight/core/dockerlauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def _is_system_egl_capable(self) -> bool:
def enshell_log_contents(self) -> Optional[str]:
"""Get the contents of the EnShell log if possible.
Return
Returns
-------
str
Contents of the log or ``None``.
Expand Down
20 changes: 10 additions & 10 deletions src/ansys/pyensight/core/ensobj.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def getattr(self, attrid: Any) -> Any:
Any
The current value of the attribute.
Example
-------
Examples
--------
These commands are equivalent
>>> v = part.VISIBLE
Expand All @@ -106,8 +106,8 @@ def getattrs(self, attrid: Optional[list] = None, text: int = 0) -> dict:
values. If text is set to 1, the dictionary keys will be strings.
Return:
Example
-------
Examples
--------
To copy some attributes from one part to another.
>>> tmp = part0.getattrs(["VISIBLE", session.ensight.objs.enums.OPAQUENESS])
Expand Down Expand Up @@ -310,8 +310,8 @@ def attrtree(
from the output. The default value for this keyword is 1 which disables all
sensitivity filtering.
Example
-------
Examples
--------
>>> def walk_tree(part,obj,s):
>>> a = obj.attr
Expand Down Expand Up @@ -380,8 +380,8 @@ def setmetatag(self, tag: str, value: Optional[Any]) -> None:
value : Any, optional
The value to change to tag to. Note: this can be a string, int or float.
Example
-------
Examples
--------
>>> session.ensight.objs.core.PARTS[0].setmetatag("FOO", "HELLO")
>>> print(session.ensight.objs.core.PARTS[0].METADATA)
Expand Down Expand Up @@ -422,8 +422,8 @@ def getmetatag(self, tag: str) -> Any:
Any
The value assigned to the tag in the METADATA attribute.
Example
-------
Examples
--------
>>> session.ensight.objs.core.PARTS[0].setmetatag("FOO", "HELLO")
>>> print(session.ensight.objs.core.PARTS[0].getmetatag("FOO"))
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/pyensight/core/locallauncher.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def get_cei_install_directory(ansys_installation: Optional[str]) -> str:
``PYENSIGHT_ANSYS_INSTALLATION`` environmental variable is checked first.
Returns
--------
-------
str
Validated installation directory, which contains ``bin/ensight``.
Expand Down
14 changes: 8 additions & 6 deletions src/ansys/pyensight/core/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def ensight(self) -> "ensight_api.ensight":

@property
def grpc(self) -> "ensight_grpc.EnSightGRPC":
"""gRPC wrapper instance used by this session to access EnSight."""
"""The gRPC wrapper instance used by this session to access EnSight."""
return self._grpc

@property
Expand Down Expand Up @@ -601,8 +601,10 @@ def run_script(self, filename: str) -> Optional[types.ModuleType]:
Python debugger with an EnSight Python script, using the PyEnSight interface.
.. note::
Because the Python script is imported as a module, the script filename must
have a ``.py`` extension.
Because the Python script is imported as a module, the script filename must
have a ``.py`` extension.
Parameters
----------
Expand Down Expand Up @@ -1000,7 +1002,7 @@ def load_data(
data is being read.
Examples
-------_
--------
>>> from ansys.pyensight.core import LocalLauncher
>>> session = LocalLauncher().start()
>>> session.load_data(r'D:\data\CFX\example_data.res')
Expand Down Expand Up @@ -1506,8 +1508,8 @@ def restore_context(self, context: "enscontext.EnsContext") -> None:
context : enscontext.EnsContext
Context to set the current EnSight instance to.
Example
-------
Examples
--------
>>> tmp_ctx = session.capture_context()
>>> session.restore_context(EnsContext("session_context.ctxz"))
>>> session.restore_context(tmp_ctx)
Expand Down
8 changes: 4 additions & 4 deletions src/ansys/pyensight/core/utils/export.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,14 +283,14 @@ def animation(
``"ANIM_TYPE_SOLUTIONTIME"`` is used. This table provides descriptions
by each option number and name:
========================== ========================================
Name Animation type
========================== ========================================
=========================== ========================================
Name Animation type
=========================== ========================================
0: ANIM_TYPE_SOLUTIONTIME Animation over all solution times
1: ANIM_TYPE_ANIMATEDTRACES Records animated rotations and traces
2: ANIM_TYPE_FLIPBOOK Records current flipbook animation
3: ANIM_TYPE_KEYFRAME Records current kKeyframe animation
========================== ========================================
=========================== ========================================
frames : int, optional
Number of frames to save. The default is ``None``. The default for
Expand Down

0 comments on commit 1f8a9ab

Please sign in to comment.