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

Removing unused/deprecated code #268

Merged
merged 1 commit into from
May 30, 2023
Merged
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
56 changes: 0 additions & 56 deletions src/ansys/fluent/visualization/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"""Python post processing integrations for the Fluent solver."""
import platform
import struct
import sys

import pkg_resources

try:
import importlib.metadata as importlib_metadata
Expand All @@ -27,55 +22,4 @@ def version_info() -> str:
return _VERSION_INFO if _VERSION_INFO is not None else __version__


required_libraries = {
"vtk": "9.2.6",
"pyvista": "0.39.0",
"pyvistaqt": "0.7.0",
"pyside6": "6.2.3",
"matplotlib": "3.5.1",
}


installed = {pkg.key for pkg in pkg_resources.working_set}
installed_libraries = [
lib for lib, version in required_libraries.items() if lib in installed
]
missing_libraries = required_libraries.keys() - installed
import_errors = []
if missing_libraries:
import_errors.append(
(f"Required libraries {missing_libraries} " "are missing to use this feature.")
)
for lib in missing_libraries:
import_errors.append(
(
f" Please install {lib} with "
f"`pip install {lib}=={required_libraries[lib]}`."
)
)
if installed_libraries:
versions_mismatched_message = False
for lib in installed_libraries:
required_version = required_libraries[lib]
installed_version = pkg_resources.get_distribution(lib).version
if pkg_resources.parse_version(installed_version) < pkg_resources.parse_version(
required_version
):
if not versions_mismatched_message:
import_errors.append(
(
f"Required libraries version is incompatible "
"to use this feature."
)
)
versions_mismatched_message = True
import_errors.append(
(
f" Please re-install {lib} with "
f"`pip install -I {lib}=={required_libraries[lib]}`."
)
)

if import_errors:
raise ImportError("\n".join(import_errors))
from ansys.fluent.visualization._config import get_config, set_config # noqa: F401