Skip to content

Commit

Permalink
Merge branch 'main' into feat/adding-new-commands
Browse files Browse the repository at this point in the history
  • Loading branch information
clatapie authored Oct 27, 2023
2 parents 6dc8671 + 2c9bad9 commit 1d6968a
Show file tree
Hide file tree
Showing 50 changed files with 973 additions and 314 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


defaults:
run:
shell: bash

permissions:
contents: write
packages: read

jobs:

doc-style:
Expand Down Expand Up @@ -479,6 +482,9 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
fetch-depth: 0


- name: "Setup Python"
uses: actions/setup-python@v4
Expand Down
17 changes: 15 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,21 @@ repos:
hooks:
- id: isort

- repo: https://github.com/numpy/numpydoc
rev: v1.6.0
hooks:
- id: numpydoc-validation
exclude: |
(?x)(
tests/|
examples|
doc/source/|
src/ansys/mapdl/core/_commands|
src/ansys/mapdl/core/commands
)
- repo: https://github.com/psf/black
rev: 23.9.1 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
rev: 23.10.0 # IF VERSION CHANGES --> MODIFY "blacken-docs" MANUALLY AS WELL!!
hooks:
- id: black
args:
Expand All @@ -18,7 +31,7 @@ repos:
rev: 1.16.0
hooks:
- id: blacken-docs
additional_dependencies: [black==23.9.1]
additional_dependencies: [black==23.10.0]

- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
Expand Down
6 changes: 5 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ you can create issues to report bugs and request new features. On the `PyMAPDL D
<https://github.com/ansys/pymapdl/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email `[email protected] <[email protected]>`_.
To reach the project support team, email `PyAnsys Core team <[email protected]>`_.
Unfortunately, this team cannot answer specific library questions or issues. You must
use the `PyMAPDL Issues <https://github.com/ansys/pymapdl/issues>`_
and `PyMAPDL Discussions <https://github.com/ansys/pymapdl/discussions>`_ pages
for raising issues, request new features, and asking questions.

Project transition - legacy support
-----------------------------------
Expand Down
3 changes: 1 addition & 2 deletions doc/source/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,4 @@ These links refers to the following GitHub repository where you can find all of
`GitHub Example Data Repository <example_data_repo_>`_

If you find a missing or broken link, open an issue in
GitHub (`PyMAPDL Issues <pymapdl_issues_>`_)
or send an email to `PyAnsys Core team <pyansys_core_>`_.
GitHub (`PyMAPDL Issues <pymapdl_issues_>`_).
9 changes: 5 additions & 4 deletions doc/source/getting_started/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ Use the `PyMAPDL Issues <pymapdl_issues_>`_
page to submit questions, report bugs, and request new features. When possible,
use these issue templates:

* Bug report template
* Feature request template
* **🐞 Bug, problem, or error**: Fill a bug report here
* **📖 Documentation issue**: Modifications to the documentation only
* **🎓 Adding an example**: Proposing a new example for the library
* **💡 New feature**: Enhancements to the code

If your issue does not fit into one of these categories, create your own issue.
If your issue does not fit into one of these categories, click on `Open a black issue <pymapdl_new_blank_issue_>`_.

To reach the project support team, email `PyAnsys Core team <pyansys_core_>`_.

Viewing PyMAPDL documentation
=============================
Expand Down
4 changes: 2 additions & 2 deletions doc/source/getting_started/learning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,5 +174,5 @@ Recommended articles
.. vale on
Feel free to email any educational or learning resource to
`PyAnsys Core team <pyansys_core_>`_.
Feel free to share any educational or learning resources by `opening an issue <pymapdl_issues_>`_
or `starting a discussion <pymapdl_discussions_>`_ on Github.
3 changes: 1 addition & 2 deletions doc/source/getting_started/versioning.rst
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ it is recommended exploring alternative interfaces available in PyMAPDL.
PyMAPDL maintainers greatly appreciate your support and understanding
during this transition.
If you have any questions or concerns regarding this change,
email `[email protected] <[email protected]>`_ or
post them on the `PyMAPDL Discussions <https://github.com/ansys/pymapdl>`_ page.
post them on the `PyMAPDL Discussions <pymapdl_discussions_>`_ page.

Console interface
-----------------
Expand Down
7 changes: 6 additions & 1 deletion doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,12 @@ you can create issues to report bugs and request new features. On the `PyMAPDL D
<https://github.com/ansys/pymapdl/discussions>`_ page or the `Discussions <https://discuss.ansys.com/>`_
page on the Ansys Developer portal, you can post questions, share ideas, and get community feedback.

To reach the project support team, email `[email protected] <[email protected]>`_.
To reach the PyAnsys project support team, email `PyAnsys Core team <[email protected]>`_.
Unfortunately no specific library questions or issues are answered through this email.
Please refer to `PyMAPDL Issues <pymapdl_issues_>`_,
or `PyMAPDL Discussions <pymapdl_discussions_>`_ for raising issues,
request new features, or asking questions.


Project index
-------------
Expand Down
2 changes: 2 additions & 0 deletions doc/source/links.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@
.. _pymapdl_releases: https://github.com/ansys/pymapdl/releases
.. _pymapdl_run_ubuntu: https://mapdl.docs.pyansys.com/version/dev/user_guide/troubleshoot.html#ubuntu
.. _pymapdl_issues: https://github.com/ansys/pymapdl/issues
.. _pymapdl_new_issue: https://github.com/ansys/pymapdl/issues/new/choose
.. _pymapdl_new_blank_issue: https://github.com/ansys/pymapdl/issues/new
.. _pymapdl_repo: https://github.com/ansys/pymapdl
.. _pymapdl_docs: https://mapdl.docs.pyansys.com/version/stable/
.. _pymapdl_dev_docs: https://mapdl.docs.pyansys.com/version/dev/
Expand Down
2 changes: 1 addition & 1 deletion doc/source/user_guide/database.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Access MAPDL database
=====================

.. warning:: This feature is still in beta. Report any errors or suggestions to `PyAnsys Core team <pyansys_core_>`_.
.. warning:: This feature is still in beta. To report any errors or suggestions, `open an issue on GitHub <pymapdl_new_issue_>`_.


In PyMAPDL v0.61.2 and later, you can access elements and nodes data from the MAPDL database using the DB module.
Expand Down
4 changes: 2 additions & 2 deletions doc/source/user_guide/launcher.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ the location of MAPDL must be provided for non-standard installations.
When running for the first time, ``ansys-mapdl-core`` requests the
location of the MAPDL executable if it cannot automatically find it.
You can test your installation of PyMAPDL and set it up by running
the :func:`launch_mapdl() <ansys.mapdl.core.launch_mapdl>` function:
the :func:`launch_mapdl() <ansys.mapdl.core.launcher.launch_mapdl>` function:

.. code:: python
Expand Down Expand Up @@ -81,4 +81,4 @@ keyword argument:
API reference
~~~~~~~~~~~~~
For more information on controlling how MAPDL launches locally, see the
description of the :func:`launch_mapdl() <ansys.mapdl.core.launch_mapdl>` function.
description of the :func:`launch_mapdl() <ansys.mapdl.core.launcher.launch_mapdl>` function.
81 changes: 74 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ classifiers = [

[project.optional-dependencies]
tests = [
"ansys-dpf-core==0.9.0",
"ansys-dpf-core==0.10.0",
"autopep8==2.0.4",
"matplotlib==3.8.0",
"scipy==1.10.1; python_version < '3.9'", # to support python 3.8
"scipy==1.11.3; python_version > '3.8'",
"pandas==2.1.1",
"pandas==2.1.2",
"pyiges[full]==0.3.1",
"pytest==7.4.2",
"pytest-cov==4.1.0",
Expand All @@ -73,20 +73,20 @@ tests = [
]
doc = [
"sphinx==7.2.6",
"ansys-dpf-core==0.9.0",
"ansys-dpf-core==0.10.0",
"ansys-mapdl-reader==0.52.20",
"ansys-sphinx-theme==0.12.3",
"grpcio==1.51.1",
"imageio-ffmpeg==0.4.9",
"imageio==2.31.5",
"imageio==2.31.6",
"jupyter_sphinx==0.4.0",
"jupyterlab>=3.2.8",
"matplotlib==3.8.0",
"numpydoc==1.6.0",
"pandas==2.1.1",
"pandas==2.1.2",
"plotly==5.17.0",
"pyiges[full]==0.3.1",
"pypandoc==1.11",
"pypandoc==1.12",
"pytest-sphinx==0.5.0",
"pythreejs==2.4.2",
"pyvista[trame]==0.42.3",
Expand Down Expand Up @@ -155,4 +155,71 @@ show_missing = true
skip = '*.pyc,*.txt,*.gif,*.png,*.jpg,*.js,*.html,*.doctree,*.ttf,*.woff,*.woff2,*.eot,*.mp4,*.inv,*.pickle,*.ipynb,flycheck*,./.git/*,./.hypothesis/*,*.yml,./doc/build/*,./doc/images/*,./dist/*,*~,.hypothesis*,./doc/source/examples/*,*cover,*.dat,*.mac,*.cdb,*.CDB,build,./docker/mapdl/v*,./factory/*,./ansys/mapdl/core/mapdl_functions.py,PKG-INFO,*.mypy_cache/*,./docker/mapdl/*,./_unused/*'
ignore-words = "doc/styles/Vocab/ANSYS/accept.txt"
quiet-level = 3
ignore-regex=".*codespell-ignore$|NORML|POIN"
ignore-regex=".*codespell-ignore$|NORML|POIN"

[tool.numpydoc_validation]
checks = [
#"all", # report on all checks, except the below
# "GL01", # "Docstring text (summary) should start in the line immediately "
# "after the opening quotes (not in the same line, or leaving a "
# "blank line in between)",
# "GL02", # "Closing quotes should be placed in the line after the last text "
# "in the docstring (do not close the quotes in the same line as "
# "the text, or leave a blank line between the last text and the "
# "quotes)",
# "GL03", # "Double line break found; please use only one blank line to "
# "separate sections or paragraphs, and do not leave blank lines "
# "at the end of docstrings",
"GL05", # 'Tabs found at the start of line "{line_with_tabs}", please use '
# "whitespace only",
# "GL06", # 'Found unknown section "{section}". Allowed sections are: '
# "{allowed_sections}",
"GL07", # "Sections are in the wrong order. Correct order is: {correct_sections}",
# "GL08", # "The object does not have a docstring",
# "GL09", # "Deprecation warning should precede extended summary",
"GL10", # "reST directives {directives} must be followed by two colons",
# "SS01", # "No summary found (a short summary in a single line should be "
# "present at the beginning of the docstring)",
"SS02", # "Summary does not start with a capital letter",
# "SS03", # "Summary does not end with a period",
"SS04", # "Summary contains heading whitespaces",
# "SS05", # "Summary must start with infinitive verb, not third person "
# '(e.g. use "Generate" instead of "Generates")',
# "SS06", # "Summary should fit in a single line",
# "ES01", # "No extended summary found",
# "PR01", # "Parameters {missing_params} not documented",
# "PR02", # "Unknown parameters {unknown_params}",
"PR03", # "Wrong parameters order. Actual: {actual_params}. "
# "Documented: {documented_params}",
# "PR04", # 'Parameter "{param_name}" has no type',
"PR05", # 'Parameter "{param_name}" type should not finish with "."',
"PR06", # 'Parameter "{param_name}" type should use "{right_type}" instead '
# 'of "{wrong_type}"',
"PR07", # 'Parameter "{param_name}" has no description',
# "PR08", # 'Parameter "{param_name}" description should start with a '
# "capital letter",
# "PR09", # 'Parameter "{param_name}" description should finish with "."',
# "PR10", # 'Parameter "{param_name}" requires a space before the colon '
# "separating the parameter name and type",
# "RT01", # "No Returns section found",
# "RT02", # "The first line of the Returns section should contain only the "
# "type, unless multiple values are being returned",
# "RT03", # "Return value has no description",
# "RT04", # "Return value description should start with a capital letter",
# "RT05", # 'Return value description should finish with "."',
"YD01", # "No Yields section found",
# "SA01", # "See Also section not found",
"SA02", # "Missing period at end of description for See Also "
# '"{reference_name}" reference',
"SA03", # "Description should be capitalized for See Also "
# '"{reference_name}" reference',
"SA04", # 'Missing description for See Also "{reference_name}" reference',
# "EX01", # "No examples section found",
]


override_SS05 = [ # override SS05 to allow docstrings starting with these words
# '^Process ',
# '^Assess ',
# '^Access ',
]
14 changes: 8 additions & 6 deletions src/ansys/mapdl/core/_commands/apdl/parameter_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -518,13 +518,15 @@ def parres(self, lab="", fname="", ext="", **kwargs):
>>> mapdl.parres('parm.PARM')
"""
if ext:
fname = fname + "." + ext
elif not fname:
fname = "." + "PARM"
if not fname:
fname = self.jobname

if "Grpc" in self.__class__.__name__: # grpc mode
if self._local:
fname = self._get_file_name(
fname=fname, ext=ext, default_extension="parm"
) # Although documentation says `PARM`

if self._mode == "grpc": # grpc mode
if self.is_local:
# It must be a file!
if os.path.isfile(fname):
# And it exist!
Expand Down
5 changes: 4 additions & 1 deletion src/ansys/mapdl/core/_commands/aux12_/radiosity_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ def hemiopt(self, hres="", **kwargs):
hres
Hemicube resolution. Increase value to increase the accuracy of
the view factor calculation. Defaults to 10.
tolerance
Tolerance value that controls whether or not facets are subdivided in view factor calculations to increase view factor accuracy. TOLERANCE is closely related to the spacing between facets. Defaults to 1e-6.
"""
command = f"HEMIOPT,{hres}"
command = f"HEMIOPT,{hres},{tolerance}"
return self.run(command, **kwargs)

def radopt(
Expand Down
29 changes: 17 additions & 12 deletions src/ansys/mapdl/core/_commands/post1_/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,6 +1748,7 @@ def prcamp(
stabval="",
keyallfreq="",
keynegfreq="",
keywhirl="",
**kwargs,
):
"""Prints Campbell diagram data for applications involving rotating
Expand All @@ -1768,19 +1769,18 @@ def prcamp(
slope
The slope of the line to be printed. This value must be positive.
SLOPE > 0 - The line represents the number of excitations per revolution of the rotor. For
example, SLOPE = 1 represents one excitation per
revolution, usually resulting from unbalance.
SLOPE > 0 - The line represents the number of excitations per
revolution of the rotor. For example, SLOPE = 1 represents one
excitation per revolution, usually resulting from unbalance.
SLOPE = 0 - The line represents the stability threshold for stability values or logarithmic
decrements printout (STABVAL = 1 or 2)
SLOPE = 0 - The line represents the stability threshold for stability
values or logarithmic decrements printout (STABVAL = 1 or 2)
unit
Specifies the unit of measurement for rotational angular
velocities:
RDS - Rotational angular velocities in radians per second (rad/s). This value is the
default.
RDS - Rotational angular velocities in radians per second (rad/s). This value is the default.
RPM - Rotational angular velocities in revolutions per minute (RPMs).
Expand All @@ -1794,8 +1794,8 @@ def prcamp(
stabval
Flag to print the stability values:
0 (OFF or NO) - Print the frequencies (the imaginary parts of the eigenvalues in Hz). This
value is the default.
0 (OFF or NO) - Print the frequencies (the imaginary parts of the
eigenvalues in Hz). This value is the default.
1 (ON or YES) - Print the stability values (the real parts of the eigenvalues in Hz).
Expand All @@ -1804,9 +1804,8 @@ def prcamp(
keyallfreq
Key to specify if all frequencies above FREQB are printed out:
0 (OFF or NO) - A maximum of 10 frequencies are printed out. They correspond to the frequencies
displayed via the PLCAMP command. This value is the
default.
0 (OFF or NO) - A maximum of 10 frequencies are printed out. They
correspond to the frequencies displayed via the PLCAMP command. This value is the default.
1 (ON or YES) - All frequencies are printed out.
Expand All @@ -1819,6 +1818,12 @@ def prcamp(
1 (ON or YES) - Negative and positive frequencies are printed out.
keywhirl
Flag to print the whirl and instability keys for each load step:
0 (OFF or NO) - Print the whirl for the last load step. This value is the default.
1 (ON or YES) - Print the whirl and instability keys for each load step.
Notes
-----
The following items are required when generating a Campbell diagram:
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/post26_/special.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ def rpsd(
See POST26 - Response Power Spectral Density in the Mechanical APDL
Theory Reference for more information on these equations.
"""
command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},{signif}"
command = f"RPSD,{ir},{ia},{ib},{itype},{datum},{name},,{signif}"
return self.run(command, **kwargs)

def smooth(
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/_commands/preproc/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -1241,7 +1241,7 @@ def eplot(self, **kwargs):
APDL Command: EPLOT
Notes
------
-----
Produces an element display of the selected elements. In full
graphics, only those elements faces with all of their corresponding
nodes selected are plotted. In PowerGraphics, all element faces of the selected
Expand Down
Loading

0 comments on commit 1d6968a

Please sign in to comment.