File tree Expand file tree Collapse file tree 4 files changed +29
-6
lines changed
Expand file tree Collapse file tree 4 files changed +29
-6
lines changed Original file line number Diff line number Diff line change 22from ngcsimlib ._src .process .methodProcess import MethodProcess
33from ngcsimlib ._src .process .jointProcess import JointProcess
44from ngcsimlib ._src .deprecators import deprecated , deprecate_args
5+ from ngcsimlib ._src .configManager import init_config
6+ import argparse , os , json
7+
8+ def configure ():
9+ parser = argparse .ArgumentParser (description = 'Build and run a model using ngclearn' )
10+ parser .add_argument ("--config" , type = str , help = 'location of config.json file' )
11+
12+ ## ngc-sim-lib only cares about --config argument
13+ args , unknown = parser .parse_known_args () # args = parser.parse_args()
14+ try :
15+ config_path = args .modules
16+ except :
17+ config_path = None
18+
19+ if config_path is None :
20+ config_path = "json_files/config.json"
21+
22+ if not os .path .isfile (config_path ):
23+ # warn("Missing configuration file. Attempted to locate file at \"" + str(config_path) +
24+ # "\". Default Config will be used. "
25+ # "\nSee https://ngc-learn.readthedocs.io/en/latest/tutorials/model_basics/configuration.html for "
26+ # "additional information")
27+ return
28+
29+ init_config (config_path )
Original file line number Diff line number Diff line change 11"""
22ngc libraries have a need for global level configuration which will all be
33handled here. It will also be possible to add custom configuration sections to
4- this file with no issues or additional setup. However, the main purpose of these
5- configurations are not control specific parts of the model but control ngc
6- libraries at a high level.
4+ this file with no issues or additional setup.
75"""
86import json
97from types import SimpleNamespace
Original file line number Diff line number Diff line change @@ -73,9 +73,8 @@ def init_logging():
7373 loggingConfig = get_config ("logging" )
7474 if loggingConfig is None :
7575 loggingConfig = {"logging_file" : None ,
76- "logging_level" : logging .WARNING ,
77- "hide_console" : False ,
78- "custom_levels" : {"ANALYSIS" : 25 }}
76+ "logging_level" : logging .ERROR ,
77+ "hide_console" : False }
7978
8079 if loggingConfig .get ("custom_levels" , None ) is not None :
8180 for level_name , level_num in loggingConfig .get ("custom_levels" ,
Original file line number Diff line number Diff line change 11from ngcsimlib ._src .logger import (
22 addLoggingLevel as add_logging_level ,
3+ init_logging as init_logging ,
34 warn as warn ,
45 error as error ,
56 critical as critical ,
You can’t perform that action at this time.
0 commit comments