aplbrain/dotmotif

Don't require 'action' etc when creating a motif from_nx

j6k4m8 opened this issue · 2 comments

Creating a motif with from_nx is deprecated in 0.4.3, which is kinda a cop-out for this issue, but also saves me a ton of engineering time... The solution is to construct the motif in DotMotif DSL. If you absolutely must have a networkx representation of your motif, the right strategy is to use the to_nx output call:

from dotmotif import dotmotif

motif = dotmotif().from_motif("""
A -> B
A.type = "Friendly"
""")

graph = motif.to_nx()
# returns a nx.DiGraph

I will also add (for those coming from the deprecation notice in the code) that if you have a networkx object and you're looking for it inside another networkx object, you probably want this repository instead!