Skip to content

Commit

Permalink
fix: graph subclassing
Browse files Browse the repository at this point in the history
need to be careful here...
  • Loading branch information
aMahanna committed Apr 27, 2024
1 parent 261a423 commit 681eb26
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion nx_arangodb/classes/digraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import networkx as nx

import nx_arangodb as nxadb
from nx_arangodb.classes.graph import Graph

networkx_api = nxadb.utils.decorators.networkx_class(nx.DiGraph)

__all__ = ["DiGraph"]


class DiGraph(nx.DiGraph):
class DiGraph(nx.DiGraph, Graph):
__networkx_backend__: ClassVar[str] = "arangodb" # nx >=3.2
__networkx_plugin__: ClassVar[str] = "arangodb" # nx <3.2

Expand Down
4 changes: 3 additions & 1 deletion nx_arangodb/classes/multidigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import networkx as nx

import nx_arangodb as nxadb
from nx_arangodb.classes.digraph import DiGraph
from nx_arangodb.classes.multigraph import MultiGraph

networkx_api = nxadb.utils.decorators.networkx_class(nx.MultiDiGraph)

__all__ = ["MultiDiGraph"]


class MultiDiGraph(nx.MultiDiGraph):
class MultiDiGraph(nx.MultiDiGraph, MultiGraph, DiGraph):
__networkx_backend__: ClassVar[str] = "arangodb" # nx >=3.2
__networkx_plugin__: ClassVar[str] = "arangodb" # nx <3.2

Expand Down
3 changes: 2 additions & 1 deletion nx_arangodb/classes/multigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
import networkx as nx

import nx_arangodb as nxadb
from nx_arangodb.classes.graph import Graph

networkx_api = nxadb.utils.decorators.networkx_class(nx.MultiGraph)

__all__ = ["MultiGraph"]


class MultiGraph(nx.MultiGraph):
class MultiGraph(nx.MultiGraph, Graph):
__networkx_backend__: ClassVar[str] = "arangodb" # nx >=3.2
__networkx_plugin__: ClassVar[str] = "arangodb" # nx <3.2

Expand Down

0 comments on commit 681eb26

Please sign in to comment.