Closed joni-herttuainen closed 11 months ago
Furthermore, if the contents of the passed node sets are empty, NodeSets.toJSON()
outputs '\n}'
instead of '{}'
or '{\n}'
:
>>> import libsonata
>>> libsonata.NodeSets('{}').toJSON()
'\n}'
cool, thanks for the report.
should be fixed by https://github.com/BlueBrain/libsonata/pull/289
fixed by #289
Long story short, I was looking into updating circuit node sets with simulation ones. I noticed that there is a bug in
NodeSets.toJSON()
causing it to produce invalid JSON in a cornercase.Short explanation
The case in hand: if one of the queries is empty, such as
node_id
in the repro below, the output JSON is invalid in two ways. First of all, the output is not valid JSON (trailing comma raises an exception in the parser). Secondly, the output is invalid in the sense thatand
would return different results.
Repro
output: