Skip to content

Commit

Permalink
feat: add ansys-mechanical-stubs as a dependency (#948)
Browse files Browse the repository at this point in the history
Co-authored-by: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com>
  • Loading branch information
klmcadams and pyansys-ci-bot authored Oct 16, 2024
1 parent baaa546 commit 29ead29
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/948.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
add `ansys-mechanical-stubs` as a dependency
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ classifiers = [
dependencies = [
"ansys-api-mechanical==0.1.2",
"ansys-mechanical-env==0.1.8",
"ansys-mechanical-stubs==0.1.2",
"ansys-platform-instancemanagement>=1.0.1",
"ansys-pythonnet>=3.1.0rc2",
"ansys-tools-path>=0.3.1",
Expand Down
10 changes: 8 additions & 2 deletions src/ansys/mechanical/core/embedding/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
# SOFTWARE.

"""Main application class for embedded Mechanical."""
from __future__ import annotations

import atexit
import os
import typing
Expand All @@ -34,13 +36,17 @@
from ansys.mechanical.core.embedding.ui import launch_ui
from ansys.mechanical.core.embedding.warnings import connect_warnings, disconnect_warnings

if typing.TYPE_CHECKING:
# Make sure to run ``ansys-mechanical-ideconfig`` to add the autocomplete settings to VS Code
# Run ``ansys-mechanical-ideconfig --help`` for more information
import Ansys # pragma: no cover

try:
import ansys.tools.visualization_interface # noqa: F401

HAS_ANSYS_VIZ = True
"""Whether or not PyVista exists."""
except:

HAS_ANSYS_VIZ = False


Expand Down Expand Up @@ -302,7 +308,7 @@ def Tree(self):
return GetterWrapper(self._app, lambda app: app.DataModel.Tree)

@property
def Model(self):
def Model(self) -> Ansys.ACT.Automation.Mechanical.Model:
"""Return the Model object."""
return GetterWrapper(self._app, lambda app: app.DataModel.Project.Model)

Expand Down
6 changes: 3 additions & 3 deletions src/ansys/mechanical/core/ide_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ def _cli_impl(
"--ide",
default="vscode",
type=str,
help="The IDE being used.",
help="The IDE being used. By default, it's ``vscode``.",
)
@click.option(
"--target",
default="user",
type=str,
help="The type of settings to update - either ``user`` or ``workspace`` settings.",
help="The type of settings to update - either ``user`` or ``workspace`` settings in VS Code.",
)
@click.option(
"--revision",
Expand All @@ -151,7 +151,7 @@ def cli(ide: str, target: str, revision: int) -> None:
-----
The following example demonstrates the main use of this tool:
$ ansys-mechanical-ideconfig --ide vscode --location user --revision 242
$ ansys-mechanical-ideconfig --ide vscode --target user --revision 242
"""
exe = atp.get_mechanical_path(allow_input=False, version=revision)
Expand Down

0 comments on commit 29ead29

Please sign in to comment.