-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Graph assumes that first two arguments of edge_type.__init__ are start and end parameters #4250
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
Comments
I would like to work on this! This will be my first contribution in an Open Source. Proposed fix: self.edges = {
(u, v): edge_type(
start=self[u].get_center(),
end=self[v].get_center(),
z_index=-1,
**self._edge_config[(u, v)],
)
for (u, v) in edges
} This should make the graph support Question: Any feedback or suggestions are appreciated, as this is my first open-source contribution! |
I didn't test DiGraph and other types of graphs, axis and other classes accepting Lines, but if there are problems there it would be most welcome to also fix them. It would be also nice to expand unit tests. |
Certainly, I will add new unit tests for |
Thank you. |
Yes, I will add that test and open the PR tomorrow with all completed changes, Thank You for your guidance |
After some thought I have some thoughts (:D) that testing edge cases like |
I also discovered that equivalent problem is not only during graph creation but also on adding new edges later in edge_mobject = edge_type(
self[u].get_center(), self[v].get_center(), z_index=-1, **edge_config
) |
Thanks For Clarifying, but I already changed this as it was important to remove any errors that come later on. |
Description of bug / unexpected behavior
When trying to use
Graph
with changededge_type
toLabeledLine
(default isLine
) I got errorTypeError: LabeledLine.__init__() got multiple values for argument 'label'
.After some debugging I found out that
Graph._populate_edge_dict
method assumes that first two arguments ofedge_type.__init__
arestart
andend
parameters:After I changed the code to following one the problem seems to vanish:
Expected behavior
Graph
should accept anyedge_type
based onLine
class.How to reproduce the issue
Code for reproducing the problem
Logs
Terminal output
The text was updated successfully, but these errors were encountered: