From 9d4433267903bc4c5dc9e981b1d8dfd23a4ab89f Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Thu, 3 Oct 2024 08:46:25 -0500 Subject: [PATCH 01/42] adding whatsnew.rst --- doc/source/index.rst | 4 ++-- doc/source/whatsnew.rst | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 doc/source/whatsnew.rst diff --git a/doc/source/index.rst b/doc/source/index.rst index 73478d69e..42a7d002e 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -14,7 +14,6 @@ :width: 580px :align: center - Python API to interact with `Ansys Mechanical`_ (FEA software for structural engineering) from **2023R2** and later versions. .. grid:: 3 @@ -118,4 +117,5 @@ Python API to interact with `Ansys Mechanical`_ (FEA software for structural eng contributing kil/index faq - changelog \ No newline at end of file + changelog + whatsnew \ No newline at end of file diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst new file mode 100644 index 000000000..09e6580fa --- /dev/null +++ b/doc/source/whatsnew.rst @@ -0,0 +1,39 @@ +.. _ref_whatsnew: + +What's new +========== + +Discover the latest updates in PyMechanical, including new features, +performance enhancements, and bug fixes designed to improve your experience. + +v0.11.x +------- + +Launch GUI +^^^^^^^^^^ + +Open the project files with Mechanical GUI. + +.. code:: python + + launch_gui() + +Opens up the saved ``.mechdb`` or ``.mechdat`` files. + +Visualize geometry in 3D +^^^^^^^^^^^^^^^^^^^^^^^^ + +Visualize imported geometry in 3D. This feature is available only from 24R1 or later. + +.. code:: python + + import ansys.mechanical.core as mech + from ansys.mechanical.core.examples import delete_downloads, download_file + + app = mech.App(version=242) + app.update_globals(globals()) + + # Import the geometry + + # visualize + app.plot() From 8cf817e30cc38d9e71e547bd2ad8ac945769e3e9 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Thu, 10 Oct 2024 08:59:50 +0200 Subject: [PATCH 02/42] feat: add html and sphinx event --- doc/source/_templates/whatsnew_sidebar.html | 62 +++++++++++++++++++++ doc/source/conf.py | 36 ++++++++++-- doc/source/whatsnew.rst | 4 ++ 3 files changed, 98 insertions(+), 4 deletions(-) create mode 100644 doc/source/_templates/whatsnew_sidebar.html diff --git a/doc/source/_templates/whatsnew_sidebar.html b/doc/source/_templates/whatsnew_sidebar.html new file mode 100644 index 000000000..054134862 --- /dev/null +++ b/doc/source/_templates/whatsnew_sidebar.html @@ -0,0 +1,62 @@ +
+

What's New

+
    + {% for whatsnew in whatsnew_content %} + {{ whatsnew }} + {% set title = whatsnew.get('title') %} + {% set url = whatsnew.get('url') %} + {% set children = whatsnew.get('children') %} +
  • + {{ title }} + +
  • + {% endfor %} +
+
+ + + \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 3d403f2f8..c6a8e73d6 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -207,10 +207,10 @@ "icon": "fa fa-comment fa-fw", }, ], - "cheatsheet": { - "file": "cheatsheet/cheat_sheet.qmd", - "title": "PyMechanical cheat sheet", - }, + # "cheatsheet": { + # "file": "cheatsheet/cheat_sheet.qmd", + # "title": "PyMechanical cheat sheet", + # }, "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, "navigation_depth": 10, } @@ -224,6 +224,7 @@ "changelog": [], "examples/index": [], "contributing": [], + "index": ["sidebar-nav-bs.html", "whatsnew_sidebar.html"], } html_show_sourcelink = False @@ -314,3 +315,30 @@ linkcheck_ignore.append( f"https://github.com/ansys/pymechanical/releases/tag/v{pymechanical.__version__}" ) + + +from docutils import nodes + +def add_whatsnew(app, pagename, templatename, context, doctree): + """Add what's new section to the context.""" + if pagename != "whatsnew": + return + + docs_content = doctree.traverse(nodes.section) + + for docs_content in docs_content: + contents = { + "title": docs_content[0].astext(), + "children": docs_content.traverse(nodes.paragraph)[0].astext(), + "url": "", + } + yield contents if contents["title"].startswith("v0") else None + + # filter the whatsnew content, only take the title strat with v0 * + # whats_new_content = [content for content in whats_new_content if content["title"].startswith("v0")] + print(contents) + # context["whatsnew_content"] = whats_new_content + + +def setup(app): + app.connect("html-page-context", add_whatsnew) \ No newline at end of file diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 09e6580fa..d0aa79498 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -20,6 +20,10 @@ Open the project files with Mechanical GUI. Opens up the saved ``.mechdb`` or ``.mechdat`` files. + +v0.10.x +------- + Visualize geometry in 3D ^^^^^^^^^^^^^^^^^^^^^^^^ From 14ac8e6f48f3b320d3baaa542140b453c2c91b1d Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 15 Oct 2024 10:45:42 +0200 Subject: [PATCH 03/42] fix: update the conf file --- doc/source/_templates/whatsnew_sidebar.html | 62 --------------------- doc/source/conf.py | 42 ++++---------- pyproject.toml | 2 +- 3 files changed, 11 insertions(+), 95 deletions(-) delete mode 100644 doc/source/_templates/whatsnew_sidebar.html diff --git a/doc/source/_templates/whatsnew_sidebar.html b/doc/source/_templates/whatsnew_sidebar.html deleted file mode 100644 index 054134862..000000000 --- a/doc/source/_templates/whatsnew_sidebar.html +++ /dev/null @@ -1,62 +0,0 @@ -
-

What's New

-
    - {% for whatsnew in whatsnew_content %} - {{ whatsnew }} - {% set title = whatsnew.get('title') %} - {% set url = whatsnew.get('url') %} - {% set children = whatsnew.get('children') %} -
  • - {{ title }} - -
  • - {% endfor %} -
-
- - - \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index c6a8e73d6..c4ccc9899 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -183,6 +183,7 @@ "github_repo": "pymechanical", "github_version": "main", "doc_path": "doc/source", + # "whatsnew": [{'title': 'v0.11.x', 'children': 'Open the project files with Mechanical GUI.', 'url': ''}, {'title': 'v0.10.x', 'children': 'Visualize imported geometry in 3D. This feature is available only from 24R1 or later.', 'url': ''}] } html_theme_options = { "logo": "pyansys", @@ -207,12 +208,16 @@ "icon": "fa fa-comment fa-fw", }, ], - # "cheatsheet": { - # "file": "cheatsheet/cheat_sheet.qmd", - # "title": "PyMechanical cheat sheet", - # }, + "cheatsheet": { + "file": "cheatsheet/cheat_sheet.qmd", + "title": "PyMechanical cheat sheet", + }, "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, "navigation_depth": 10, + "whatsnew": { + "file": "whatsnew", + "pages": ["index"], + } } # -- Options for HTMLHelp output --------------------------------------------- @@ -224,7 +229,7 @@ "changelog": [], "examples/index": [], "contributing": [], - "index": ["sidebar-nav-bs.html", "whatsnew_sidebar.html"], + "index": ["sidebar-nav-bs.html"], } html_show_sourcelink = False @@ -315,30 +320,3 @@ linkcheck_ignore.append( f"https://github.com/ansys/pymechanical/releases/tag/v{pymechanical.__version__}" ) - - -from docutils import nodes - -def add_whatsnew(app, pagename, templatename, context, doctree): - """Add what's new section to the context.""" - if pagename != "whatsnew": - return - - docs_content = doctree.traverse(nodes.section) - - for docs_content in docs_content: - contents = { - "title": docs_content[0].astext(), - "children": docs_content.traverse(nodes.paragraph)[0].astext(), - "url": "", - } - yield contents if contents["title"].startswith("v0") else None - - # filter the whatsnew content, only take the title strat with v0 * - # whats_new_content = [content for content in whats_new_content if content["title"].startswith("v0")] - print(contents) - # context["whatsnew_content"] = whats_new_content - - -def setup(app): - app.connect("html-page-context", add_whatsnew) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5da7fc68b..b2282e896 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ tests = [ ] doc = [ "sphinx==8.0.2", - "ansys-sphinx-theme[autoapi]==1.1.2", + "ansys-sphinx-theme[autoapi] @ git+https://github.com/ansys/ansys-sphinx-theme.git@fix/whatsnew", "grpcio==1.66.2", "imageio-ffmpeg==0.5.1", "imageio==2.35.1", From 8f8c1a679d88935a714e3d9a99554a4fa725ed29 Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:47:24 +0200 Subject: [PATCH 04/42] fix: Update doc/source/conf.py --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c4ccc9899..f3523da98 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -183,7 +183,6 @@ "github_repo": "pymechanical", "github_version": "main", "doc_path": "doc/source", - # "whatsnew": [{'title': 'v0.11.x', 'children': 'Open the project files with Mechanical GUI.', 'url': ''}, {'title': 'v0.10.x', 'children': 'Visualize imported geometry in 3D. This feature is available only from 24R1 or later.', 'url': ''}] } html_theme_options = { "logo": "pyansys", From f476255bb81bfeb5119289e1f284ae77c8999cbc Mon Sep 17 00:00:00 2001 From: Revathy Venugopal <104772255+Revathyvenugopal162@users.noreply.github.com> Date: Tue, 15 Oct 2024 10:48:01 +0200 Subject: [PATCH 05/42] fix: remove unused sidebar --- doc/source/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index f3523da98..15531a66f 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -228,7 +228,6 @@ "changelog": [], "examples/index": [], "contributing": [], - "index": ["sidebar-nav-bs.html"], } html_show_sourcelink = False From 65a359b5c31f11c79079587db14d0a15ec22ca36 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:48:53 +0000 Subject: [PATCH 06/42] chore: auto fixes from pre-commit hooks --- doc/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 15531a66f..50b33ab54 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -216,7 +216,7 @@ "whatsnew": { "file": "whatsnew", "pages": ["index"], - } + }, } # -- Options for HTMLHelp output --------------------------------------------- From 1c9706b8f488df60a3f844b177c0049e6860ee40 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:50:15 +0000 Subject: [PATCH 07/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/945.added.md diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md new file mode 100644 index 000000000..462ce19c0 --- /dev/null +++ b/doc/changelog.d/945.added.md @@ -0,0 +1 @@ +add whats new section \ No newline at end of file From eb5b0086652637db354257e52a95b1e8a79af378 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:50:28 +0000 Subject: [PATCH 08/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From 30faa52d5a5d72e81797b51e041d3fbe1c68eb81 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:51:43 +0000 Subject: [PATCH 09/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From 02cd39d9f64d8493bd51b49e6ecbb16d98dc4682 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:52:03 +0000 Subject: [PATCH 10/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From 0645cb33c06ac1af6bab2c89145becf54191b7d9 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:53:29 +0000 Subject: [PATCH 11/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From 6d6b3dfd5f4b57a5947f7da0b1f2c1f20a54c370 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:55:23 +0000 Subject: [PATCH 12/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From ae91c0cb067ea5a7672d8d46ecbc93d11b7cc45c Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:56:35 +0000 Subject: [PATCH 13/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From 8dad6a5950d4fca755523e07627c9c90f1b95a6c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 08:59:34 +0000 Subject: [PATCH 14/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From eff8a1545d4e8b3504715ab02306a9a08c9b7822 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:00:38 +0000 Subject: [PATCH 15/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From c97bbfcf3e709973c721b4f174a7afae90e19de1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:01:06 +0000 Subject: [PATCH 16/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From 6ebf95989188a801fca328acd34edb45969c9f84 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:02:12 +0000 Subject: [PATCH 17/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From a42c57880fdca282485ff31699bccbe2ddc06e34 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:03:47 +0000 Subject: [PATCH 18/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From 470379506a3df9a44eaec5613f349dd74c1cb78d Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:04:47 +0000 Subject: [PATCH 19/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..462ce19c0 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add whats new section \ No newline at end of file From 86efa2829d2742a4fdeca55456d2a3cc51cb79cd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:04:59 +0000 Subject: [PATCH 20/42] chore: auto fixes from pre-commit hooks --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 462ce19c0..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add whats new section \ No newline at end of file +add what's new section \ No newline at end of file From 6ed5d60dfda232ae47b5b3d717e342b29bc37bd4 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:06:54 +0000 Subject: [PATCH 21/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index 3e8462150..fcc44ffdf 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what's new section \ No newline at end of file +add what is new section \ No newline at end of file From 6d134367cd6d4778e87e759de1608100e1479991 Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 15 Oct 2024 09:22:14 +0000 Subject: [PATCH 22/42] chore: adding changelog file 945.added.md [dependabot-skip] --- doc/changelog.d/945.added.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/changelog.d/945.added.md b/doc/changelog.d/945.added.md index fcc44ffdf..3e8462150 100644 --- a/doc/changelog.d/945.added.md +++ b/doc/changelog.d/945.added.md @@ -1 +1 @@ -add what is new section \ No newline at end of file +add what's new section \ No newline at end of file From 494924ef3d9db534ba2d2970ac890f287977d9a0 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 15 Oct 2024 16:16:35 +0200 Subject: [PATCH 23/42] fix: update the conf file --- doc/source/conf.py | 2 +- doc/source/whatsnew.rst | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index c4ccc9899..88b22a19b 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -216,7 +216,7 @@ "navigation_depth": 10, "whatsnew": { "file": "whatsnew", - "pages": ["index"], + "pages": ["index", "changelog"], } } diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index d0aa79498..7edc095cc 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -20,6 +20,17 @@ Open the project files with Mechanical GUI. Opens up the saved ``.mechdb`` or ``.mechdat`` files. +Launch GUI with a specific project file +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Open the project files with Mechanical GUI. + +.. code:: python + + launch_gui('path/to/project.mechdb') + +Opens up the specified project file. + v0.10.x ------- @@ -41,3 +52,21 @@ Visualize imported geometry in 3D. This feature is available only from 24R1 or l # visualize app.plot() + +v0.9.x +------- + +Visualize imported geometry in 3D. This feature is available only from 24R1 or later. + +.. code:: python + + import ansys.mechanical.core as mech + from ansys.mechanical.core.examples import delete_downloads, download_file + + app = mech.App(version=242) + app.update_globals(globals()) + + # Import the geometry + + # visualize + app.plot() \ No newline at end of file From 6929fe4a79e67fffbe57defdc1551534d5f614c0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 14:17:28 +0000 Subject: [PATCH 24/42] chore: auto fixes from pre-commit hooks --- doc/source/whatsnew.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 7edc095cc..8b4bebdd4 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -27,7 +27,7 @@ Open the project files with Mechanical GUI. .. code:: python - launch_gui('path/to/project.mechdb') + launch_gui("path/to/project.mechdb") Opens up the specified project file. From 5a3b5f1c431d049105ea819b812e9c913819dc9c Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Wed, 16 Oct 2024 13:12:42 -0500 Subject: [PATCH 25/42] update whatsnew --- doc/source/whatsnew.rst | 53 ++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 24 deletions(-) diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 8b4bebdd4..68c7690db 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -12,56 +12,61 @@ v0.11.x Launch GUI ^^^^^^^^^^ -Open the project files with Mechanical GUI. +Open the current project with Mechanical GUI. .. code:: python - launch_gui() + from ansys.mechanical.core import App + app = App() + app.save() + app.launch_gui() -Opens up the saved ``.mechdb`` or ``.mechdat`` files. +Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. +The files are deleted when GUI is closed . For more info check +`launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function -Launch GUI with a specific project file -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -Open the project files with Mechanical GUI. +Opens up the specified project file. .. code:: python launch_gui("path/to/project.mechdb") -Opens up the specified project file. - - -v0.10.x -------- +Prints Mechanical project tree +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Visualize geometry in 3D -^^^^^^^^^^^^^^^^^^^^^^^^ - -Visualize imported geometry in 3D. This feature is available only from 24R1 or later. +This feature let you see the heirachial Mechanical project tree. +It also shows whether an object is supressed or not. .. code:: python import ansys.mechanical.core as mech - from ansys.mechanical.core.examples import delete_downloads, download_file - - app = mech.App(version=242) + app = mech.App() app.update_globals(globals()) + app.print_tree() - # Import the geometry +.. code:: shell - # visualize - app.plot() + ... ├── Project + ... | ├── Model + ... | | ├── Geometry Imports + ... | | ├── Geometry + ... | | ├── Materials + ... | | ├── Coordinate Systems + ... | | | ├── Global Coordinate System + ... | | ├── Remote Points + ... | | ├── Mesh -v0.9.x +v0.10.x ------- +Visualize geometry in 3D +^^^^^^^^^^^^^^^^^^^^^^^^ + Visualize imported geometry in 3D. This feature is available only from 24R1 or later. .. code:: python import ansys.mechanical.core as mech - from ansys.mechanical.core.examples import delete_downloads, download_file app = mech.App(version=242) app.update_globals(globals()) From 78477ed49d7e64848397a8b2545d3389cb09fe83 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 18:13:08 +0000 Subject: [PATCH 26/42] chore: auto fixes from pre-commit hooks --- doc/source/whatsnew.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst index 68c7690db..cbc606b07 100644 --- a/doc/source/whatsnew.rst +++ b/doc/source/whatsnew.rst @@ -12,11 +12,12 @@ v0.11.x Launch GUI ^^^^^^^^^^ -Open the current project with Mechanical GUI. +Open the current project with Mechanical GUI. .. code:: python from ansys.mechanical.core import App + app = App() app.save() app.launch_gui() @@ -35,11 +36,12 @@ Prints Mechanical project tree ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This feature let you see the heirachial Mechanical project tree. -It also shows whether an object is supressed or not. +It also shows whether an object is suppressed or not. .. code:: python import ansys.mechanical.core as mech + app = mech.App() app.update_globals(globals()) app.print_tree() From 9658fc13b987dc0a2e4a1e2e083f6ba92bc4d398 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Mon, 4 Nov 2024 17:33:41 +0100 Subject: [PATCH 27/42] fix: crier new section --- pyproject.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index ca2aba808..316c6ef68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -184,6 +184,15 @@ directory = "miscellaneous" name = "Miscellaneous" showcontent = true +[[tool.towncrier.type]] +directory = "whatsnew" +name = "Whatsnew" +showcontent = true + +[[tool.towncrier.section]] +name = "Whatsnew" +path = "whatsnew" + # ======================================================== # Flake8 Configuration # ======================================================== From 21751afd33f4b2e1f8872611c11a718ced34b80e Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Tue, 5 Nov 2024 17:47:07 +0100 Subject: [PATCH 28/42] fix: add tabs --- doc/changelog.d/changelog_template.jinja | 14 +++++++++++--- doc/changelog.d/whatsnew/whatsnew.md | 22 ++++++++++++++++++++++ doc/source/changelog.rst | 5 +++++ 3 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 doc/changelog.d/whatsnew/whatsnew.md diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index a346bcd9d..6cef85b0f 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -1,13 +1,21 @@ {% if sections[""] %} {% for category, val in definitions.items() if category in sections[""] %} + .. tab-item:: {{ definitions[category]['name'] }} + + .. list-table:: + :header-rows: 0 + :widths: auto + + {%- for text, values in sections[""][category].items() %} + * - {{ text }} + - {{ values|join(', ') }} + {%- endfor %} + {{ definitions[category]['name'] }} {% set underline = '^' * definitions[category]['name']|length %} {{ underline }} -{% for text, values in sections[""][category].items() %} -- {{ text }} {{ values|join(', ') }} -{% endfor %} {% endfor %} {% else %} diff --git a/doc/changelog.d/whatsnew/whatsnew.md b/doc/changelog.d/whatsnew/whatsnew.md new file mode 100644 index 000000000..ee81b2446 --- /dev/null +++ b/doc/changelog.d/whatsnew/whatsnew.md @@ -0,0 +1,22 @@ +Launch GUI +^^^^^^^^^^ + +Open the current project with Mechanical GUI. + +.. code:: python + + from ansys.mechanical.core import App + + app = App() + app.save() + app.launch_gui() + +Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. +The files are deleted when GUI is closed . For more info check +`launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function + +Opens up the specified project file. + +.. code:: python + + launch_gui("path/to/project.mechdb") \ No newline at end of file diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 7ed78e521..e3ea437a1 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -9,6 +9,11 @@ This document contains the release notes for the project. .. towncrier release notes start +`1.3.0 `_ - 2024-11-05 +================================================================================= +No significant changes. + + `0.11.7 `_ - 2024-08-29 =================================================================================== From ff49e295e5a7378b395bf11fea3d4d939417d69c Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 6 Nov 2024 10:54:42 +0100 Subject: [PATCH 29/42] fix: add whatsnew --- doc/changelog.d/changelog_template.jinja | 32 +++++++++++++------ .../whatsnew/{whatsnew.md => 123.whatsnew.md} | 1 - pyproject.toml | 4 +++ 3 files changed, 26 insertions(+), 11 deletions(-) rename doc/changelog.d/whatsnew/{whatsnew.md => 123.whatsnew.md} (97%) diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index 6cef85b0f..73f124f05 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -1,25 +1,37 @@ {% if sections[""] %} +.. tab-set:: {% for category, val in definitions.items() if category in sections[""] %} - .. tab-item:: {{ definitions[category]['name'] }} .. list-table:: :header-rows: 0 :widths: auto - {%- for text, values in sections[""][category].items() %} - * - {{ text }} - - {{ values|join(', ') }} - {%- endfor %} - -{{ definitions[category]['name'] }} -{% set underline = '^' * definitions[category]['name']|length %} -{{ underline }} + {% for text, values in sections[""][category].items() %} + * - {{ text|indent(12) }} + - {{ values|join(', ')|indent(12) }} + + {% endfor %} {% endfor %} + {% else %} No significant changes. -{% endif %} \ No newline at end of file +{% endif %} + +{% if sections["Whatsnew"] %} +{% for category, val in sections["Whatsnew"].items() %} +{{ category }} +{% set underline = '-' * category|length %} +{{ underline }} +{% for text, values in val.items() %} +{{ text|indent }} +{% endfor %} +{% endfor %} + +{% endif %} + + diff --git a/doc/changelog.d/whatsnew/whatsnew.md b/doc/changelog.d/whatsnew/123.whatsnew.md similarity index 97% rename from doc/changelog.d/whatsnew/whatsnew.md rename to doc/changelog.d/whatsnew/123.whatsnew.md index ee81b2446..5b877c52b 100644 --- a/doc/changelog.d/whatsnew/whatsnew.md +++ b/doc/changelog.d/whatsnew/123.whatsnew.md @@ -1,5 +1,4 @@ Launch GUI -^^^^^^^^^^ Open the current project with Mechanical GUI. diff --git a/pyproject.toml b/pyproject.toml index 316c6ef68..3e5cf2f59 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -189,6 +189,10 @@ directory = "whatsnew" name = "Whatsnew" showcontent = true +[[tool.towncrier.section]] +name = "" +path = "" + [[tool.towncrier.section]] name = "Whatsnew" path = "whatsnew" From 0bbbc5cb5623509dc6d2e9e9b9758c448468fbfb Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 6 Nov 2024 11:47:39 +0100 Subject: [PATCH 30/42] fix: update the libs --- doc/changelog.d/changelog_template.jinja | 26 +-- doc/changelog.d/whatsnew/123.whatsnew.md | 2 +- doc/changelog.d/whatsnew/456.whatsnew.md | 12 ++ doc/source/changelog.rst | 215 +++++++++++++++++++++++ pyproject.toml | 2 +- 5 files changed, 242 insertions(+), 15 deletions(-) create mode 100644 doc/changelog.d/whatsnew/456.whatsnew.md diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index 73f124f05..5ff433b34 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -1,3 +1,16 @@ +{% if sections["Whatsnew"] %} +{% for category, val in sections["Whatsnew"].items() -%} +{{ category }} +{% set underline = '-' * category|length %} +{{ underline }} +{% for text, _ in val.items() %} + +{{ text|trim() }} + +{% endfor %} +{% endfor %} +{% endif %} + {% if sections[""] %} .. tab-set:: {% for category, val in definitions.items() if category in sections[""] %} @@ -22,16 +35,3 @@ No significant changes. {% endif %} -{% if sections["Whatsnew"] %} -{% for category, val in sections["Whatsnew"].items() %} -{{ category }} -{% set underline = '-' * category|length %} -{{ underline }} -{% for text, values in val.items() %} -{{ text|indent }} -{% endfor %} -{% endfor %} - -{% endif %} - - diff --git a/doc/changelog.d/whatsnew/123.whatsnew.md b/doc/changelog.d/whatsnew/123.whatsnew.md index 5b877c52b..cd895c207 100644 --- a/doc/changelog.d/whatsnew/123.whatsnew.md +++ b/doc/changelog.d/whatsnew/123.whatsnew.md @@ -1,5 +1,5 @@ Launch GUI - +^^^^^^^^^^ Open the current project with Mechanical GUI. .. code:: python diff --git a/doc/changelog.d/whatsnew/456.whatsnew.md b/doc/changelog.d/whatsnew/456.whatsnew.md new file mode 100644 index 000000000..210d24e45 --- /dev/null +++ b/doc/changelog.d/whatsnew/456.whatsnew.md @@ -0,0 +1,12 @@ +Prints Mechanical project tree +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +This feature let you see the heirachial Mechanical project tree. +It also shows whether an object is suppressed or not. + +.. code:: python + + import ansys.mechanical.core as mech + + app = mech.App() + app.update_globals(globals()) + app.print_tree() diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index e3ea437a1..93343eacd 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -9,6 +9,221 @@ This document contains the release notes for the project. .. towncrier release notes start +Version `v0.12.0 `_ (2024-11-06) +============================================================================================= +whatsnew +-------- + +Launch GUI + ^^^^^^^^^^ + Open the current project with Mechanical GUI. + + .. code:: python + + from ansys.mechanical.core import App + + app = App() + app.save() + app.launch_gui() + + Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. + The files are deleted when GUI is closed . For more info check + `launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function + + Opens up the specified project file. + + .. code:: python + + launch_gui("path/to/project.mechdb") + + +Prints Mechanical project tree + ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + This feature let you see the heirachial Mechanical project tree. + It also shows whether an object is suppressed or not. + + .. code:: python + + import ansys.mechanical.core as mech + + app = mech.App() + app.update_globals(globals()) + app.print_tree() + + +.. tab-set:: + .. tab-item:: Added + + .. list-table:: + :header-rows: 0 + :widths: auto + + + * - launch_gui command + - `#882 `_ + + + * - Add method to execute script from file for embedding + - `#902 `_ + + + * - add warning for x11 loaded before init on 25.1+ + - `#909 `_ + + + * - `ansys-mechanical-ideconfig` command + - `#935 `_ + + + * - Automatically update pre-commit ci PR with prefix + - `#936 `_ + + + * - add what's new section + - `#945 `_ + + + .. tab-item:: Fixed + + .. list-table:: + :header-rows: 0 + :widths: auto + + + * - Update ``execute_script`` method + - `#894 `_ + + + * - Adapting braking change for upload action + - `#895 `_ + + + * - Remove Python class reference. + - `#901 `_ + + + * - documentation links + - `#911 `_ + + + * - Throw value error for unsupported version of Mechanical + - `#917 `_ + + + * - Use "lite" CLR host on windows for 251+ + - `#920 `_ + + + * - update AUTHORS file + - `#929 `_ + + + * - Warning for multiple version + - `#942 `_ + + + .. tab-item:: Miscellaneous + + .. list-table:: + :header-rows: 0 + :widths: auto + + + * - use embedding clr host in version 251 + - `#926 `_ + + + .. tab-item:: Documentation + + .. list-table:: + :header-rows: 0 + :widths: auto + + + * - remove ``thispagetitle`` metatag + - `#897 `_ + + + .. tab-item:: Maintenance + + .. list-table:: + :header-rows: 0 + :widths: auto + + + * - Add vulnerability check + - `#709 `_ + + + * - update CHANGELOG for v0.11.7 + - `#889 `_ + + + * - Bump grpcio from 1.66.0 to 1.66.1 in the core group + - `#891 `_ + + + * - Bump the doc group with 2 updates + - `#892 `_ + + + * - Bump pytest-print from 1.0.0 to 1.0.1 in the tests group + - `#898 `_ + + + * - Bump the doc group with 4 updates + - `#899 `_, `#907 `_, `#916 `_ + + + * - Drop python 3.9 + - `#904 `_ + + + * - Bump pytest from 8.3.2 to 8.3.3 in the tests group + - `#906 `_ + + + * - Remove unnecessary dependencies + - `#908 `_ + + + * - Bump ansys-mechanical-env from 0.1.7 to 0.1.8 in the core group + - `#914 `_ + + + * - Bump pytest-print from 1.0.1 to 1.0.2 in the tests group + - `#915 `_ + + + * - Bump grpcio from 1.66.1 to 1.66.2 in the core group + - `#922 `_ + + + * - Bump panel from 1.5.0 to 1.5.1 in the doc group + - `#923 `_ + + + * - Use static search + - `#927 `_ + + + * - Bump the doc group with 5 updates + - `#933 `_, `#943 `_ + + + * - pre-commit autoupdate + - `#934 `_ + + + * - Code maintenance + - `#937 `_ + + + * - pre-commit automatic update + - `#944 `_ + + + `1.3.0 `_ - 2024-11-05 ================================================================================= No significant changes. diff --git a/pyproject.toml b/pyproject.toml index 3e5cf2f59..b61bddfcf 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -156,7 +156,7 @@ directory = "doc/changelog.d" filename = "doc/source/changelog.rst" start_string = ".. towncrier release notes start\n" template = "doc/changelog.d/changelog_template.jinja" -title_format = "`{version} `_ - {project_date}" +title_format = "Version `{version} `_ ({project_date})" issue_format = "`#{issue} `_" [[tool.towncrier.type]] From 1c939e040d6846e48fb71260240b7f3301e2e56a Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 6 Nov 2024 13:54:42 +0100 Subject: [PATCH 31/42] fix: add whatsnew section --- doc/source/changelog.rst | 220 --------------------------------------- 1 file changed, 220 deletions(-) diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 93343eacd..7ed78e521 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -9,226 +9,6 @@ This document contains the release notes for the project. .. towncrier release notes start -Version `v0.12.0 `_ (2024-11-06) -============================================================================================= -whatsnew --------- - -Launch GUI - ^^^^^^^^^^ - Open the current project with Mechanical GUI. - - .. code:: python - - from ansys.mechanical.core import App - - app = App() - app.save() - app.launch_gui() - - Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. - The files are deleted when GUI is closed . For more info check - `launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function - - Opens up the specified project file. - - .. code:: python - - launch_gui("path/to/project.mechdb") - - -Prints Mechanical project tree - ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - This feature let you see the heirachial Mechanical project tree. - It also shows whether an object is suppressed or not. - - .. code:: python - - import ansys.mechanical.core as mech - - app = mech.App() - app.update_globals(globals()) - app.print_tree() - - -.. tab-set:: - .. tab-item:: Added - - .. list-table:: - :header-rows: 0 - :widths: auto - - - * - launch_gui command - - `#882 `_ - - - * - Add method to execute script from file for embedding - - `#902 `_ - - - * - add warning for x11 loaded before init on 25.1+ - - `#909 `_ - - - * - `ansys-mechanical-ideconfig` command - - `#935 `_ - - - * - Automatically update pre-commit ci PR with prefix - - `#936 `_ - - - * - add what's new section - - `#945 `_ - - - .. tab-item:: Fixed - - .. list-table:: - :header-rows: 0 - :widths: auto - - - * - Update ``execute_script`` method - - `#894 `_ - - - * - Adapting braking change for upload action - - `#895 `_ - - - * - Remove Python class reference. - - `#901 `_ - - - * - documentation links - - `#911 `_ - - - * - Throw value error for unsupported version of Mechanical - - `#917 `_ - - - * - Use "lite" CLR host on windows for 251+ - - `#920 `_ - - - * - update AUTHORS file - - `#929 `_ - - - * - Warning for multiple version - - `#942 `_ - - - .. tab-item:: Miscellaneous - - .. list-table:: - :header-rows: 0 - :widths: auto - - - * - use embedding clr host in version 251 - - `#926 `_ - - - .. tab-item:: Documentation - - .. list-table:: - :header-rows: 0 - :widths: auto - - - * - remove ``thispagetitle`` metatag - - `#897 `_ - - - .. tab-item:: Maintenance - - .. list-table:: - :header-rows: 0 - :widths: auto - - - * - Add vulnerability check - - `#709 `_ - - - * - update CHANGELOG for v0.11.7 - - `#889 `_ - - - * - Bump grpcio from 1.66.0 to 1.66.1 in the core group - - `#891 `_ - - - * - Bump the doc group with 2 updates - - `#892 `_ - - - * - Bump pytest-print from 1.0.0 to 1.0.1 in the tests group - - `#898 `_ - - - * - Bump the doc group with 4 updates - - `#899 `_, `#907 `_, `#916 `_ - - - * - Drop python 3.9 - - `#904 `_ - - - * - Bump pytest from 8.3.2 to 8.3.3 in the tests group - - `#906 `_ - - - * - Remove unnecessary dependencies - - `#908 `_ - - - * - Bump ansys-mechanical-env from 0.1.7 to 0.1.8 in the core group - - `#914 `_ - - - * - Bump pytest-print from 1.0.1 to 1.0.2 in the tests group - - `#915 `_ - - - * - Bump grpcio from 1.66.1 to 1.66.2 in the core group - - `#922 `_ - - - * - Bump panel from 1.5.0 to 1.5.1 in the doc group - - `#923 `_ - - - * - Use static search - - `#927 `_ - - - * - Bump the doc group with 5 updates - - `#933 `_, `#943 `_ - - - * - pre-commit autoupdate - - `#934 `_ - - - * - Code maintenance - - `#937 `_ - - - * - pre-commit automatic update - - `#944 `_ - - - -`1.3.0 `_ - 2024-11-05 -================================================================================= -No significant changes. - - `0.11.7 `_ - 2024-08-29 =================================================================================== From 0753f8a1ba17ce235c1ba169d3a3696113dc0556 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 6 Nov 2024 16:22:52 +0100 Subject: [PATCH 32/42] fix: add changelog --- doc/changelog.d/changelog_template.jinja | 41 ++++++++++++++++++------ pyproject.toml | 6 ++-- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index 5ff433b34..b2039d19c 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -1,17 +1,41 @@ +{% set ns = namespace(references=[]) %} {% if sections["Whatsnew"] %} -{% for category, val in sections["Whatsnew"].items() -%} -{{ category }} -{% set underline = '-' * category|length %} -{{ underline }} -{% for text, _ in val.items() %} + {% for category, val in sections["Whatsnew"].items() %} + {% if definitions.get(category) and definitions[category].get('name') %} + {% set ns.references = ns.references + [definitions[category]['name']] %} + {% endif %} + {% endfor %} +{% endif %} -{{ text|trim() }} +{% if sections.get("") %} + {% set ns.references = ns.references + ["Changelog"] %} +{% endif %} +{% if ns.references %} -{% endfor %} +{% for reference in ns.references %} +- `{{ reference }}`_ {% endfor %} {% endif %} -{% if sections[""] %} +{% if sections["Whatsnew"] %} + {%- for category, val in sections["Whatsnew"].items() %} + {%- if definitions.get(category) and definitions[category].get('name') -%} +{{ definitions[category]['name'] }} +{{ "~" * definitions[category]['name']|length }} + {% endif %} + {% for text, values in sections["Whatsnew"][category].items() %} + +{{ text }} + + {% endfor %} + {%- endfor %} +{% endif %} + +{% if sections[""] %}- + +Changelog +--------- + .. tab-set:: {% for category, val in definitions.items() if category in sections[""] %} .. tab-item:: {{ definitions[category]['name'] }} @@ -34,4 +58,3 @@ No significant changes. {% endif %} - diff --git a/pyproject.toml b/pyproject.toml index b61bddfcf..65b65c844 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -161,17 +161,17 @@ issue_format = "`#{issue} `_ [[tool.towncrier.type]] directory = "added" -name = "Added" +name = "Features" showcontent = true [[tool.towncrier.type]] directory = "changed" -name = "Changed" +name = "Deprecated and Changed" showcontent = true [[tool.towncrier.type]] directory = "fixed" -name = "Fixed" +name = "Bug fixes" showcontent = true [[tool.towncrier.type]] From 13586c6d12b0ff3ecee596bea8fe712eb4de31f4 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Fri, 8 Nov 2024 16:39:38 +0100 Subject: [PATCH 33/42] fix: files --- doc/changelog.d/changelog_template.jinja | 54 ++++++------------- .../{123.whatsnew.md => 123.whatsnew.rst} | 2 +- .../{456.whatsnew.md => 456.whatsnew.rst} | 6 +-- doc/source/conf.py | 8 +-- pyproject.toml | 1 + 5 files changed, 24 insertions(+), 47 deletions(-) rename doc/changelog.d/whatsnew/{123.whatsnew.md => 123.whatsnew.rst} (97%) rename doc/changelog.d/whatsnew/{456.whatsnew.md => 456.whatsnew.rst} (63%) diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index b2039d19c..cc79160e0 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -1,60 +1,36 @@ -{% set ns = namespace(references=[]) %} {% if sections["Whatsnew"] %} - {% for category, val in sections["Whatsnew"].items() %} - {% if definitions.get(category) and definitions[category].get('name') %} - {% set ns.references = ns.references + [definitions[category]['name']] %} - {% endif %} - {% endfor %} -{% endif %} - -{% if sections.get("") %} - {% set ns.references = ns.references + ["Changelog"] %} -{% endif %} -{% if ns.references %} - -{% for reference in ns.references %} -- `{{ reference }}`_ -{% endfor %} -{% endif %} - -{% if sections["Whatsnew"] %} - {%- for category, val in sections["Whatsnew"].items() %} - {%- if definitions.get(category) and definitions[category].get('name') -%} + {%+ for category, val in sections["Whatsnew"].items() +%} + {%+ if definitions.get(category) and definitions[category].get('name') +%} {{ definitions[category]['name'] }} {{ "~" * definitions[category]['name']|length }} {% endif %} - {% for text, values in sections["Whatsnew"][category].items() %} + {%- for text, values in sections["Whatsnew"][category].items() %} {{ text }} - {% endfor %} - {%- endfor %} + {% endfor -%} + {% endfor %} {% endif %} -{% if sections[""] %}- +{% if sections[""] %} Changelog --------- .. tab-set:: -{% for category, val in definitions.items() if category in sections[""] %} + {%+ for category, val in definitions.items() if category in sections[""] +%} .. tab-item:: {{ definitions[category]['name'] }} - .. list-table:: - :header-rows: 0 - :widths: auto - - {% for text, values in sections[""][category].items() %} - - * - {{ text|indent(12) }} - - {{ values|join(', ')|indent(12) }} - - {% endfor %} + .. list-table:: + :header-rows: 0 + :widths: auto -{% endfor %} + {%+ for text, values in sections[""][category].items() +%} + * - {{ text }} + - {{ values|join(', ') }} + {% endfor %} + {% endfor %} {% else %} No significant changes. - - {% endif %} diff --git a/doc/changelog.d/whatsnew/123.whatsnew.md b/doc/changelog.d/whatsnew/123.whatsnew.rst similarity index 97% rename from doc/changelog.d/whatsnew/123.whatsnew.md rename to doc/changelog.d/whatsnew/123.whatsnew.rst index cd895c207..c177772ef 100644 --- a/doc/changelog.d/whatsnew/123.whatsnew.md +++ b/doc/changelog.d/whatsnew/123.whatsnew.rst @@ -1,5 +1,5 @@ Launch GUI -^^^^^^^^^^ +---------- Open the current project with Mechanical GUI. .. code:: python diff --git a/doc/changelog.d/whatsnew/456.whatsnew.md b/doc/changelog.d/whatsnew/456.whatsnew.rst similarity index 63% rename from doc/changelog.d/whatsnew/456.whatsnew.md rename to doc/changelog.d/whatsnew/456.whatsnew.rst index 210d24e45..33f7d42cd 100644 --- a/doc/changelog.d/whatsnew/456.whatsnew.md +++ b/doc/changelog.d/whatsnew/456.whatsnew.rst @@ -1,6 +1,6 @@ -Prints Mechanical project tree +Prints mechanical project tree ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This feature let you see the heirachial Mechanical project tree. +This feature let you see the hierarchy of the mechanical project. It also shows whether an object is suppressed or not. .. code:: python @@ -9,4 +9,4 @@ It also shows whether an object is suppressed or not. app = mech.App() app.update_globals(globals()) - app.print_tree() + app.print_tree() \ No newline at end of file diff --git a/doc/source/conf.py b/doc/source/conf.py index 63bbbb61a..614fc8943 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -207,10 +207,10 @@ "icon": "fa fa-comment fa-fw", }, ], - "cheatsheet": { - "file": "cheatsheet/cheat_sheet.qmd", - "title": "PyMechanical cheat sheet", - }, + # "cheatsheet": { + # "file": "cheatsheet/cheat_sheet.qmd", + # "title": "PyMechanical cheat sheet", + # }, "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, "navigation_depth": 10, "whatsnew": { diff --git a/pyproject.toml b/pyproject.toml index 65b65c844..02a249ee9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,6 +158,7 @@ start_string = ".. towncrier release notes start\n" template = "doc/changelog.d/changelog_template.jinja" title_format = "Version `{version} `_ ({project_date})" issue_format = "`#{issue} `_" +all_bullets = false [[tool.towncrier.type]] directory = "added" From 8a269097c255b718b94a2ad8f4c8acf24a8c17ae Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 13 Nov 2024 09:09:57 +0100 Subject: [PATCH 34/42] fix: update the branch --- doc/changelog.d/changelog_template.jinja | 2 +- doc/changelog.d/whatsnew/123.whatsnew.rst | 2 +- doc/source/changelog.rst | 10 ++++++++++ doc/source/conf.py | 4 ++-- doc/source/index.rst | 2 +- pyproject.toml | 4 ++-- 6 files changed, 17 insertions(+), 7 deletions(-) diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja index cc79160e0..4b51b88b9 100644 --- a/doc/changelog.d/changelog_template.jinja +++ b/doc/changelog.d/changelog_template.jinja @@ -2,7 +2,7 @@ {%+ for category, val in sections["Whatsnew"].items() +%} {%+ if definitions.get(category) and definitions[category].get('name') +%} {{ definitions[category]['name'] }} -{{ "~" * definitions[category]['name']|length }} +{{ "-" * definitions[category]['name']|length }} {% endif %} {%- for text, values in sections["Whatsnew"][category].items() %} diff --git a/doc/changelog.d/whatsnew/123.whatsnew.rst b/doc/changelog.d/whatsnew/123.whatsnew.rst index c177772ef..cd895c207 100644 --- a/doc/changelog.d/whatsnew/123.whatsnew.rst +++ b/doc/changelog.d/whatsnew/123.whatsnew.rst @@ -1,5 +1,5 @@ Launch GUI ----------- +^^^^^^^^^^ Open the current project with Mechanical GUI. .. code:: python diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index 7ed78e521..c9e0bc85f 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -1,5 +1,15 @@ +:orphan: + .. _ref_release_notes: +.. button-ref:: release-note + :ref-type: doc + :color: primary + :shadow: + :expand: + + Go to new release notes + Release notes ############# diff --git a/doc/source/conf.py b/doc/source/conf.py index 614fc8943..ec612f76d 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -214,8 +214,8 @@ "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, "navigation_depth": 10, "whatsnew": { - "file": "whatsnew", - "pages": ["index", "changelog"], + "file": "release-note", + "pages": ["index", "release-note"], }, } diff --git a/doc/source/index.rst b/doc/source/index.rst index 42a7d002e..aca9c23ef 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -117,5 +117,5 @@ Python API to interact with `Ansys Mechanical`_ (FEA software for structural eng contributing kil/index faq - changelog + release-note whatsnew \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 02a249ee9..511357396 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -55,7 +55,7 @@ tests = [ ] doc = [ "sphinx==8.1.3", - "ansys-sphinx-theme[autoapi] @ git+https://github.com/ansys/ansys-sphinx-theme.git@fix/whatsnew", + "ansys-sphinx-theme[autoapi] @ git+https://github.com/ansys/ansys-sphinx-theme.git@fix/jinja-template-testing", "grpcio==1.66.2", "imageio-ffmpeg==0.5.1", "imageio==2.36.0", @@ -153,7 +153,7 @@ xfail_strict = true [tool.towncrier] package = "ansys.mechanical.core" directory = "doc/changelog.d" -filename = "doc/source/changelog.rst" +filename = "doc/source/release-note.rst" start_string = ".. towncrier release notes start\n" template = "doc/changelog.d/changelog_template.jinja" title_format = "Version `{version} `_ ({project_date})" From 5d9ae030bfe153b2c2b16eb0dc7fbb2e2c5c3ee4 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 13 Nov 2024 12:14:03 +0100 Subject: [PATCH 35/42] fix: us the reusable jinja template --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 092803c36..12a2b161f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -158,7 +158,7 @@ package = "ansys.mechanical.core" directory = "doc/changelog.d" filename = "doc/source/release-note.rst" start_string = ".. towncrier release notes start\n" -template = "doc/changelog.d/changelog_template.jinja" +template = "ansys_sphinx_theme:changelog_template.jinja" title_format = "Version `{version} `_ ({project_date})" issue_format = "`#{issue} `_" all_bullets = false From 68585773922ed14b446782f4c87d3ff44a0d4215 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Wed, 13 Nov 2024 12:14:42 +0100 Subject: [PATCH 36/42] fix: delete the changelog file --- doc/changelog.d/changelog_template.jinja | 36 ------------------------ 1 file changed, 36 deletions(-) delete mode 100644 doc/changelog.d/changelog_template.jinja diff --git a/doc/changelog.d/changelog_template.jinja b/doc/changelog.d/changelog_template.jinja deleted file mode 100644 index 4b51b88b9..000000000 --- a/doc/changelog.d/changelog_template.jinja +++ /dev/null @@ -1,36 +0,0 @@ -{% if sections["Whatsnew"] %} - {%+ for category, val in sections["Whatsnew"].items() +%} - {%+ if definitions.get(category) and definitions[category].get('name') +%} -{{ definitions[category]['name'] }} -{{ "-" * definitions[category]['name']|length }} - {% endif %} - {%- for text, values in sections["Whatsnew"][category].items() %} - -{{ text }} - - {% endfor -%} - {% endfor %} -{% endif %} - -{% if sections[""] %} - -Changelog ---------- - -.. tab-set:: - {%+ for category, val in definitions.items() if category in sections[""] +%} - .. tab-item:: {{ definitions[category]['name'] }} - - .. list-table:: - :header-rows: 0 - :widths: auto - - {%+ for text, values in sections[""][category].items() +%} - * - {{ text }} - - {{ values|join(', ') }} - {% endfor %} - {% endfor %} - -{% else %} -No significant changes. -{% endif %} From bf9bd267e2ae7e680f53a7b22aecee1ce00aac45 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Fri, 17 Jan 2025 13:43:03 -0500 Subject: [PATCH 37/42] test most recent what's new development --- doc/changelog.d/whatsnew/123.whatsnew.rst | 21 ---- doc/changelog.d/whatsnew/456.whatsnew.rst | 12 --- doc/source/changelog.rst | 10 -- doc/source/conf.py | 11 +- doc/source/index.rst | 3 +- doc/source/whatsnew.rst | 79 -------------- doc/source/whatsnew.yml | 120 ++++++++++++++++++++++ pyproject.toml | 38 +++---- 8 files changed, 141 insertions(+), 153 deletions(-) delete mode 100644 doc/changelog.d/whatsnew/123.whatsnew.rst delete mode 100644 doc/changelog.d/whatsnew/456.whatsnew.rst delete mode 100644 doc/source/whatsnew.rst create mode 100644 doc/source/whatsnew.yml diff --git a/doc/changelog.d/whatsnew/123.whatsnew.rst b/doc/changelog.d/whatsnew/123.whatsnew.rst deleted file mode 100644 index cd895c207..000000000 --- a/doc/changelog.d/whatsnew/123.whatsnew.rst +++ /dev/null @@ -1,21 +0,0 @@ -Launch GUI -^^^^^^^^^^ -Open the current project with Mechanical GUI. - -.. code:: python - - from ansys.mechanical.core import App - - app = App() - app.save() - app.launch_gui() - -Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. -The files are deleted when GUI is closed . For more info check -`launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function - -Opens up the specified project file. - -.. code:: python - - launch_gui("path/to/project.mechdb") \ No newline at end of file diff --git a/doc/changelog.d/whatsnew/456.whatsnew.rst b/doc/changelog.d/whatsnew/456.whatsnew.rst deleted file mode 100644 index 33f7d42cd..000000000 --- a/doc/changelog.d/whatsnew/456.whatsnew.rst +++ /dev/null @@ -1,12 +0,0 @@ -Prints mechanical project tree -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -This feature let you see the hierarchy of the mechanical project. -It also shows whether an object is suppressed or not. - -.. code:: python - - import ansys.mechanical.core as mech - - app = mech.App() - app.update_globals(globals()) - app.print_tree() \ No newline at end of file diff --git a/doc/source/changelog.rst b/doc/source/changelog.rst index f20b16c18..16da79bd5 100644 --- a/doc/source/changelog.rst +++ b/doc/source/changelog.rst @@ -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 ############# diff --git a/doc/source/conf.py b/doc/source/conf.py index ec612f76d..6df994c9e 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -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"], }, } diff --git a/doc/source/index.rst b/doc/source/index.rst index 46b2fbc0d..7a98a82df 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -117,5 +117,4 @@ Python API to interact with `Ansys Mechanical`_ (FEA software for structural eng contributing kil/index faq - release-note - whatsnew \ No newline at end of file + changelog \ No newline at end of file diff --git a/doc/source/whatsnew.rst b/doc/source/whatsnew.rst deleted file mode 100644 index cbc606b07..000000000 --- a/doc/source/whatsnew.rst +++ /dev/null @@ -1,79 +0,0 @@ -.. _ref_whatsnew: - -What's new -========== - -Discover the latest updates in PyMechanical, including new features, -performance enhancements, and bug fixes designed to improve your experience. - -v0.11.x -------- - -Launch GUI -^^^^^^^^^^ - -Open the current project with Mechanical GUI. - -.. code:: python - - from ansys.mechanical.core import App - - app = App() - app.save() - app.launch_gui() - -Above code opens up the temporarily saved ``.mechdb`` or ``.mechdat`` files. -The files are deleted when GUI is closed . For more info check -`launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function - -Opens up the specified project file. - -.. code:: python - - launch_gui("path/to/project.mechdb") - -Prints Mechanical project tree -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - -This feature let you see the heirachial Mechanical project tree. -It also shows whether an object is suppressed or not. - -.. code:: python - - import ansys.mechanical.core as mech - - app = mech.App() - app.update_globals(globals()) - app.print_tree() - -.. code:: shell - - ... ├── Project - ... | ├── Model - ... | | ├── Geometry Imports - ... | | ├── Geometry - ... | | ├── Materials - ... | | ├── Coordinate Systems - ... | | | ├── Global Coordinate System - ... | | ├── Remote Points - ... | | ├── Mesh - -v0.10.x -------- - -Visualize geometry in 3D -^^^^^^^^^^^^^^^^^^^^^^^^ - -Visualize imported geometry in 3D. This feature is available only from 24R1 or later. - -.. code:: python - - import ansys.mechanical.core as mech - - app = mech.App(version=242) - app.update_globals(globals()) - - # Import the geometry - - # visualize - app.plot() \ No newline at end of file diff --git a/doc/source/whatsnew.yml b/doc/source/whatsnew.yml new file mode 100644 index 000000000..0ab04fec3 --- /dev/null +++ b/doc/source/whatsnew.yml @@ -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() \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a6a5a8dbb..c645784ad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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} `_ ({project_date})" +title_format = "`{version} `_ - {project_date}" issue_format = "`#{issue} `_" all_bullets = false @@ -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 # ======================================================== @@ -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 +""" \ No newline at end of file From 08e62439705cd5273065ea040533df12c74888f9 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Fri, 17 Jan 2025 14:17:11 -0500 Subject: [PATCH 38/42] use doc-changelog branch that installs ansys-sphinx-theme --- .github/workflows/label.yml | 208 ++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 104 deletions(-) diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml index a7c82ab2c..1044bb077 100644 --- a/.github/workflows/label.yml +++ b/.github/workflows/label.yml @@ -1,104 +1,104 @@ -name: Labeler -on: - pull_request: - # opened, reopened, and synchronize are default for pull_request - # edited - when PR title or body is changed - # labeled - when labels are added to PR - types: [opened, reopened, synchronize, edited, labeled] - push: - branches: [ main ] - paths: - - '../labels.yml' - -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - - label-syncer: - name: Syncer - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: micnncim/action-label-syncer@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - labeler: - name: Set labels - needs: [label-syncer] - permissions: - contents: read - pull-requests: write - runs-on: ubuntu-latest - steps: - - # Label based on modified files - - name: Label based on changed files - uses: actions/labeler@v5 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - sync-labels: false - - # Label based on branch name - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'doc') || - startsWith(github.event.pull_request.head.ref, 'docs') - with: - labels: documentation - - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'maint') || - startsWith(github.event.pull_request.head.ref, 'no-ci') || - startsWith(github.event.pull_request.head.ref, 'ci') - with: - labels: maintenance - - - uses: actions-ecosystem/action-add-labels@v1 - if: startsWith(github.event.pull_request.head.ref, 'feat') - with: - labels: | - enhancement - - - uses: actions-ecosystem/action-add-labels@v1 - if: | - startsWith(github.event.pull_request.head.ref, 'fix') || - startsWith(github.event.pull_request.head.ref, 'patch') - with: - labels: bug - - commenter: - runs-on: ubuntu-latest - steps: - - name: Suggest to add labels - uses: peter-evans/create-or-update-comment@v4 - # Execute only when no labels have been applied to the pull request - if: toJSON(github.event.pull_request.labels.*.name) == '{}' - with: - issue-number: ${{ github.event.pull_request.number }} - body: | - Please add one of the following labels to add this contribution to the Release Notes :point_down: - - [bug](https://github.com/ansys/pymechanical/pulls?q=label%3Abug+) - - [documentation](https://github.com/ansys/pymechanical/pulls?q=label%3Adocumentation+) - - [enhancement](https://github.com/ansys/pymechanical/pulls?q=label%3Aenhancement+) - - [good first issue](https://github.com/ansys/pymechanical/pulls?q=label%3Agood+first+issue) - - [maintenance](https://github.com/ansys/pymechanical/pulls?q=label%3Amaintenance+) - - [release](https://github.com/ansys/pymechanical/pulls?q=label%3Arelease+) - - changelog-fragment: - name: "Create changelog fragment" - needs: [labeler] - permissions: - contents: write - pull-requests: write - runs-on: ubuntu-latest - steps: - - uses: ansys/actions/doc-changelog@v8 - with: - token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} - use-conventional-commits: true - bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} - bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} +name: Labeler +on: + pull_request: + # opened, reopened, and synchronize are default for pull_request + # edited - when PR title or body is changed + # labeled - when labels are added to PR + types: [opened, reopened, synchronize, edited, labeled] + push: + branches: [ main ] + paths: + - '../labels.yml' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + + label-syncer: + name: Syncer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: micnncim/action-label-syncer@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + labeler: + name: Set labels + needs: [label-syncer] + permissions: + contents: read + pull-requests: write + runs-on: ubuntu-latest + steps: + + # Label based on modified files + - name: Label based on changed files + uses: actions/labeler@v5 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + sync-labels: false + + # Label based on branch name + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'doc') || + startsWith(github.event.pull_request.head.ref, 'docs') + with: + labels: documentation + + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'maint') || + startsWith(github.event.pull_request.head.ref, 'no-ci') || + startsWith(github.event.pull_request.head.ref, 'ci') + with: + labels: maintenance + + - uses: actions-ecosystem/action-add-labels@v1 + if: startsWith(github.event.pull_request.head.ref, 'feat') + with: + labels: | + enhancement + + - uses: actions-ecosystem/action-add-labels@v1 + if: | + startsWith(github.event.pull_request.head.ref, 'fix') || + startsWith(github.event.pull_request.head.ref, 'patch') + with: + labels: bug + + commenter: + runs-on: ubuntu-latest + steps: + - name: Suggest to add labels + uses: peter-evans/create-or-update-comment@v4 + # Execute only when no labels have been applied to the pull request + if: toJSON(github.event.pull_request.labels.*.name) == '{}' + with: + issue-number: ${{ github.event.pull_request.number }} + body: | + Please add one of the following labels to add this contribution to the Release Notes :point_down: + - [bug](https://github.com/ansys/pymechanical/pulls?q=label%3Abug+) + - [documentation](https://github.com/ansys/pymechanical/pulls?q=label%3Adocumentation+) + - [enhancement](https://github.com/ansys/pymechanical/pulls?q=label%3Aenhancement+) + - [good first issue](https://github.com/ansys/pymechanical/pulls?q=label%3Agood+first+issue) + - [maintenance](https://github.com/ansys/pymechanical/pulls?q=label%3Amaintenance+) + - [release](https://github.com/ansys/pymechanical/pulls?q=label%3Arelease+) + + changelog-fragment: + name: "Create changelog fragment" + needs: [labeler] + permissions: + contents: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - uses: ansys/actions/doc-changelog@feat/changelog-sphinx-theme-jinja-template + with: + token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }} + use-conventional-commits: true + bot-user: ${{ secrets.PYANSYS_CI_BOT_USERNAME }} + bot-email: ${{ secrets.PYANSYS_CI_BOT_EMAIL }} From 7a2d1279d2eb211ec6e39eb9119550e8893d606b Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Fri, 17 Jan 2025 16:05:49 -0500 Subject: [PATCH 39/42] update whatsnew.yml --- doc/source/whatsnew.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew.yml b/doc/source/whatsnew.yml index 0ab04fec3..9fe03a140 100644 --- a/doc/source/whatsnew.yml +++ b/doc/source/whatsnew.yml @@ -3,9 +3,9 @@ fragments: - title: Launch GUI version: 0.11.8 content: | - The `launch_gui() <../api/ansys/mechanical/core/embedding/launch_gui/index.html>`_ function + The `launch_gui() `_ function graphically launches the current state of the embedded instance when the - `App <../api/ansys/mechanical/core/embedding/app/App.html>`_ has been saved. + `App `_ 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. From ef20462ed8eb3a799067833965cbbbbab307fa84 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Mon, 20 Jan 2025 14:32:35 -0500 Subject: [PATCH 40/42] ignore building example --- doc/source/conf.py | 55 ++++++++++++++++++++++++++-------------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 6df994c9e..3799acd20 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -13,13 +13,15 @@ import warnings from ansys_sphinx_theme import ansys_favicon, get_version_match -from sphinx_gallery.sorting import FileNameSortKey import ansys.mechanical.core as pymechanical from ansys.mechanical.core.embedding.initializer import SUPPORTED_MECHANICAL_EMBEDDING_VERSIONS +# from sphinx_gallery.sorting import FileNameSortKey + + # necessary when building the sphinx gallery -pymechanical.BUILDING_GALLERY = True +# pymechanical.BUILDING_GALLERY = False # True # suppress annoying matplotlib bug warnings.filterwarnings( @@ -57,7 +59,7 @@ "sphinx_autodoc_typehints", "sphinx_copybutton", "sphinx_design", - "sphinx_gallery.gen_gallery", + # "sphinx_gallery.gen_gallery", "sphinxemoji.sphinxemoji", ] @@ -153,27 +155,27 @@ copybutton_prompt_is_regexp = True # -- Sphinx Gallery Options --------------------------------------------------- -sphinx_gallery_conf = { - # convert rst to md for ipynb - "pypandoc": True, - # path to your examples scripts - "examples_dirs": ["../../examples/"], - # path where to save gallery generated examples - "gallery_dirs": ["examples/gallery_examples"], - # Pattern to search for example files - "filename_pattern": r"\.py", - # Remove the "Download all examples" button from the top level gallery - "download_all_examples": False, - # Sort gallery example by file name instead of number of lines (default) - "within_subsection_order": FileNameSortKey, - # directory where function granular galleries are stored - "backreferences_dir": None, - # Modules for which function level galleries are created. In - "doc_module": "ansys-mechanical-core", - "image_scrapers": ("matplotlib"), - "ignore_pattern": "flycheck*", - "thumbnail_size": (350, 350), -} +# sphinx_gallery_conf = { +# # convert rst to md for ipynb +# "pypandoc": True, +# # path to your examples scripts +# "examples_dirs": ["../../examples/"], +# # path where to save gallery generated examples +# "gallery_dirs": ["examples/gallery_examples"], +# # Pattern to search for example files +# "filename_pattern": r"\.py", +# # Remove the "Download all examples" button from the top level gallery +# "download_all_examples": False, +# # Sort gallery example by file name instead of number of lines (default) +# "within_subsection_order": FileNameSortKey, +# # directory where function granular galleries are stored +# "backreferences_dir": None, +# # Modules for which function level galleries are created. In +# "doc_module": "ansys-mechanical-core", +# "image_scrapers": ("matplotlib"), +# "ignore_pattern": "flycheck*", +# "thumbnail_size": (350, 350), +# } # -- Options for HTML output ------------------------------------------------- html_short_title = html_title = "PyMechanical" @@ -183,6 +185,11 @@ "github_repo": "pymechanical", "github_version": "main", "doc_path": "doc/source", + # "page_assets": { + # "examples/table": { + # "needs_datatables": True, + # }, + # }, } html_theme_options = { "logo": "pyansys", From 7681e63cc3e25702cca62f5a55e08417a9ea6341 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Mon, 20 Jan 2025 15:50:53 -0500 Subject: [PATCH 41/42] updates --- .pre-commit-config.yaml | 2 +- doc/source/user_guide_session/index.rst | 1 - src/ansys/mechanical/core/embedding/imports.py | 4 ++-- src/ansys/mechanical/core/run.py | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index d3867dab0..bd89d4df5 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,7 +41,7 @@ repos: args: ["--ignore-words", "doc/styles/config/vocabularies/ANSYS/accept.txt", "-w"] - repo: https://github.com/ansys/pre-commit-hooks - rev: v0.4.4 + rev: v0.5.1 hooks: - id: add-license-headers args: diff --git a/doc/source/user_guide_session/index.rst b/doc/source/user_guide_session/index.rst index 1c088fb34..f8955207e 100644 --- a/doc/source/user_guide_session/index.rst +++ b/doc/source/user_guide_session/index.rst @@ -16,7 +16,6 @@ to a remote Mechanical session. self server-launcher - mechanical pool Overview diff --git a/src/ansys/mechanical/core/embedding/imports.py b/src/ansys/mechanical/core/embedding/imports.py index 60ec3351f..b732b87dd 100644 --- a/src/ansys/mechanical/core/embedding/imports.py +++ b/src/ansys/mechanical/core/embedding/imports.py @@ -101,8 +101,8 @@ class Transaction: # When ansys-pythonnet issue #14 is fixed, this class will b """ A class to speed up bulk user interactions using Ansys ACT Mechanical Transaction. - Example - ------- + Examples + -------- >>> with Transaction() as transaction: ... pass # Perform bulk user interactions here ... diff --git a/src/ansys/mechanical/core/run.py b/src/ansys/mechanical/core/run.py index 70bb3569a..4a9f30804 100644 --- a/src/ansys/mechanical/core/run.py +++ b/src/ansys/mechanical/core/run.py @@ -294,8 +294,8 @@ def cli( ): """CLI tool to run mechanical. - USAGE: - + Examples + -------- The following example demonstrates the main use of this tool: $ ansys-mechanical -r 251 -g From 5504dc9fda0f4eef8645340dedf963dd5adee9c2 Mon Sep 17 00:00:00 2001 From: klmcadams <58492561+klmcadams@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:01:59 -0500 Subject: [PATCH 42/42] remove whatsnew --- doc/source/conf.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 3799acd20..5870339da 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -216,13 +216,13 @@ ], "ansys_sphinx_theme_autoapi": {"project": project, "templates": "_templates/autoapi"}, "navigation_depth": 10, - "whatsnew": { - "no_of_headers": 3, - "no_of_contents": 3, - "whatsnew_file": "whatsnew", - "changelog_file": "changelog", - "pages": ["changelog", "index"], - }, + # "whatsnew": { + # "no_of_headers": 3, + # "no_of_contents": 3, + # "whatsnew_file": "whatsnew", + # "changelog_file": "changelog", + # "pages": ["changelog", "index"], + # }, } # -- Options for HTMLHelp output ---------------------------------------------