Skip to content

Commit

Permalink
Minor changes to import
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsekar committed Oct 3, 2018
1 parent 8330c57 commit 7568770
Show file tree
Hide file tree
Showing 5 changed files with 811 additions and 919 deletions.
10 changes: 5 additions & 5 deletions tests/test_pattern.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from obj_model import core
from wc_rules import utils,chem
from wc_rules.pattern import Pattern
from wc_rules import pattern
import unittest

class A(chem.Molecule):pass
Expand All @@ -19,17 +19,17 @@ def test_pattern_init(self):
x2 = X(id='x2')
a1.add_sites(x1,x2)

p1 = Pattern('p1')
p1 = pattern.Pattern('p1')
self.assertTrue(len(p1)==0)
p1.add_node(x1,recurse=False)
self.assertTrue(len(p1)==1)
del p1

p1 = Pattern('p1',nodelist=[a1],recurse=True)
p1 = pattern.Pattern('p1',nodelist=[a1],recurse=True)
self.assertTrue(len(p1)==3)
del p1

p1 = Pattern('p1',nodelist=[x1])
p1 = pattern.Pattern('p1',nodelist=[x1])
self.assertTrue(len(p1)==3)

p2 = p1.duplicate()
Expand All @@ -47,7 +47,7 @@ def test_generate_queries(self):
y2 = Y(id='y2',ph=False,v=-5)
a.add_sites(y1,y2)

p = Pattern('p').add_node(a,recurse=True)
p = pattern.Pattern('p').add_node(a,recurse=True)

qdict = p.generate_queries()

Expand Down
1 change: 0 additions & 1 deletion wc_rules/graph_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from obj_model import core
import networkx


class GraphMeta(object):
""" Inner class holding values used in graph methods
Expand Down
13 changes: 4 additions & 9 deletions wc_rules/matcher.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import networkx as nx
from indexer import DictSet
import gml
from utils import AddError
import operator as op
from collections import deque


import rete_nodes as rn
import rete_token as rt
import rete_build as rb
import weakref
import gml

import operator as op
from collections import deque

class ReteNet(DictSet):
def __init__(self):
Expand Down Expand Up @@ -60,7 +56,6 @@ def draw_as_gml(self,filename=None):
f.write(final_text)
return self


class Matcher(object):
def __init__(self):
self.rete_net = ReteNet()
Expand Down
4 changes: 2 additions & 2 deletions wc_rules/pattern.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from wc_rules.indexer import Index_By_ID, HashableDict, DictSet
from wc_rules.utils import listify,generate_id
from .indexer import DictSet
from .utils import listify,generate_id
from operator import eq
import random
import pprint
Expand Down
Loading

0 comments on commit 7568770

Please sign in to comment.