iccmr-quantum / VQH

Variation Quantum Harmoniser - Sonification tools for VQE
MIT License
4 stars 4 forks source link

The labels Going from CSV to generated JSON are probably different! #22

Open Itaborala opened 3 months ago

Itaborala commented 3 months ago

When changing the labels in the h_setup_rt.csv files, the generated son_data.json does not copy the same labels. This is either:

Itaborala commented 3 months ago

@omarcostahamido A problem: Supercollider JSON module does not write the dictionary key following the same order written down (it is not a sorted dict). It is arbitrary. The hardcode made in control_to_setup2.py was also about sorting the labels as required.

Some solutions:

  1. Make a requirement or state that the labels have to be sortable as desired, or that they will be sorted (not pretty).
  2. Fix the labels completely [s0, s1, s2...] (I'm not sure how well this translates for new problems....).
  3. Make dev and user defined dictionaries on how your labels should be sorted.

Since this is getting too specific for now, my say is that we go for something between 1. and 2. There is a specific requirement that the parameter labels of a problem should be a combination of a fixed string ended by an sorting index starting from 0: foo0,foo1,foo2.

I'll commit this approach to fix the bug, but in case there is a need for another solution, it can happily be discussed here. The issue will be left open,

omarcostahamido commented 3 months ago

@Itaborala why that requirement of string plus number? It would be simpler to be just number.

Itaborala commented 3 months ago

@omarcostahamido Because you can then define different labels for different problems. In the OSC mapping (5), I could make it so that the address of the OSC changes with the label. (or this could be a brand new mapping in the library

omarcostahamido commented 3 months ago

Need an example and/or a reference to file and lines to be able to follow