Some languages support complex arrays (e.g. Julia, Python, etc). But JSON doesn't, and Java doesn't. We serialize complex arrays as interleaved real/imaginary parts, which is fine. But we need a way to indicate that the array data is to be treated as complex.
UnetStack uses a mechanism or adding a boolean true field with a suffix __isComplex for complex arrays. For example, if a field signal is a complex array, a field signal__isComplex = true is added to the JSON message.
This works well for most use cases, and is already implemented in Fjage.jl too. I propose that we add this to the JSON specifications for fjåge and implement it consistently across all gateways. Currently the only affected gateway will be Python (fjagepy).
Some languages support complex arrays (e.g. Julia, Python, etc). But JSON doesn't, and Java doesn't. We serialize complex arrays as interleaved real/imaginary parts, which is fine. But we need a way to indicate that the array data is to be treated as complex.
UnetStack uses a mechanism or adding a boolean
true
field with a suffix__isComplex
for complex arrays. For example, if a fieldsignal
is a complex array, a fieldsignal__isComplex = true
is added to the JSON message.This works well for most use cases, and is already implemented in
Fjage.jl
too. I propose that we add this to the JSON specifications for fjåge and implement it consistently across all gateways. Currently the only affected gateway will be Python (fjagepy
).Tasks: