You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sean suggests using json files as inputs instead of hardcoded lists. I suggest talking to him about exactly how to do it. Work with Sean on this - it will make your life easier but will take some explanation.
How you do this would look something like
'''
import json
config=json.load("configfilename.json")
tuplelist = config["tuplelist"]
if "limitfile" in config:
limitfile = config["limitfile"]
haslim=True
do the stuff to read in the limits info
else:
haslim=False
variables = config["variables"]
cuts = config["cuts"]
cutchoice = config["cutchoice"]
'''
and then your code does its stuff with all of this initialized
Sean suggests using json files as inputs instead of hardcoded lists. I suggest talking to him about exactly how to do it. Work with Sean on this - it will make your life easier but will take some explanation.
How you do this would look something like
'''
import json
config=json.load("configfilename.json")
tuplelist = config["tuplelist"]
if "limitfile" in config:
limitfile = config["limitfile"]
haslim=True
do the stuff to read in the limits info
else:
haslim=False
variables = config["variables"]
cuts = config["cuts"]
cutchoice = config["cutchoice"]
'''
and then your code does its stuff with all of this initialized
The config file would look like:
{
"variables":["var1","var2"],
"cuts":{"cut1":"whatever" ....},
"cutchoice":["cut1","cut2"],
"limitfile":"limits.txt"
}
The text was updated successfully, but these errors were encountered: