Skip to content

Commit

Permalink
Pull request #232: Release/2.4 visualization
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from release/2.4_visualization to develop

* commit '7e915833cb189db49f86ef4654ce19f2331f0216':
  bump: version 2.3.13 → 2.4.0
  fix pre-commit
  add widget
  • Loading branch information
ryandanehy committed Feb 26, 2025
2 parents 2b78b47 + 7e91583 commit adde2be
Show file tree
Hide file tree
Showing 7 changed files with 890 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .cz.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.commitizen]
name = "cz_conventional_commits"
version = "2.3.13"
version = "2.4.0"
version_provider = "poetry"
version_files = [
"pyproject.toml",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import os


__version__ = "2.3.13"
__version__ = "2.4.0"


# If extensions (or modules to document with autodoc) are in another directory,
Expand Down
2 changes: 1 addition & 1 deletion hypernetx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
from hypernetx.utils import *
from hypernetx.utils.toys import *

__version__ = "2.3.13"
__version__ = "2.4.0"
10 changes: 5 additions & 5 deletions hypernetx/drawing/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def get_set_layering(H, collapse=True):

return levels


def layout_with_radius(B, node_and_edge_radius=1, **kwargs):
"""
Convenience function allowing the user to specify ideal radii for nodes and edges in the drawing
Expand All @@ -217,17 +218,16 @@ def layout_with_radius(B, node_and_edge_radius=1, **kwargs):
dict
mapping of node and edge positions to R^2
"""

# get radii encodings and convert to dictionary
radius_dict = dict(zip(B, inflate(B, node_and_edge_radius)))

# edges weights are the sum of the radii of the edge endpoints
for u, v, d in B.edges(data=True):
d['weight'] = radius_dict.get(u, 0) + radius_dict.get(v, 0)
d["weight"] = radius_dict.get(u, 0) + radius_dict.get(v, 0)

# compute all pairs shortest path (APSP)
dist = dict(nx.all_pairs_dijkstra_path_length(B))

# compute and return layout using above APSP; pass through arguments
return nx.kamada_kawai_layout(B, dist=dist, **kwargs)

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "hypernetx"
version = "2.3.13"
version = "2.4.0"
description = "HyperNetX is a Python library for the creation and study of hypergraphs."
authors = ["Brenda Praggastis <[email protected]>", "Dustin Arendt <[email protected]>",
"Sinan Aksoy <[email protected]>", "Emilie Purvine <[email protected]>",
Expand Down
Loading

0 comments on commit adde2be

Please sign in to comment.