SNEWS2 / snewpdag

SNEWS2 alert calculations
BSD 3-Clause "New" or "Revised" License
2 stars 13 forks source link

Change configuration to python literal #16

Closed tsengj10 closed 3 years ago

tsengj10 commented 3 years ago

The main change is to take the configuration input as a python literal, rather than json. Now you can add comments! Plus the host of other syntactical conveniences, like single quotes, dangling commas, and tuples.

Also added some input validation to some of the plugins, and a few corrections to test-gen-config. Unfortunately the result remains empty histograms, so some more debugging needed.

Using tuples as a key for data is a bit delicate, because accessing the field then requires exactly the same ordering, which can be a little tricky to predict (this was a bigger problem with json, because lists seem to get sorted when turned into tuples, which sometimes changed the order of the elements).

tsengj10 commented 3 years ago

Decided there's not much reason for keeping the input data in strict json form, so I've changed it to python literal form as well.