Skip to content

Commit

Permalink
test most recent what's new development
Browse files Browse the repository at this point in the history
  • Loading branch information
klmcadams committed Jan 17, 2025
1 parent 8a9c801 commit bf9bd26
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 153 deletions.
21 changes: 0 additions & 21 deletions doc/changelog.d/whatsnew/123.whatsnew.rst

This file was deleted.

12 changes: 0 additions & 12 deletions doc/changelog.d/whatsnew/456.whatsnew.rst

This file was deleted.

10 changes: 0 additions & 10 deletions doc/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
:orphan:

.. _ref_release_notes:

.. button-ref:: release-note
:ref-type: doc
:color: primary
:shadow:
:expand:

Go to new release notes

Release notes
#############

Expand Down
11 changes: 5 additions & 6 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,14 @@
"icon": "fa fa-comment fa-fw",
},
],
# "cheatsheet": {
# "file": "cheatsheet/cheat_sheet.qmd",
# "title": "PyMechanical cheat sheet",
# },
"ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"},
"navigation_depth": 10,
"whatsnew": {
"file": "release-note",
"pages": ["index", "release-note"],
"no_of_headers": 3,
"no_of_contents": 3,
"whatsnew_file": "whatsnew",
"changelog_file": "changelog",
"pages": ["changelog", "index"],
},
}

Expand Down
3 changes: 1 addition & 2 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -117,5 +117,4 @@ Python API to interact with `Ansys Mechanical`_ (FEA software for structural eng
contributing
kil/index
faq
release-note
whatsnew
changelog
79 changes: 0 additions & 79 deletions doc/source/whatsnew.rst

This file was deleted.

120 changes: 120 additions & 0 deletions doc/source/whatsnew.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
fragments:

- title: Launch GUI
version: 0.11.8
content: |
The `launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function
graphically launches the current state of the embedded instance when the
`App <../api/ansys/mechanical/core/embedding/app/App.html>`_ has been saved.
The `launch_gui()` function saves the active `.mechdb` file and creates a copy of the existing
`.mechdb` file with a temporary name. The temporary `.mechdb` file is used to launch the GUI.
By default, the temporary `.mechdb` file is deleted after the GUI is closed, but the user can
specify whether or not to delete the temporary file.
Usage:
.. code:: python
import ansys.mechanical.core as pymechanical
# Initialize and save the app
app = pymechanical.App()
app.save()
# Launch the GUI and delete the temporary `.mechdb` file when the GUI is closed
app.launch_gui()
# Launch the GUI and keep the temporary `.mechdb` file when the GUI is closed
app.launch_gui(delete_tmp_on_close=False)
- title: Autocomplete settings command
version: 0.11.8
content: |
The ``ansys-mechanical-ideconfig`` command prints the settings that are necessary for
autocomplete to work with ``ansys-mechanical-stubs``. This command takes in three arguments:
- ``--ide``: The IDE that you are using. Currently, the only supported IDE is ``vscode``.
- ``--target``: The location of the settings.json file for VS Code. Can be ``user`` or ``workspace``.
- ``--revision``: The revision of the Mechanical stubs that you want to use. If not provided,
``ansys-tools-path`` will retrieve the Mechanical version from your system.
Usage:
.. code:: shell
ansys-mechanical-ideconfig --ide vscode --target user --revision 251
Terminal output for Windows user's settings.json file:
.. code:: shell
Update C:\Users\{username}\AppData\Roaming\Code\User\settings.json with the following information:
{
"python.autoComplete.extraPaths": [
"{project_directory}\\.venv\\Lib\\site-packages\\ansys\\mechanical\\stubs\\v251"
],
"python.analysis.extraPaths": [
"{project_directory}\\.venv\\Lib\\site-packages\\ansys\\mechanical\\stubs\\v251"
]
}
- title: Print the Mechanical project tree
version: 0.11.1
content: |
The `app.print_tree()` function prints the hierarchical tree representation of the
Mechanical project structure and shows whether an object is suppressed or not.
Usage:
.. code:: python
import ansys.mechanical.core as mech
# Initialize the app and update globals
app = mech.App()
app.update_globals(globals())
# Print the entire tree
app.print_tree()
# Print the entire tree but truncate the output after 2 lines
app.print_tree(max_lines=2)
# Print the tree for the Model and truncate after 3 lines
app.print_tree('Model', 3)
Output for `app.print_tree()`:
.. code:: shell
├── Project
| ├── Model
| | ├── Geometry Imports (⚡︎)
| | ├── Geometry (?)
| | ├── Materials (✓)
| | ├── Coordinate Systems (✓)
| | | ├── Global Coordinate System (✓)
| | ├── Remote Points (✓)
| | ├── Mesh (?)
- title: Visualize geometry in 3D
version: 0.11.4
content: |
The `app.plot()` function allows you to visualize imported geometry in 3D. This feature is
available only from 24R1 or later and requires the `ansys-mechanical-core[viz]` dependencies
to be installed:
.. code:: shell
pip install ansys-mechanical-core[viz]
Usage:
.. code:: python
import ansys.mechanical.core as mech
# Initialize the app and update globals
app = mech.App()
app.update_globals(globals())
# Import the geometry
app.open("path/to/file.mechdat")
# Visualize
app.plot()
38 changes: 15 additions & 23 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@ xfail_strict = true
[tool.towncrier]
package = "ansys.mechanical.core"
directory = "doc/changelog.d"
filename = "doc/source/release-note.rst"
filename = "doc/source/changelog.rst"
start_string = ".. towncrier release notes start\n"
template = "ansys_sphinx_theme:changelog_template.jinja"
title_format = "Version `{version} <https://github.com/ansys/pymechanical/releases/tag/v{version}>`_ ({project_date})"
title_format = "`{version} <https://github.com/ansys/pymechanical/releases/tag/v{version}>`_ - {project_date}"
issue_format = "`#{issue} <https://github.com/ansys/pymechanical/pull/{issue}>`_"
all_bullets = false

Expand Down Expand Up @@ -192,18 +192,24 @@ name = "Miscellaneous"
showcontent = true

[[tool.towncrier.type]]
directory = "whatsnew"
name = "Whatsnew"
directory = "documentation"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "maintenance"
name = "Maintenance"
showcontent = true

[[tool.towncrier.type]]
directory = "test"
name = "Test"
showcontent = true

[[tool.towncrier.section]]
name = ""
path = ""

[[tool.towncrier.section]]
name = "Whatsnew"
path = "whatsnew"

# ========================================================
# Flake8 Configuration
# ========================================================
Expand Down Expand Up @@ -276,18 +282,4 @@ passenv = *
extras = doc
commands =
sphinx-build -d "{toxworkdir}/doc_doctree" doc/source "{toxinidir}/doc/_build/html" --color -vW -bhtml
"""
[[tool.towncrier.type]]
directory = "documentation"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "maintenance"
name = "Maintenance"
showcontent = true

[[tool.towncrier.type]]
directory = "test"
name = "Test"
showcontent = true
"""

0 comments on commit bf9bd26

Please sign in to comment.