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

setup test error (networkx): TypeError: add_node() takes 2 positional arguments but 3 were given #29

Open
victoriastuart opened this issue Apr 2, 2019 · 8 comments

Comments

@victoriastuart
Copy link

...
nx_graph = nx.Graph()

    for node in G.node_iterator():
      nx_graph.add_node(node, G.get_node_attributes(node))

E TypeError: add_node() takes 2 positional arguments but 3 were given

halp/utilities/undirected_graph_transformations.py:71: TypeError

...

@john-arul1
Copy link

read as "takes 1 positional argument but 2 given", (discount self argument in the class def). Attributes have to be given as key word arguments
nx_graph.add_node(node)
or
nx_graph.add_node(node,weight=0.5)

@mohawk2
Copy link
Contributor

mohawk2 commented Jan 6, 2021

This is because networkx 2.0 changed its API. PR #30 fixes this.

@john-arul1 To be specific about the error Victoria was seeing, what was needed was to change the dict argument to **kwargs arguments.

@victoriastuart You'll be able to clone my fork of this repo and make hypergraph stuff. In a perfect world, the PR will be merged and a new version released to PyPi.

@annaritz @tmmurali @bavent Any chance of the above happening? :-)

@tmmurali
Copy link
Member

tmmurali commented Jan 7, 2021

@mohawk2 Thank you very much for this PR.

@annaritz or @bavent will you be able to check the PR and merge? I took a look at the changes and they seem good to me.

@mohawk2
Copy link
Contributor

mohawk2 commented Jan 27, 2021

@annaritz Thank you for merging the PR! https://pypi.org/project/halp/ looks like a new release hasn't been cut yet (current one is from @bavent from 2014). I'll be pleased to assist if that would be useful.

@tmmurali
Copy link
Member

@mohawk2 I have created a new release on GitHub. I have asked @bavent to transfer ownership of the halp page on pypi.org to me, if that is at all possible.

@mohawk2
Copy link
Contributor

mohawk2 commented Jan 27, 2021

@tmmurali Thank you for rapid response! https://pypi.org/help/#request-ownership suggests it absolutely is possible.

@tmmurali
Copy link
Member

@mohawk2 thanks for this pointer. I should have checked myself! I will wait to hear from @bavent first.

@mohawk2
Copy link
Contributor

mohawk2 commented Jan 27, 2021

If I had (insert currency unit) for each time I asked something that I could theoretically have found out myself... I'm not judging! :-D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants