Skip to content
Snippets Groups Projects

Homogeneize Allen configuration

Merged Daniel Hugo Campora Perez requested to merge dcampora_homogeneize_allen_configs into master
2 files
+ 21
3
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -10,16 +10,34 @@
###############################################################################
import os, logging, json
from PyConf import configurable
from Allen.config import allen_json_sequence
log = logging.getLogger(__name__)
@configurable
def allen_json_sequence(sequence="hlt1_pp_default", json=None):
"""Provide the name of the Allen sequence and the json configuration file
Args:
sequence (string): name of the Allen sequence to run
json: (string): path the JSON file to be used to configure the chosen Allen sequence. If `None`, a default file that corresponds to the sequence will be used.
"""
import sys
import importlib
# Generate json sequence
sys.argv += ["--standalone"]
importlib.import_module(f"AllenSequences.{sequence}")
sys.argv = sys.argv[:-1]
generated_json_sequence = os.path.join(os.getcwd(), "Sequence.json")
return generated_json_sequence
def get_allen_hlt1_decision_ids():
"""Read Allen HLT1 decision IDs using the JSON sequence file.
"""
_, config_file_path = allen_json_sequence()
config_file_path = allen_json_sequence()
try:
with open(os.path.expandvars(config_file_path)) as config_file:
config = json.load(config_file)
Loading