You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After the discussions occuring on the PyAnsys Dev meeting, we thought it would be important to decouple the usage of graphics from the main installation of our libraries by defining a "graphics" target for that purpose. See ansys/pyansys-dev-guide#577 and ansys/pyansys-dev-guide#576
By doing a quick analysis of the metapackage and using this script where the variable target_package can be easily tweaked... I obtained the following results:
Note
In order to run it, one must:
1 - clone the repo
2 - create a venv and activate it
3 - install the repo: pip install .
4 - install the following: pip install pyvis pipdeptree
importsubprocessimportjsonimportnetworkxasnxfrompyvis.networkimportNetworkdefget_dependency_tree():
result=subprocess.run(["pipdeptree", "--json"], capture_output=True, text=True)
returnjson.loads(result.stdout)
defbuild_reverse_dependency_graph(dependencies, target_package):
graph=nx.DiGraph()
package_map= {pkg["package"]["key"]: pkgforpkgindependencies}
forpkg_name, pkginpackage_map.items():
fordepinpkg.get("dependencies", []):
ifdep["key"] ==target_package:
graph.add_node(pkg_name, label=pkg_name, color="blue")
graph.add_edge(pkg_name, target_package)
returngraphdefvisualize_graph(graph):
net=Network(notebook=True, directed=True, cdn_resources='remote')
net.from_nx(graph)
net.show("dependency_graph.html")
if__name__=="__main__":
target_package="pyvista"# Change this to the package you want to trackdependencies=get_dependency_tree()
graph=build_reverse_dependency_graph(dependencies, target_package)
visualize_graph(graph)
print(f"{len(graph.nodes) -1} packages depend on {target_package}.")
print("Dependency graph generated: Open 'dependency_graph.html' in your browser.")
Visualization shows that only 5 packages depend on it directly:
This means that, only 5 PyAnsys libraries are the ones forcing the installation of PyVista "by default". We should contact each of these repos and push for its separation into a graphics target as described in ansys/pyansys-dev-guide#576
After the discussions occuring on the PyAnsys Dev meeting, we thought it would be important to decouple the usage of graphics from the main installation of our libraries by defining a "graphics" target for that purpose. See ansys/pyansys-dev-guide#577 and ansys/pyansys-dev-guide#576
By doing a quick analysis of the metapackage and using this script where the variable
target_packagecan be easily tweaked... I obtained the following results:Note
In order to run it, one must:
1 - clone the repo
2 - create a venv and activate it
3 - install the repo:
pip install .4 - install the following:
pip install pyvis pipdeptreeVisualization shows that only 5 packages depend on it directly:
The first 4 should be adapted to use the
ansys-tools-visualization-interfacepackage if possible, and make it an optional dependency.Now, after investigating the packages that depend on
ansys-tools-visualization-interface, we get the following list:This means that, only 5 PyAnsys libraries are the ones forcing the installation of PyVista "by default". We should contact each of these repos and push for its separation into a
graphicstarget as described in ansys/pyansys-dev-guide#576