Skip to content

Commit

Permalink
Core can now always directly call gate as they are always synchronized
Browse files Browse the repository at this point in the history
  • Loading branch information
PProfizi committed Nov 14, 2023
1 parent 40a5ae8 commit e2cbd7c
Showing 1 changed file with 1 addition and 29 deletions.
30 changes: 1 addition & 29 deletions src/ansys/dpf/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,35 +105,7 @@ def _pythonize_awp_version(version):


def _find_latest_ansys_versions():
if hasattr(load_api, "_find_latest_ansys_versions"):
return load_api._find_latest_ansys_versions()
awp_versions = [key[-3:] for key in os.environ.keys() if "AWP_ROOT" in key]
installed_packages_list = {}

for awp_version in awp_versions:
if not awp_version.isnumeric():
continue
ansys_path = os.environ.get("AWP_ROOT" + awp_version)
if ansys_path:
installed_packages_list[
packaging.version.parse(_pythonize_awp_version(awp_version))
] = ansys_path

installed_packages = pkg_resources.working_set
for i in installed_packages:
if "ansys-dpf-server" in i.key:
file_name = pkg_resources.to_filename(i.project_name.replace("ansys-dpf-", ""))
try:
module = importlib.import_module("ansys.dpf." + file_name)
installed_packages_list[
packaging.version.parse(module.__version__)
] = module.__path__[0]
except ModuleNotFoundError:
pass
except AttributeError:
pass
if len(installed_packages_list) > 0:
return installed_packages_list[sorted(installed_packages_list)[-1]]
return load_api._find_latest_ansys_versions()


def find_ansys():
Expand Down

0 comments on commit e2cbd7c

Please sign in to comment.