def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- StatMech : StatMech object """ json_obj = json_pMuTT.remove_class(json_obj) name = json_obj['name'] trans_model = json_pMuTT.json_to_pMuTT(json_obj['trans_model']) vib_model = json_pMuTT.json_to_pMuTT(json_obj['vib_model']) rot_model = json_pMuTT.json_to_pMuTT(json_obj['rot_model']) elec_model = json_pMuTT.json_to_pMuTT(json_obj['elec_model']) nucl_model = json_pMuTT.json_to_pMuTT(json_obj['nucl_model']) notes = json_obj['notes'] return cls(name=name, trans_model=trans_model, vib_model=vib_model, rot_model=rot_model, elec_model=elec_model, nucl_model=nucl_model, notes=notes)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- EmpiricalBase : EmpiricalBase object """ json_obj = remove_class(json_obj) return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- IdealTrans : IdealTrans object """ json_obj = remove_class(json_obj) return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- Reference : Reference object """ json_obj = remove_class(json_obj) # Reconstruct statmech model return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- PhaseDiagram : PhaseDiagram object """ json_obj = remove_class(json_obj) json_obj['reactions'] = [json_to_pMuTT(reaction) for reaction in json_obj['reactions']] return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- EmpiricalBase : EmpiricalBase object """ json_obj = remove_class(json_obj) # Recalculate the intercepts to ensure range is smooth json_obj.pop('intercepts', None) return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- References : References object """ json_obj = remove_class(json_obj) json_obj['offset'] = np.array(json_obj['offset']) json_obj['references'] = [json_to_pMuTT(ref_dict) for ref_dict in json_obj['references']] return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- Nasa : Nasa object """ json_obj = remove_class(json_obj) # Reconstruct statmech model json_obj['statmech_model'] = json_to_pMuTT(json_obj['statmech_model']) json_obj['references'] = json_to_pMuTT(json_obj['references']) json_obj['cat_site'] = json_to_pMuTT(json_obj['cat_site']) json_obj['mix_models'] = json_to_pMuTT(json_obj['mix_models']) return cls(**json_obj)
def from_dict(cls, json_obj): """Recreate an object from the JSON representation. Parameters ---------- json_obj : dict JSON representation Returns ------- EmpiricalBase : EmpiricalBase object """ json_obj = remove_class(json_obj) # Reconstruct statmech model json_obj['statmech_model'] = \ json_to_pMuTT(json_obj['statmech_model']) json_obj['references'] = \ json_to_pMuTT(json_obj['references']) json_obj['mix_models'] = \ [json_to_pMuTT(mix_model) for mix_model in json_obj['mix_models']] return cls(**json_obj)