Skip to content

Commit 56c7eda

Browse files
committed
Move EvaluableExpression
1 parent 03e609b commit 56c7eda

File tree

6 files changed

+11
-35
lines changed

6 files changed

+11
-35
lines changed

examples/document.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modelspec import *
1+
from modelspec.BaseTypes import *
22
from modelspec.utils import *
33

44
# Example showing how to create a model of a document and use it to create/serialise instances

modelspec/BaseTypes.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@
99
DICT_FORMAT = "dict"
1010

1111

12+
class EvaluableExpression(str):
13+
def __init__(self, expr):
14+
self.expr = expr
15+
16+
17+
1218
def print_(text, print_it=False):
1319
"""
1420
Print a message preceded by modelspec, only if print_it=True

modelspec/__init__.py

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,2 @@
1-
import collections
21

3-
__version__ = "0.1.1"
4-
5-
6-
from modelspec.BaseTypes import Base
7-
from modelspec.BaseTypes import BaseWithId
8-
from modelspec.BaseTypes import NetworkReader
9-
10-
11-
class EvaluableExpression(str):
12-
def __init__(self, expr):
13-
self.expr = expr
14-
15-
16-
if __name__ == "__main__":
17-
18-
net = Network(id="net")
19-
doc = net.generate_documentation(format="markdown")
20-
print(doc)
21-
with open("../docs/README.md", "w") as d:
22-
d.write(doc)
23-
24-
import json
25-
import yaml
26-
27-
doc = net.generate_documentation(format="dict")
28-
doc = {"version": "NeuroMLlite v%s" % __version__, "specification": doc}
29-
with open("../docs/NeuroMLlite_specification.json", "w") as d:
30-
d.write(json.dumps(doc, indent=4))
31-
with open("../docs/NeuroMLlite_specification.yaml", "w") as d:
32-
d.write(yaml.dump(doc, indent=4, sort_keys=False))
2+
__version__ = "0.1.2"

modelspec/test/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modelspec import *
1+
from modelspec.BaseTypes import *
22
from modelspec.utils import *
33

44
import pickle

modelspec/test/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from modelspec import *
1+
from modelspec.BaseTypes import *
22
from modelspec.utils import *
33

44
from modelspec.utils import _val_info

modelspec/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import numpy as np
88

99
from modelspec.BaseTypes import print_v, print_
10-
from modelspec import EvaluableExpression
10+
from modelspec.BaseTypes import EvaluableExpression
1111

1212
verbose = False
1313

0 commit comments

Comments
 (0)