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 16, 2023
1 parent 0e24377 commit ee380a9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions xgi/core/hypergraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,13 +273,13 @@ def __lshift__(self, H2):
[{1, 2}, {2, 3}, {1, 3, 4}]
"""
tempH = Hypergraph()

tempH.add_nodes_from(zip(self._node.keys(), self._node_attr.values()))
tempH.add_nodes_from(zip(H2._node.keys(), H2._node_attr.values()))

tempH.add_edges_from(zip(self._edge.values(), self._edge_attr.values()))
tempH.add_edges_from(zip(H2._edge.values(), H2._edge_attr.values()))

tempH._hypergraph = deepcopy(self._hypergraph)
tempH._hypergraph.update(deepcopy(H2._hypergraph))

Expand Down
15 changes: 11 additions & 4 deletions xgi/drawing/draw.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import matplotlib.pyplot as plt
import numpy as np
import seaborn as sb # for cmap "crest"
import seaborn as sb # for cmap "crest"
from matplotlib import cm
from matplotlib.patches import FancyArrow
from mpl_toolkits.mplot3d.art3d import (
Expand Down Expand Up @@ -234,7 +234,7 @@ def draw(
rescale_sizes=rescale_sizes,
**kwargs,
)

elif isinstance(H, Hypergraph):

ax, (dyad_collection, edge_collection) = draw_hyperedges(
Expand Down Expand Up @@ -663,7 +663,7 @@ def draw_hyperedges(
array=edge_fc_arr,
cmap=edge_fc_cmap,
alpha=alpha,
zorder=max_order - 2 # below dyads
zorder=max_order - 2, # below dyads
)
# edge_collection.set_cmap(edge_fc_cmap)
if edge_c_mapped:
Expand Down Expand Up @@ -800,7 +800,14 @@ def draw_simplices(
# add the projected pairwise interactions
dyads = subfaces(H_.edges.members(), order=1)
H_.add_edges_from(dyads)
H_.cleanup(multiedges=False, isolates=True, connected=False, relabel=False, in_place=True, singletons=True) # remove multi-dyads
H_.cleanup(
multiedges=False,
isolates=True,
connected=False,
relabel=False,
in_place=True,
singletons=True,
) # remove multi-dyads

if not max_order:
max_order = max_edge_order(H_)
Expand Down
2 changes: 1 addition & 1 deletion xgi/drawing/draw_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sb # for cmap "crest"
import seaborn as sb # for cmap "crest"
from matplotlib.colors import (
LinearSegmentedColormap,
ListedColormap,
Expand Down

0 comments on commit ee380a9

Please sign in to comment.