Skip to content

Commit

Permalink
Allow for json str as arg
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanLaserGit committed Dec 4, 2023
1 parent a9b5a5b commit 36634c5
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions forcingprocessor/src/forcingprocessor/forcingprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -796,12 +796,15 @@ def prep_ngen_data(conf):
)
args = parser.parse_args()

if 's3' in args.infile:
os.system(f'wget {args.infile}')
filename = args.infile.split('/')[-1]
conf = json.load(open(filename))
if args.infile[0] == '{':
conf = json.loads(args.infile)
else:
conf = json.load(open(args.infile))
if 's3' in args.infile:
os.system(f'wget {args.infile}')
filename = args.infile.split('/')[-1]
conf = json.load(open(filename))
else:
conf = json.load(open(args.infile))

prep_ngen_data(conf)

Expand Down

0 comments on commit 36634c5

Please sign in to comment.