Skip to content

Commit

Permalink
Don't warn about eval_gdict being unexpected
Browse files Browse the repository at this point in the history
  • Loading branch information
rmjarvis committed Apr 5, 2024
1 parent a6699fc commit aafb269
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion galsim/config/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def Process(config, logger=None, njobs=1, job=1, new_params=None, except_abort=F
json.dumps(config, default=lambda o: repr(o), indent=4))

# Warn about any unexpected fields.
unexpected = [ k for k in config if k not in top_level_fields ]
unexpected = [ k for k in config if k not in top_level_fields and k[0] != '_' ]
if len(unexpected) > 0 and logger:
logger.warning("Warning: config dict contains the following unexpected fields: %s.",
unexpected)
Expand Down
6 changes: 3 additions & 3 deletions galsim/config/value_eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def _GenerateFromEval(config, base, value_type):

# These will be the variables to use for evaluating the eval statement.
# Start with the current locals and globals, and add extra items to them.
if 'eval_gdict' not in base:
if '_eval_gdict' not in base:
gdict = globals().copy()
# We allow the following modules to be used in the eval string:
exec('import galsim', gdict)
Expand All @@ -95,9 +95,9 @@ def _GenerateFromEval(config, base, value_type):
exec('import numpy as np', gdict)
exec('import os', gdict)
ImportModules(base, gdict)
base['eval_gdict'] = gdict
base['_eval_gdict'] = gdict
else:
gdict = base['eval_gdict']
gdict = base['_eval_gdict']

if 'str' not in config:
raise GalSimConfigError(
Expand Down

0 comments on commit aafb269

Please sign in to comment.