Skip to content

Commit

Permalink
refactor: replace get_ansys_path with get_mapdl_path (#3573)
Browse files Browse the repository at this point in the history
* refactor: replace `get_ansys_path` with `get_mapdl_path`

* chore: adding changelog file 3573.added.md [dependabot-skip]

---------

Co-authored-by: pyansys-ci-bot <[email protected]>
  • Loading branch information
germa89 and pyansys-ci-bot authored Nov 26, 2024
1 parent 4e93bf7 commit aad1006
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions doc/changelog.d/3573.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
refactor: replace `get_ansys_path` with `get_mapdl_path`
2 changes: 1 addition & 1 deletion src/ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,8 @@
from ansys.tools.path.path import (
change_default_ansys_path,
find_mapdl,
get_ansys_path,
get_available_ansys_installations,
get_mapdl_path,
save_ansys_path,
)

Expand Down
6 changes: 3 additions & 3 deletions src/ansys/mapdl/core/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
import ansys.platform.instancemanagement as pypim

if _HAS_ATP:
from ansys.tools.path import find_mapdl, get_ansys_path
from ansys.tools.path import find_mapdl, get_mapdl_path
from ansys.tools.path import version_from_path as _version_from_path

@wraps(_version_from_path)
Expand Down Expand Up @@ -856,7 +856,7 @@ def get_default_ansys_version():

def check_valid_ansys():
"""Checks if a valid version of ANSYS is installed and preconfigured"""
ansys_bin = get_ansys_path(allow_input=False)
ansys_bin = get_mapdl_path(allow_input=False)
if ansys_bin is not None:
version = version_from_path("mapdl", ansys_bin)
return not (version < 170 and os.name != "posix")
Expand Down Expand Up @@ -2358,7 +2358,7 @@ def get_exec_file(args: Dict[str, Any]) -> None:
return

LOG.debug("Using default executable.")
args["exec_file"] = get_ansys_path(version=args.get("version"))
args["exec_file"] = get_mapdl_path(version=args.get("version"))

# Edge case
if args["exec_file"] is None:
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/licensing.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
from ansys.mapdl.core.misc import threaded_daemon

if _HAS_ATP:
from ansys.tools.path import get_ansys_path, version_from_path
from ansys.tools.path import get_mapdl_path, version_from_path

LOCALHOST = "127.0.0.1"
LIC_PATH_ENVAR = "ANSYSLIC_DIR"
Expand Down Expand Up @@ -498,7 +498,7 @@ def get_ansys_license_debug_file_name(): # pragma: no cover
hostname = socket.gethostname()
appname = APP_NAME
# This is the type of license my client requests (Windows 10, 2021R2)
version = version_from_path("mapdl", get_ansys_path(allow_input=False))
version = version_from_path("mapdl", get_mapdl_path(allow_input=False))
ending = "out"

if version < 221:
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/mapdl_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,7 @@ def open_gui(self, include_result=None, inplace=None): # pragma: no cover
>>> mapdl.eplot()
"""
# lazy load here to avoid circular import
from ansys.mapdl.core.launcher import get_ansys_path
from ansys.mapdl.core.launcher import get_mapdl_path

if not self._local:
raise MapdlRuntimeError(
Expand Down Expand Up @@ -1703,7 +1703,7 @@ def open_gui(self, include_result=None, inplace=None): # pragma: no cover
# issue system command to run ansys in GUI mode
cwd = os.getcwd()
os.chdir(run_dir)
exec_file = self._start_parm.get("exec_file", get_ansys_path(allow_input=False))
exec_file = self._start_parm.get("exec_file", get_mapdl_path(allow_input=False))
nproc = self._start_parm.get("nproc", 2)
add_sw = self._start_parm.get("additional_switches", "")

Expand Down
4 changes: 2 additions & 2 deletions src/ansys/mapdl/core/pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
from ansys.mapdl.core.misc import create_temp_dir, threaded, threaded_daemon

if _HAS_ATP:
from ansys.tools.path import get_ansys_path, version_from_path
from ansys.tools.path import get_mapdl_path, version_from_path

if _HAS_TQDM:
from tqdm import tqdm
Expand Down Expand Up @@ -281,7 +281,7 @@ def __init__(

if not exec_file: # get default executable
if _HAS_ATP:
exec_file = get_ansys_path()
exec_file = get_mapdl_path()
else:
raise ValueError(
"Please use 'exec_file' argument to specify the location of the ansys installation.\n"
Expand Down

0 comments on commit aad1006

Please sign in to comment.