BYU-PRISM / GEKKO

GEKKO Python for Machine Learning and Dynamic Optimization
https://machinelearning.byu.edu
Other
580 stars 103 forks source link

JSON parsing fails if the result is Infinity #85

Open michi7x7 opened 4 years ago

michi7x7 commented 4 years ago

apm reports infinity in results.json as

{
"xyz" : [+Inf],
}

which is not Infinity, thus a json.decoder.JSONDecodeError is raised. Here, xyz is a Intermediate(a / b) and b tends to 0.

Infinity is also not standard JSON, but would be parsed by python json.

This is for remote=False and on Windows, but I don't think that this matters. It should probably be fixed in apm.

APMonitor commented 3 years ago

Thanks for the tip. I'll work on getting this implemented in a future release.