GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
223 stars 105 forks source link

Fix bug in using eval with templates not at top level #1281

Closed rmjarvis closed 4 months ago

rmjarvis commented 5 months ago

I was trying to craft a graceful solution to ImSim Issue #452, and I think I did, but I ran into a bug in GalSim, which this PR fixes.

Basically, if there is a template embedded in one of the fields of the config dict, and that template uses an eval, then Python doesn't like it, since you end up changing the size of the overall config dict due to the eval_gdict item. Using list(config.items()) fixes this issue.