Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torchani
Commits
493d4a87
Unverified
Commit
493d4a87
authored
Oct 05, 2018
by
Gao, Xiang
Committed by
GitHub
Oct 05, 2018
Browse files
Allow parsing negative values (#114)
parent
557a79db
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
torchani/neurochem/__init__.py
torchani/neurochem/__init__.py
+12
-10
No files found.
torchani/neurochem/__init__.py
View file @
493d4a87
...
...
@@ -126,8 +126,8 @@ def load_atomic_network(filename):
start: inputsize atom_net
value : INT
| FLOAT
value :
SIGNED_
INT
|
SIGNED_
FLOAT
| "FILE" ":" FILENAME "[" INT "]"
FILENAME : ("_"|"-"|"."|LETTER|DIGIT)+
...
...
@@ -137,7 +137,8 @@ def load_atomic_network(filename):
%import common.WORD
%import common.DIGIT
%import common.INT
%import common.FLOAT
%import common.SIGNED_INT
%import common.SIGNED_FLOAT
%import common.CNAME
%import common.WS
%ignore WS
...
...
@@ -156,9 +157,9 @@ def load_atomic_network(filename):
v
=
v
[
0
]
if
v
.
type
==
'FILENAME'
:
v
=
v
.
value
elif
v
.
type
==
'INT'
:
elif
v
.
type
==
'SIGNED_INT'
or
v
.
type
==
'INT'
:
v
=
int
(
v
.
value
)
elif
v
.
type
==
'FLOAT'
:
elif
v
.
type
==
'SIGNED_FLOAT'
or
v
.
type
==
'FLOAT'
:
v
=
float
(
v
.
value
)
else
:
raise
ValueError
(
'unexpected type'
)
...
...
@@ -363,8 +364,8 @@ class Trainer:
start: params network_setup params
value : INT
| FLOAT
value :
SIGNED_
INT
|
SIGNED_
FLOAT
| STRING_VALUE
STRING_VALUE : ("_"|"-"|"."|"/"|LETTER)("_"|"-"|"."|"/"|LETTER|DIGIT)*
...
...
@@ -374,7 +375,8 @@ class Trainer:
%import common.WORD
%import common.DIGIT
%import common.INT
%import common.FLOAT
%import common.SIGNED_INT
%import common.SIGNED_FLOAT
%import common.CNAME
%import common.WS
%ignore WS
...
...
@@ -393,9 +395,9 @@ class Trainer:
v
=
v
[
0
]
if
v
.
type
==
'STRING_VALUE'
:
v
=
v
.
value
elif
v
.
type
==
'INT'
:
elif
v
.
type
==
'SIGNED_INT'
or
v
.
type
==
'INT'
:
v
=
int
(
v
.
value
)
elif
v
.
type
==
'FLOAT'
:
elif
v
.
type
==
'SIGNED_FLOAT'
or
v
.
type
==
'FLOAT'
:
v
=
float
(
v
.
value
)
else
:
raise
ValueError
(
'unexpected type'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment