Skip to content

Commit

Permalink
fixed bug in descriptive stats
Browse files Browse the repository at this point in the history
  • Loading branch information
brendapraggastis committed May 11, 2023
1 parent 7b6f087 commit 95f318f
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 95f318f

Please sign in to comment.