Skip to content

Correctly infer numpy float types#3919

Merged
dschult merged 1 commit intonetworkx:masterfrom
alexhenrie:npfloat
Jul 5, 2020
Merged

Correctly infer numpy float types#3919
dschult merged 1 commit intonetworkx:masterfrom
alexhenrie:npfloat

Conversation

@alexhenrie
Copy link
Copy Markdown
Contributor

This fixes a bug where np.float64 values are given an integer type in the GraphML file, which leads to parsing errors.

@dschult
Copy link
Copy Markdown
Member

dschult commented Apr 16, 2020

Thanks for this!
Can you remove the deepcopy from the tests?
It should work without deepcopy right?

@dschult dschult added this to the networkx-2.5 milestone Apr 16, 2020
@alexhenrie
Copy link
Copy Markdown
Contributor Author

It would work, I just didn't want to interfere with attribute_numeric_type_graph's original purpose. But if you're not concerned about that then I'm happy to change it.

@alexhenrie
Copy link
Copy Markdown
Contributor Author

I have made the requested changes. Since test_numpy_float64_inference is run after test_write_read_attribute_numeric_type_graphml, even without the deepcopy there is in practice no change to the tests that attribute_numeric_type_graph was originally for.

@alexhenrie
Copy link
Copy Markdown
Contributor Author

@dschult Could you take another look please?

@dschult dschult merged commit 8f16014 into networkx:master Jul 5, 2020
@alexhenrie
Copy link
Copy Markdown
Contributor Author

Thank you!

kiryph pushed a commit to kiryph/networkx that referenced this pull request Jul 21, 2020
@alexhenrie alexhenrie deleted the npfloat branch October 8, 2020 20:23
MridulS pushed a commit to MridulS/networkx that referenced this pull request Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants