Skip to content

Commit

Permalink
split the analysis config file into multiple files in a config directory
Browse files Browse the repository at this point in the history
  • Loading branch information
relleums committed Jun 26, 2024
1 parent 5db253a commit 690665e
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions plenoirf/summary/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,9 @@ def analysis(self):
self.plenoirf_dir,
"analysis",
self.instrument_key,
"analysis_config.json",
"config",
)
with open(path, "rt") as fin:
self._analysis = json_utils.loads(fin.read())
self._analysis = json_utils.tree.read(path)
return self._analysis

def read_event_table(self, particle_key):
Expand Down Expand Up @@ -224,10 +223,15 @@ def init(plenoirf_dir, config=None):
config=config,
)

with open(
os.path.join(instrument_dir, "analysis_config.json"), "wt"
) as fout:
fout.write(json_utils.dumps(analysis_config, indent=4))
analysis_config_dir = os.path.join(
analysis_dir, instrument_key, "config"
)
json_utils.tree.write(
path=analysis_config_dir,
tree=analysis_config,
dirtree={},
indent=4,
)


def production_name_from_run_dir(path):
Expand Down

0 comments on commit 690665e

Please sign in to comment.