Clojush icon indicating copy to clipboard operation
Clojush copied to clipboard

JSON structure could be a lot more compact

Open Vaguery opened this issue 10 years ago • 6 comments

Disregarding key strings, could we please restructure the JSON output so that it doesn't say the generation for every individual? Something like this comes to mind:

{
  {
    "generation" : 1,
    "individuals" :
      [
        {«individual 1 here»},
        {«individual 2 here»},
        ...
      ]
  },
  {
    "generation" : 2,
    ...
  },
  ...
}

Vaguery avatar Feb 21 '15 21:02 Vaguery

This applies to all your JSON issues: As far as I know, no one is using the JSON printing, nor has for many years. It was hastily added long ago, and I just threw things together piecemeal. Feel free to change it entirely or delete it or do whatever you like -- the current implementation is at best buggy and poorly written.

thelmuth avatar Feb 21 '15 22:02 thelmuth

I will totally use the JSON printing, since CSV makes the baby Interoperability cry.

Vaguery avatar Feb 21 '15 23:02 Vaguery

Would it be a problem if I changed things so that the JSON output is stored in a more communicative location, as well? I'm thinking of a "results" or "reports" subdirectory, whatever makes more sense, and named with the actual run ID rather than generic filename or a datetime.

Vaguery avatar Feb 22 '15 10:02 Vaguery

You can do whatever you want with the JSON printing.

As a note: There is a :json-log-filename Push arg, which you can use to not only change the filename, but also location -- if you set it to "results/experiment1/log53.json", then it will be in that subdirectory. I'd recommend not making it too determined where the JSON log goes, so that someone could change this to pick somewhere else.

thelmuth avatar Feb 22 '15 14:02 thelmuth

Yes that is good advice.

Vaguery avatar Feb 22 '15 14:02 Vaguery

I'll try to work on this today.

Vaguery avatar Feb 22 '15 15:02 Vaguery