fumitoh / modelx

Use Python like a spreadsheet!
https://modelx.io
GNU Lesser General Public License v3.0
96 stars 21 forks source link

Ref/float = np.inf #62

Closed HunterPxG closed 2 years ago

HunterPxG commented 2 years ago

Hi, I have just started using modelx, and it seems that modelx does not allow to read models with reference equal to np.inf, the model can be used, but can not be read from a zip file. The solution I have found is store the reference like a np.array with a only element which is np.inf.

fumitoh commented 2 years ago

Thanks @HunterPxG for the report.

In short, this is a bug, and will be fixed by the next release. The best way to get around the bug is to assing np, not np.inf to a Reference.

In more details, here are types of objects that can be assinged to References.

Object that cannot be pickeled should not be directly assinged to References.