From f8956a4f5bd671421c42127283e11939d48a4f43 Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 3 Dec 2024 09:55:23 -0600 Subject: [PATCH 1/4] remove unused code --- src/ansys/mechanical/core/mechanical.py | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/ansys/mechanical/core/mechanical.py b/src/ansys/mechanical/core/mechanical.py index 55c7bc5fd..7471f3851 100644 --- a/src/ansys/mechanical/core/mechanical.py +++ b/src/ansys/mechanical/core/mechanical.py @@ -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' @@ -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 From 60b5816e709b5562c437213e4aaaa15d3fc9cbab Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 3 Dec 2024 10:01:39 -0600 Subject: [PATCH 2/4] update change default mechanical path test --- src/ansys/mechanical/core/__init__.py | 1 + tests/test_mechanical.py | 1 + 2 files changed, 2 insertions(+) diff --git a/src/ansys/mechanical/core/__init__.py b/src/ansys/mechanical/core/__init__.py index d96a539db..3bd50c57b 100644 --- a/src/ansys/mechanical/core/__init__.py +++ b/src/ansys/mechanical/core/__init__.py @@ -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, diff --git a/tests/test_mechanical.py b/tests/test_mechanical.py index c07ac9e1d..92551bb59 100644 --- a/tests/test_mechanical.py +++ b/tests/test_mechanical.py @@ -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) From 98acba3b983274659b75b24b479f04e1c70fcb0b Mon Sep 17 00:00:00 2001 From: pyansys-ci-bot <92810346+pyansys-ci-bot@users.noreply.github.com> Date: Tue, 3 Dec 2024 16:10:41 +0000 Subject: [PATCH 3/4] chore: adding changelog file 994.maintenance.md [dependabot-skip] --- doc/changelog.d/994.maintenance.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 doc/changelog.d/994.maintenance.md diff --git a/doc/changelog.d/994.maintenance.md b/doc/changelog.d/994.maintenance.md new file mode 100644 index 000000000..4d88562c0 --- /dev/null +++ b/doc/changelog.d/994.maintenance.md @@ -0,0 +1 @@ +Remove unused code and add tests \ No newline at end of file From 3b12d4a878bed624990fc8a3fcc83c495664ecea Mon Sep 17 00:00:00 2001 From: dkunhamb Date: Tue, 3 Dec 2024 11:26:13 -0600 Subject: [PATCH 4/4] update code cov --- .github/codecov.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/codecov.yml b/.github/codecov.yml index 2be9e4adf..b036d3a7a 100644 --- a/.github/codecov.yml +++ b/.github/codecov.yml @@ -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 \ No newline at end of file