Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHORE: Remove unused code and add tests #994

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
comment:
layout: "diff"
behavior: default

coverage:
range: 80..100
round: down
precision: 2
status:
project: false
patch:
project:
default:
# basic
target: 90%
if_not_found: success
if_ci_failed: success
if_no_uploads: error
patch: off


codecov:
notify:
wait_for_ci: yes
1 change: 1 addition & 0 deletions doc/changelog.d/994.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Remove unused code and add tests
1 change: 1 addition & 0 deletions src/ansys/mechanical/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
from ansys.mechanical.core._version import __version__
from ansys.mechanical.core.mechanical import (
change_default_mechanical_path,
check_valid_mechanical,
close_all_local_instances,
connect_to_mechanical,
get_mechanical_path,
Expand Down
11 changes: 1 addition & 10 deletions src/ansys/mechanical/core/mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,6 @@ def set_log_level(loglevel):
def get_product_info(self):
"""Get product information by running a script on the Mechanical gRPC server."""

def _get_jscript_product_info_command():
return (
'ExtAPI.Application.ScriptByName("jscript").ExecuteCommand'
'("var productInfo = DS.Script.getProductInfo();returnFromScript(productInfo);")'
)

def _get_python_product_info_command():
return (
'clr.AddReference("Ansys.Mechanical.Application")\n'
Expand All @@ -766,10 +760,7 @@ def _get_python_product_info_command():

try:
self._disable_logging = True
if int(self.version) >= 232:
script = _get_python_product_info_command()
else:
script = _get_jscript_product_info_command()
script = _get_python_product_info_command()
return self.run_python_script(script)
except grpc.RpcError:
raise
Expand Down
1 change: 1 addition & 0 deletions tests/test_mechanical.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ def test_change_default_mechanical_path():
version = ansys.tools.path.version_from_path("mechanical", path)

pymechanical.change_default_mechanical_path(path)
assert pymechanical.check_valid_mechanical() is True

path_new = ansys.tools.path.get_mechanical_path()
version_new = ansys.tools.path.version_from_path("mechanical", path)
Expand Down
Loading