NNPDF / pinecards

Runcards needed to generate PineAPPL grids for NNPDF processes
3 stars 1 forks source link

Remove double quotes in vrap cards #154

Closed felixhekhorn closed 2 years ago

felixhekhorn commented 2 years ago

Since @AleCandido pointed out to me, I became aware of other people doing the same: double quotes in yaml are not needed for strings and can be surpressed: https://github.com/NNPDF/runcards/blob/a33eb132be6b1f0a31209281cef93fccedf9db11/pinecards/DYE605/vrap.yaml#L17-L18

(as a plus, if you want, choose a spelling for yes/no - actually vrap is agnostic on that)

scarlehoff commented 2 years ago
In [1]: import yaml
In [2]: aaa = """
   ...: test: yes
   ...: more: "no"
   ...: pepe: "yes"
   ...: unq: no
   ...: """
In [3]: yaml.safe_load(aaa)
Out[3]: {'test': True, 'more': 'no', 'pepe': 'yes', 'unq': False}

Apparently yaml.safe_load needs quotes for yes/no, but I will fix the spelling

alecandido commented 2 years ago

Indeed: yes, no, true, false are special strings

no in particular it is known as the Norway problem

scarlehoff commented 2 years ago

Ah, the famous nordic countries: Denmark, Finland, Iceland, Sweden and False

alecandido commented 2 years ago

But actually @scarlehoff, why are you using the yes and no strings, instead of booleans?

scarlehoff commented 2 years ago

The vrap gods decided so.

alecandido commented 2 years ago

But is it worth to propagate it to our runcards? I'd rather propose to do the translation from booleans to vrap values (i.e. yes and no), and keep our runcards more meaningful...

scarlehoff commented 2 years ago

But is it worth to propagate it to our runcards?

Yes, because one of the requests for the runcards was that they were almost vrap runcards (and they are, just removing the : they become vrap runcards). If there were more complicated translations going on already I would agree but as they stand right now I prefer to use the vrap literals.

alecandido commented 2 years ago

Ok, I agree.

Let's just keep in mind for later then. If ever we'll improve the runcard structure, we'll switch to booleans.