示例#1
0
文件: trans.py 项目: jtfrey/PyMuTT
    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)
示例#2
0
    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)
示例#3
0
    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['references'] = [json_to_PyMuTT(ref_dict)
                                  for ref_dict in json_obj['references']]
        return cls(**json_obj)
示例#4
0
文件: nasa.py 项目: jtfrey/PyMuTT
    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_PyMuTT(json_obj['statmech_model'])
        json_obj['references'] = \
                json_to_PyMuTT(json_obj['references'])

        return cls(**json_obj)
示例#5
0
文件: reaction.py 项目: jtfrey/PyMuTT
    def from_dict(cls, json_obj):
        """Recreate an object from the JSON representation.

        Parameters
        ----------
            json_obj : dict
                JSON representation
        Returns
        -------
            Reaction : Reaction object
        """
        json_obj = remove_class(json_obj)
        json_obj['reactants'] = [json_to_PyMuTT(reactant) 
                                 for reactant in json_obj['reactants']]
        json_obj['products'] = [json_to_PyMuTT(product) 
                                 for product in json_obj['products']]
        json_obj['transition_state'] = json_to_PyMuTT(
                json_obj['transition_state'])
        return cls(**json_obj)
示例#6
0
    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_PyMuTT.remove_class(json_obj)
        trans_model = json_PyMuTT.json_to_PyMuTT(json_obj['trans_model'])
        vib_model = json_PyMuTT.json_to_PyMuTT(json_obj['vib_model'])
        rot_model = json_PyMuTT.json_to_PyMuTT(json_obj['rot_model'])
        elec_model = json_PyMuTT.json_to_PyMuTT(json_obj['elec_model'])
        nucl_model = json_PyMuTT.json_to_PyMuTT(json_obj['nucl_model'])

        return cls(trans_model=trans_model,
                   vib_model=vib_model,
                   rot_model=rot_model,
                   elec_model=elec_model,
                   nucl_model=nucl_model)