Closed udayardahal closed 4 years ago
Hmm, I it seems to do with this and possibly related to the version the yaml parser (ruamel) or jinja2. Will need to investigate. No changes has been made to the yason.py
script as far as I recall.
The problem is that 1e-07
is passed as a string while 1.0e-7
is a number. You could use an ugly hack such as {{ 10**(-pH + 0.0000001) }}
but this is of course not a permanent solution.
Could you try to install the ruamel_yaml
package? On my system this works, whereas yaml
doesn't. According to above linkyaml
has a bug that incorrectly pass the number as a string.
Seem like it is not due to the yason.py. I have two versions installed (one in conda environment and one locally). I copied the yason.py from conda (which worked in conda environment) and tried with that in my local folder and it still generate string. That means, it has to do with the yaml package as you mentioned. I will try installing ruamel_yaml
and see if it solves the error.
any luck with ruamel_yaml
?
Sorry for the late reply. Now after installing ruamel_yaml
, I don't see the same error.
While trying to generate .json with latest yason.py, I got error and when I compared the files generated from older version of yason.py and the latest one; I find some difference. See the output from the latest yason.py.
{% set pH = 7 %} atomlist:
the .json output is: "H+": { "implicit": true, "activity": "1e-07" }
where the number are generated as strings (within quotation marks).
The older version of yason.py works fine; which outputs number as expected.