diff --git a/doc/changelog.d/3573.added.md b/doc/changelog.d/3573.added.md new file mode 100644 index 0000000000..95bbfdd6b4 --- /dev/null +++ b/doc/changelog.d/3573.added.md @@ -0,0 +1 @@ +refactor: replace `get_ansys_path` with `get_mapdl_path` \ No newline at end of file diff --git a/src/ansys/mapdl/core/__init__.py b/src/ansys/mapdl/core/__init__.py index 66eefed548..9ed873482d 100644 --- a/src/ansys/mapdl/core/__init__.py +++ b/src/ansys/mapdl/core/__init__.py @@ -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, ) diff --git a/src/ansys/mapdl/core/launcher.py b/src/ansys/mapdl/core/launcher.py index 8af6f46ec2..3c822611b5 100644 --- a/src/ansys/mapdl/core/launcher.py +++ b/src/ansys/mapdl/core/launcher.py @@ -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) @@ -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") @@ -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: diff --git a/src/ansys/mapdl/core/licensing.py b/src/ansys/mapdl/core/licensing.py index 3ae21047b4..6fd4d8beea 100644 --- a/src/ansys/mapdl/core/licensing.py +++ b/src/ansys/mapdl/core/licensing.py @@ -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" @@ -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: diff --git a/src/ansys/mapdl/core/mapdl_core.py b/src/ansys/mapdl/core/mapdl_core.py index 88eb52fedb..ad21da82f5 100644 --- a/src/ansys/mapdl/core/mapdl_core.py +++ b/src/ansys/mapdl/core/mapdl_core.py @@ -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( @@ -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", "") diff --git a/src/ansys/mapdl/core/pool.py b/src/ansys/mapdl/core/pool.py index c1b7f1204d..40e22ae2b1 100755 --- a/src/ansys/mapdl/core/pool.py +++ b/src/ansys/mapdl/core/pool.py @@ -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 @@ -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"