Skip to content

Make the sqlite theorydb into a folder of yaml files

Emanuele Roberto Nocera requested to merge theory_to_yaml_files into master

Created by: scarlehoff

This is my proposal for what we discussed in Amsterdam.

At the moment (for validphys) this doesn't change anything. All fields are mandatory as they were before. I think we should first change it to the layout we want (yaml file or other) and afterwards decide what fields are important and what are no.

All interactions with the theory database for validphys happened through the validphys2/src/validphys/theorydbutils.py module. All other changes to validphys are such that the database points to theory_cards instead of theory.db.

I've also modified the docs (I've searched for theory.db and changed stuff whenever they were mentioned).

I have to admit I am not fully convinced RE having a file per theory. Having them in a single file would allow us to do this:

theory_41: &theory_41
  Comments: theory 41
  <other parameters>

theory_42:
  <<: *theory_41
  Comments: Theory inheriting from 41

40 000 000.yml --- baseline 40 000 001.yml

40 001 000.yml --- baseline 40 001 001.yml

40 001 000: 40 000 000.yml

which might be very nice.

Another option is that we leave the ones we currently have as "one per file" (but with the syntax id: <data>) and going forward organize the theories as 41_012.yaml and inside all the theories 41_012_000: <data>, 41_012_000: <data> etc.

(edit: the regression test failed, maybe by casting some of the quantities as int or float changed slightly the result, but I'll deal with it at the end)

Merge request reports

Loading