cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.31k stars 71 forks source link

grows/tomls: pelletier/go-toml produces non-human-readable Save on a map #905

Open rcoreilly opened 4 months ago

rcoreilly commented 4 months ago

Describe the bug

see title.

It was even worse before I added SetArraysMultiline(true) as default option on encoder. I don't see an option to produce better formatted output.

I have switched emer/netparams to use "github.com/BurntSushi/toml" which produces nice output per below.

the grows system can easily be used for this, so it isn't a big deal, but might affect other use-cases in the future.

How to reproduce

save params in emer sims.

Example code

No response

Relevant output

pelletier:

Base = [
  {  Sel = 'Layer',   Desc = 'clamp gain makes big diff on overall excitation, gating propensity',   Params = {  'Layer.Acts.Clamp.Ge' = '1.0'}},
  {  Sel = '.MatrixLayer',   Desc = 'all mtx',   Params = {  'Layer.Acts.Dend.ModBase' = '1',   'Layer.Acts.Dend.ModGain' = '0',   'Layer.Inhib.Layer.On' = 'false',   'Layer.Inhib.Pool.FB' = '0',   'Layer.Inhib.Pool.Gi' = '0.5',   'Layer.Inhib.Pool.On' = 'true',   'Layer.Learn.NeuroMod.AChDisInhib' = '0',   'Layer.Matrix.IsVS' = 'false'}},

BurntSushi:

[[Base]]
  Sel = "Layer"
  Desc = "clamp gain makes big diff on overall excitation, gating propensity"
  [Base.Params]
    "Layer.Acts.Clamp.Ge" = "1.0"

[[Base]]
  Sel = ".MatrixLayer"
  Desc = "all mtx"
  [Base.Params]
    "Layer.Acts.Dend.ModBase" = "1"
    "Layer.Acts.Dend.ModGain" = "0"
    "Layer.Inhib.Layer.On" = "false"
    "Layer.Inhib.Pool.FB" = "0"
    "Layer.Inhib.Pool.Gi" = "0.5"
    "Layer.Inhib.Pool.On" = "true"
    "Layer.Learn.NeuroMod.AChDisInhib" = "0"
    "Layer.Matrix.IsVS" = "false"

Platform

macOS