Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.
This repository was archived by the owner on Dec 12, 2023. It is now read-only.

Networkx 2.0 compatibility  #73

@Erotemic

Description

@Erotemic

In the add_type_conversion method of GraphConversionManager on line 124 of color_conversions.py there is a call to networkx add_edge that does not work in the new version 2.0. This can be fixed by modifying the function as follows:

    def add_type_conversion(self, start_type, target_type, conversion_function):
        super(GraphConversionManager, self).add_type_conversion(start_type, target_type, conversion_function)
        if networkx.__version__.startswith('2'):
            self.conversion_graph.add_edge(start_type, target_type, conversion_function=conversion_function)
        else:
            self.conversion_graph.add_edge(start_type, target_type, {'conversion_function': conversion_function})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions