From 7f8691ac75616da8e3ca5c473f98452689949702 Mon Sep 17 00:00:00 2001 From: sgauthamr2001 <sgauthamr2001@gmail.com> Date: Sat, 4 Jan 2025 23:53:57 -0800 Subject: [PATCH] Enable reading inputs from dict, instead of only from file --- src/interstellar/extract_input.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/interstellar/extract_input.py b/src/interstellar/extract_input.py index 2a69a72..4fd87c1 100644 --- a/src/interstellar/extract_input.py +++ b/src/interstellar/extract_input.py @@ -82,8 +82,11 @@ def extract_network_info(network_file): def extract_schedule_info(schedule_file, num_levels): - with open(schedule_file) as json_data_file: - data = json.load(json_data_file) + if isinstance(schedule_file, dict): + data = schedule_file + else: + with open(schedule_file) as json_data_file: + data = json.load(json_data_file) schedule = {} hint = data["schedule_hint"] -- GitLab