Skip to content

Commit

Permalink
fix bug: the default value of a SymbolTerminal should be None`
Browse files Browse the repository at this point in the history
  • Loading branch information
ShuhuaGao committed Mar 7, 2019
1 parent b6c42db commit 18ec56c
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 31 deletions.
50 changes: 39 additions & 11 deletions examples/sr/data/numerical_expression_tree
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
graph {
1 [label="+"]
2 [label="+"]
3 [label=AT]
4 [label=RH]
5 [label=V]
6 [label="*"]
7 [label=AT]
8 [label=10]
1 [label="*"]
2 [label="-"]
3 [label="-"]
4 [label="+"]
5 [label="-"]
6 [label=5]
7 [label=x]
8 [label=x]
9 [label=x]
10 [label=-4]
11 [label=-3]
12 [label="-"]
13 [label="+"]
14 [label="-"]
15 [label="-"]
16 [label="-"]
17 [label=-2]
18 [label=x]
19 [label=-3]
20 [label=-5]
21 [label=x]
22 [label=-4]
0 [label="+"]
1 -- 2
1 -- 3
2 -- 4
2 -- 5
6 -- 7
6 -- 8
3 -- 6
3 -- 7
4 -- 8
4 -- 9
5 -- 10
5 -- 11
12 -- 13
12 -- 14
13 -- 15
13 -- 16
14 -- 17
14 -- 18
15 -- 19
15 -- 20
16 -- 21
16 -- 22
0 -- 1
0 -- 6
0 -- 12
}
Binary file modified examples/sr/data/numerical_expression_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 19 additions & 19 deletions examples/sr/numerical_expression_inference-RNC.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 29,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -50,7 +50,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 30,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -61,7 +61,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 31,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -87,7 +87,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 32,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -99,7 +99,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 33,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -124,7 +124,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 34,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -149,7 +149,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 35,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -160,7 +160,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -186,7 +186,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 37,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -199,7 +199,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 38,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -218,7 +218,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 39,
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -251,7 +251,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": 40,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -272,7 +272,7 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": 41,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -406,7 +406,7 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": 42,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -435,7 +435,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": 43,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -474,7 +474,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": 44,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -485,7 +485,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": 45,
"metadata": {},
"outputs": [
{
Expand All @@ -495,7 +495,7 @@
"<IPython.core.display.Image object>"
]
},
"execution_count": 17,
"execution_count": 45,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -533,7 +533,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.5"
"version": "3.7.1"
}
},
"nbformat": 4,
Expand Down
2 changes: 1 addition & 1 deletion geppy/core/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def __init__(self, name):
"""
assert _is_nonkeyword_identifier(name), \
'Name of a symbol terminal must be a valid non-keyword Python identifier'
super().__init__(name, value='symbol')
super().__init__(name, value=None)


class EphemeralTerminal(Terminal):
Expand Down

0 comments on commit 18ec56c

Please sign in to comment.