dessn / Pippin

Pipeline for photometric SN analysis
MIT License
9 stars 10 forks source link

strange characters in wfit input file created by Pippin #84

Closed RickKessler closed 2 years ago

RickKessler commented 2 years ago

I just noticed that Pippin produces

WFITOPT: &id001

The '&id001' is garbage that I worry might eventually impact submit_batch. The WFITOPTS key is not used and will only cause confusion. It would help if the pippin input accepts either WFITOPT or WFITOPTS key and maps them both onto WFITOPT for submit_batch,

OmegaLambda1998 commented 2 years ago

So those symbols are yaml anchors. It's basically telling yaml to copy everything after &id001 and paste it to *id001. Why it's doing that, I'm not sure - maybe an optimisation in python's yaml package. I agree that clobbering WFITOPTS into WFITOPT is the solution though, I'll get that working soon.

OmegaLambda1998 commented 2 years ago

Yup, when using yaml.safe_dump if you have two keys referencing the same python object (i.e an object with the same id) then yaml will make use of anchors rather than writing out the same object twice. This means when loading in, those two keys will write to the same object id as well, so you can have consistent behaviour.

This will go away when removing the WFITOPTS key

OmegaLambda1998 commented 2 years ago

This change has been pushed with commit fb9c1fa. Just waiting for confirmation that it works now

OmegaLambda1998 commented 2 years ago

Confirmed resolved