def __init__(self, flows=SYNONYMS, compartments=COMPARTMENTS): """ :param flows: JSON file containing the Flowables set :param compartments: JSON file containing the Compartment hierarchy """ self.flowables = load_synonyms(flows) self.compartments = load_compartments(compartments) self._compartments_file = compartments self._q_dict = defaultdict(set) # dict of quantity uuid to set of characterized flowables self._q_id = dict() # store the quantities themselves for reference self._f_dict = defaultdict(CLookup) # dict of (flowable index, quantity uuid) to c_lookup self._c_dict = dict() # dict of '; '.join(compartments) to Compartment
def load_compartments(self, file=COMPARTMENTS): self.compartments = load_compartments(file) self._compartments_file = file