Skip to content

Commit

Permalink
Pull request #80: fixed bug in descriptive stats
Browse files Browse the repository at this point in the history
Merge in HYP/hypernetx from bp2 to develop

* commit 'b342aa7a889e086f3cf0c3c1b1862942ae4eaa0d':
  fixed bug in descriptive stats
  • Loading branch information
brendapraggastis authored and bonicim committed May 11, 2023
2 parents bec4791 + b342aa7 commit 84bf38a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions hypernetx/reports/descriptive_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ def degree_dist(H, aggregated=False):
degree_dist : list or dict
List of degrees or dictionary of degree distribution
"""
if H.nwhy:
distr = H.g.node_size_dist()
else:
distr = [H.degree(n) for n in H.nodes]
distr = [H.degree(n) for n in H.nodes]
if aggregated:
return Counter(distr)
else:
Expand Down Expand Up @@ -344,9 +341,9 @@ def dist_stats(H):
dist_stats : dict
Dictionary which keeps track of each of the above items (e.g., basic['nrows'] = the number of nodes in H)
"""
stats = H.state_dict.get("dist_stats", None)
stats = H._state_dict.get("dist_stats", None)
if stats is not None:
return H.state_dict["dist_stats"]
return H._state_dict["dist_stats"]

cstats = ["min", "max", "mean", "median", "std"]
basic = dict()
Expand Down

0 comments on commit 84bf38a

Please sign in to comment.