Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON breaks on INFTY #1464

Open
karlnapf opened this issue Aug 26, 2013 · 9 comments
Open

JSON breaks on INFTY #1464

karlnapf opened this issue Aug 26, 2013 · 9 comments

Comments

@karlnapf
Copy link
Member

Whenever a parameter is inf, -inf, json cannot open the file.

In particular, io/SerializableJsonFile.cpp line 104: sais that it cannot open the file, which means that json_object_from_file returns NULL.

This is the last error in serialization unit test branch

Assigning to @sonney2k since he wrote the thing

@ghost ghost assigned sonney2k Aug 26, 2013
@karlnapf
Copy link
Member Author

Oh, writing works btw. But reading the written object fails. The file contains "inf" strings

@karlnapf
Copy link
Member Author

https://gist.github.com/karlnapf/6343428 contains code to reproduce and output of the file.
I changed the warning when json_object_from_file returns NULL to an error. Shogun fails due to uninitialized memory otherwise anyway

@vigsterkr
Copy link
Member

come on there's like milion of 'standard' JSON serialization libraries out there.. why don't we just use that.
i already have an msgpack feature branch in my local git repo. imho we'd better off with that:

see, some examples:
http://avro.apache.org/
http://msgpack.org/

@karlnapf
Copy link
Member Author

I agree

@sonney2k
Copy link
Member

According to JSON spec, there is no Infinity or NaN values: http://json.org/

@sonney2k
Copy link
Member

@karlnapf could you please email me a small file with serialized NaNs or inf in there for testing? I got the authors OK from the json-c project (also on github) that they will merge patches. And it seems easy to fix.

@karlnapf
Copy link
Member Author

if you run the code in test/unit/io/SerializationJSON_unittest.cc.jinja2

with the disabled classes plugged into the placeholders:

#ifdef HAVE_JSON
{% set ignores = ['RationalApproximationIndividualJob',
'CCSOSVM',
'TwoStateModel'] %}

you will get such a file

@lisitsyn
Copy link
Member

lisitsyn commented Oct 4, 2013

Would you agree we can't resolve this issue under current milestone Shogun 3.0?

It seems it would have some time to introduce fix and update dependencies.

@sonney2k
Copy link
Member

sonney2k commented Oct 5, 2013

true, moving to 3.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants