Skip to content

Cleanup JSON output#288

Open
daanboer wants to merge 7 commits into
mainfrom
cleanup-json-output
Open

Cleanup JSON output#288
daanboer wants to merge 7 commits into
mainfrom
cleanup-json-output

Conversation

@daanboer
Copy link
Copy Markdown
Member

Cleans up most of the JSON output. The output used a lot of nested arrays and arrays of objects in places where a simple object is a lot more suitable.

  • For now only the power_balance, swarm_parameters, and rate_coefficients sections are updated. The lookup_table section is left as is. In fact the lookup_table section is rather superfluous and IMO does not make much sense in the JSON format sow we might want to remove it.
  • The properties of the updated sections now consistently use camelCase notation.
  • The per-cycle data is now presented as an array under the top-level data property. The value of the electric field can simply be read from the swarmParameters section. Previously, each cycle would presented as the value of a property in the top-level dictionary with key format reducedField_<value>, which was rather unpractical to use.

Resolves #217

daanboer added 6 commits May 21, 2026 09:41
Use objects instead of nested arrays. This greatly improves the
practical ease-of-use of the JSON output.
Use an object instead of an array of objects.
Use an array of objects, instead of nested arrays.
Use camelCase for properties.
The array is stored in the top-level `data` property.
Each element of the array is an object that contains all the data
for that cycle.
Previously the data would be stored in an object property using a
key name with shape `reducedField_<value>`, which is quite unergonomic.
@daanboer daanboer requested a review from janvdijk May 21, 2026 08:57
@daanboer daanboer added enhancement New feature or request JSON Related to the JSON I/O labels May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request JSON Related to the JSON I/O

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Redundant power showing in JSON output

1 participant