-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rely on PyO3 type conversion for HashMap and HashSet (#171)
* Rely on PyO3 type conversion for HashMap and HashSet Since PyO3 0.12.0 the trait implementations for converting from hashbrown's HashMap and HashSet types. [1] This commit leverage this so we do not have to internally convert these objects to and from python types. [1] PyO3/pyo3#1114 * Revert PyDiGraph compose to use PyObject return This commit reverts the change for the PyDiGraph.compose() method to use a PyObject return type of a PyDict again. Doing the HashMap return resulted in a double iteration over the output map, the first to convert NodeIndex to a usize and the second in the PyO3 wrapper to convert the HashMap to a PyDict in the python ffi. Returning a PyObject enables to do the NodeIndex to usize conversion and PyDict generation at the same time with a single loop over the contents. * Fix PyGraph.compose() too * Revert to PyObject for graph_greedy_color * Standardize naming on weight_transform_callable
- Loading branch information
Showing
5 changed files
with
51 additions
and
122 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters