Example #1
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_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'])
        references = json_pmutt.json_to_pmutt(json_obj['references'])
        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,
                   references=references,
                   notes=notes)
Example #2
0
    def from_dict(cls, json_obj):
        """Recreate an object from the JSON representation.

        Parameters
        ----------
            json_obj : dict
                JSON representation
        Returns
        -------
            Obj : Appropriate object
        """
        json_obj = remove_class(json_obj)
        return cls(**json_obj)
Example #3
0
    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)
Example #4
0
    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)
Example #5
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['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)
Example #6
0
    def from_dict(cls, json_obj):
        """Recreate an object from the JSON representation.

        Parameters
        ----------
            json_obj : dict
                JSON representation
        Returns
        -------
            LSR : LSR object
        """
        json_obj = remove_class(json_obj)
        json_obj['reaction'] = json_to_pmutt(json_obj['reaction'])
        json_obj['surf_specie'] = json_to_pmutt(json_obj['surf_specie'])
        json_obj['gas_specie'] = json_to_pmutt(json_obj['gas_specie'])
        return cls(**json_obj)
Example #7
0
    def from_dict(cls, json_obj):
        """Recreate an object from the JSON representation.

        Parameters
        ----------
            json_obj : dict
                JSON representation
        Returns
        -------
            shomate : Shomate object
        """
        json_obj = remove_class(json_obj)
        # Reconstruct statmech model
        json_obj['model'] = \
            json_to_pmutt(json_obj['model'])
        json_obj['misc_models'] = json_to_pmutt(json_obj['misc_models'])

        return cls(**json_obj)
Example #8
0
    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['misc_models'] = \
            [json_to_pmutt(mix_model) for mix_model in json_obj['misc_models']]

        return cls(**json_obj)
Example #9
0
    def from_dict(cls, json_obj):
        """Recreate an object from the JSON representation.

        Parameters
        ----------
            json_obj : dict
                JSON representation
        Returns
        -------
            Zacros : Zacros 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'])

        return cls(**json_obj)