Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 3 commits into from
Apr 5, 2024

Conversation

rmjarvis
Copy link
Member

@rmjarvis rmjarvis commented Apr 4, 2024

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.

@rmjarvis rmjarvis added bug report Bug report config Related to the config-processing functionality. labels Apr 4, 2024
@rmjarvis rmjarvis added this to the v2.5 milestone Apr 4, 2024
@rmjarvis rmjarvis requested a review from jmeyers314 April 5, 2024 10:39
Copy link
Member

@jmeyers314 jmeyers314 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rmjarvis rmjarvis merged commit 7789850 into releases/2.5 Apr 5, 2024
10 checks passed
@rmjarvis rmjarvis deleted the fix_eval_template_bug branch April 5, 2024 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Bug report config Related to the config-processing functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants