Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix some calls to NetworkX where draw_networkx_edges, draw_networkx_nodes had changed upstream. #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions regraph/attribute_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
import math
import sys

from greenery.lego import parse
from greenery import parse

from regraph.exceptions import AttributeSetError

Expand Down Expand Up @@ -538,7 +538,7 @@ def intersection(self, other):

* If `other` is a string, a Python dict or a FiniteSet,
it is converted to a regex pattern, after which it
is parsed by `greenery.lego.parse` method and its
is parsed by `greenery.parse` method and its
intersection with the pattern of the `self` is found.
The library `greenery` finds the intersection between two
regex's by constructing corresponding FSM's (finite state
Expand Down Expand Up @@ -620,7 +620,7 @@ def difference(self, other):

* If `other` is a string, a Python dict or a FiniteSet,
it is converted to a regex pattern, after which it
is parsed by `greenery.lego.parse` method and its
is parsed by `greenery.parse` method and its
difference with the pattern of the `self` is found.
See more details here:
https://github.com/qntm/greenery
Expand Down
10 changes: 5 additions & 5 deletions regraph/backends/networkx/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def plot_graph(graph, filename=None, parent_pos=None, title=None):
graph._graph, k=k, pos=pos, fixed=fixed, iterations=iterations)
nx.draw_networkx_nodes(
graph._graph, pos, node_color=[[0.6, 0.8, 0.047]] * len(graph.nodes()),
node_size=200, scale=1.0)
node_size=200)
nx.draw_networkx_edges(graph._graph, pos, alpha=0.4, width=2.0, node_size=200)

labels = {}
Expand Down Expand Up @@ -195,7 +195,7 @@ def plot_instance(graph, pattern, instance, filename=None,
nx.draw_networkx_nodes(
graph._graph, pos, node_color=new_colors, node_size=200)
nx.draw_networkx_edges(
graph._graph, pos, alpha=0.4, width=2.0, node_size=200, scale=1.0)
graph._graph, pos, alpha=0.4, width=2.0, node_size=200)

# Draw pattern edges highlighted
edgelist = [(instance[edge[0]], instance[edge[1]])
Expand Down Expand Up @@ -373,7 +373,7 @@ def plot_rule(rule, filename=None, title=None):
_set_limits(all_pos, all_label_pos)
nx.draw_networkx_nodes(rule.lhs._graph, lhs_pos,
node_color=lhs_colors,
node_size=100, arrows=True)
node_size=100)
nx.draw_networkx_edges(rule.lhs._graph, lhs_pos, alpha=0.4, node_size=100)
nx.draw_networkx_labels(rule.lhs._graph, lhs_label_pos, lhs_labels, font_size=11)

Expand All @@ -383,7 +383,7 @@ def plot_rule(rule, filename=None, title=None):
_set_limits(all_pos, all_label_pos)
nx.draw_networkx_nodes(rule.p._graph, p_pos,
node_color=p_colors,
node_size=100, arrows=True)
node_size=100)
nx.draw_networkx_edges(rule.p._graph, p_pos, alpha=0.4, node_size=100)
nx.draw_networkx_labels(rule.p._graph, p_label_pos, p_labels, font_size=11)

Expand All @@ -393,7 +393,7 @@ def plot_rule(rule, filename=None, title=None):
_set_limits(all_pos, all_label_pos)
nx.draw_networkx_nodes(rule.rhs._graph, rhs_pos,
node_color=rhs_colors,
node_size=100, arrows=True)
node_size=100)
nx.draw_networkx_edges(rule.rhs._graph, rhs_pos, alpha=0.4, node_size=100)
nx.draw_networkx_labels(rule.rhs._graph, rhs_label_pos, rhs_labels, font_size=11)

Expand Down