Skip to content

Commit

Permalink
style: black and isort
Browse files Browse the repository at this point in the history
  • Loading branch information
maximelucas committed Oct 23, 2024
1 parent 34b7f00 commit 525a218
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 16 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@
"installing": [],
"tutorial": [],
"xgi-data": [],
"auto_examples/index" : [],
"auto_examples/index": [],
"gallery": [],
"contribute": [],
"user_guides": [],
Expand Down
3 changes: 2 additions & 1 deletion examples/advanced/plot_colormaps_colorbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -31,4 +32,4 @@
plt.colorbar(node_col, label="Node degree")
plt.colorbar(edge_col, label="Edge size")

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/advanced/plot_labels.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, node_labels=True, node_size=15, hyperedge_labels=True)

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/basic/plot_simple_hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

plt.show()
plt.show()
5 changes: 3 additions & 2 deletions examples/basic/plot_simple_hypergraph_hull.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
H = xgi.Hypergraph(hyperedges)


pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, hull=True)
xgi.draw(H, pos=pos, hull=True)

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/basic/plot_simple_hypergraph_multilayer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
ax3 = plt.axes(projection="3d") # requires a 3d axis
xgi.draw_multilayer(H, ax=ax3)

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/basic/plot_simple_hypergraph_outline.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos, hull=True, edge_fc="white")

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/basic/plot_simple_simplicial_complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.barycenter_spring_layout(H, seed=1)
xgi.draw(H, pos=pos)

plt.show()
plt.show()
1 change: 1 addition & 0 deletions examples/layouts/plot_barycenter_spring_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand Down
3 changes: 2 additions & 1 deletion examples/layouts/plot_simple_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.circular_layout(H)
xgi.draw(H, pos=pos)

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/layouts/plot_spiral_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -16,4 +17,4 @@
pos = xgi.spiral_layout(H)
xgi.draw(H, pos=pos)

plt.show()
plt.show()
3 changes: 2 additions & 1 deletion examples/stats/plot_color_stat.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"""

import matplotlib.pyplot as plt

import xgi

hyperedges = [[1, 2, 3], [3, 4, 5], [3, 6], [6, 7, 8, 9], [1, 4, 10, 11, 12], [1, 4]]
Expand All @@ -25,4 +26,4 @@
node_col, _, edge_col = collections

plt.colorbar(node_col, label="Node degree")
plt.show()
plt.show()
2 changes: 1 addition & 1 deletion tests/stats/test_core_stats_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -991,4 +991,4 @@ def test_aggregate_stats_types(edgelist1):
assert isinstance(H.nodes.degree.sum(), int)
assert isinstance(H.nodes.degree.std(), float)
assert isinstance(H.nodes.degree.var(), float)
assert isinstance(H.nodes.degree.moment(), float)
assert isinstance(H.nodes.degree.moment(), float)
4 changes: 1 addition & 3 deletions xgi/stats/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,7 @@ def moment(self, order=2, center=False):
"""
arr = self.asnumpy()
return (
spmoment(arr, moment=order) if center else np.mean(arr**order).item()
)
return spmoment(arr, moment=order) if center else np.mean(arr**order).item()

def argmin(self):
"""The ID corresponding to the minimum of the stat
Expand Down

0 comments on commit 525a218

Please sign in to comment.