From 4476a0ca0e22d6a35bb07da87956d21ec7c49074 Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Sat, 22 Jul 2017 23:53:20 +0800 Subject: Use all uppercase to identify the global CONFIGS and COSMO Update to use the global CONFIGS and COSMO Signed-off-by: Aaron LI --- bin/fg21sim | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'bin/fg21sim') diff --git a/bin/fg21sim b/bin/fg21sim index c25aef3..c80e5ca 100755 --- a/bin/fg21sim +++ b/bin/fg21sim @@ -14,8 +14,8 @@ import argparse import logging import time -from fg21sim.configs import configs -from fg21sim.utils import setup_logging, cosmo +from fg21sim.configs import CONFIGS +from fg21sim.utils import setup_logging, COSMO def main(): @@ -36,14 +36,14 @@ def main(): t1_start = time.perf_counter() t2_start = time.process_time() - configs.read_userconfig(args.config) + CONFIGS.read_userconfig(args.config) if os.environ.get("DEBUG_FG21SIM"): - print("DEBUG: Current configurations:", configs._config, + print("DEBUG: Current configurations:", CONFIGS._config, sep="\n", file=sys.stderr) - configs.check_all() + CONFIGS.check_all() log_stream = "" if args.quiet else None - setup_logging(dict_config=configs.logging, + setup_logging(dict_config=CONFIGS.logging, level=args.loglevel, stream=log_stream, logfile=args.logfile) @@ -52,17 +52,17 @@ def main(): logger.info("COMMAND: {0}".format(" ".join(sys.argv))) # Save/backup current configurations - configfile_dump = os.path.splitext(configs.userconfig)[0] + "_dump.conf" - configs.save(configfile_dump, clobber=True, backup=True) + configfile_dump = os.path.splitext(CONFIGS.userconfig)[0] + "_dump.conf" + CONFIGS.save(configfile_dump, clobber=True, backup=True) logger.info("Saved current configurations to file: %s" % configfile_dump) # Setup cosmology model logger.info("Setup cosmology model with parameters from configs ...") - cosmo.setup(**configs.cosmology) + COSMO.setup(**CONFIGS.cosmology) logger.info("Importing modules + Numba JIT, waiting ...") from fg21sim.foregrounds import Foregrounds - fg = Foregrounds(configs) + fg = Foregrounds(CONFIGS) fg.preprocess() fg.simulate() fg.postprocess() -- cgit v1.2.2