Skip to content

Make inputs to nu_tuple be json file instead of hard coded lists.  #2

Open
@hschellman

Description

@hschellman

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"
}

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions