コード例 #1
0
 def as_dict(self):
     """
     Json-serializable dict representation.
     """
     d = MSONable.as_dict(self)
     d["translation_vector"] = self.translation_vector.tolist()
     return d
コード例 #2
0
 def as_dict(self):
     """
     Json-serializable dict representation.
     """
     d = MSONable.as_dict(self)
     d["translation_vector"] = self.translation_vector.tolist()
     return d
コード例 #3
0
ファイル: outputs.py プロジェクト: montoyjh/pymatgen
 def as_dict(self):
     """
     Returns dict representations of Xmu object
     """
     d = MSONable.as_dict(self)
     d["data"] = self.data.tolist()
     return d
コード例 #4
0
 def as_dict(self):
     """
     Returns dict representations of Xmu object
     """
     d = MSONable.as_dict(self)
     d["data"] = self.data.tolist()
     return d
コード例 #5
0
ファイル: graph_utils.py プロジェクト: CompRhys/pymatgen
 def as_dict(self):
     """
     :return: MSONAble dict
     """
     d = MSONable.as_dict(self)
     # Transforming tuple object to a list to allow BSON and MongoDB
     d["nodes"] = list(d["nodes"])
     return d
コード例 #6
0
ファイル: force_field.py プロジェクト: matk86/pymatgen
    def as_dict(self):
        d = MSONable.as_dict(self)
        d1 = {}
        for k, v in d.items():
            if not k.startswith("@"):
                if v:
                    d1[k] = {}
                    for k1, v1 in list(v.items()):
                        if isinstance(k1, tuple):
                            d1[k]["--".join(k1)] = v1
                        else:
                            d1[k][k1] = v1
                else:
                    d1[k] = v
            else:
                d1[k] = v

        return d1
コード例 #7
0
    def as_dict(self):
        d = MSONable.as_dict(self)
        d1 = {}
        for k, v in d.items():
            if not k.startswith("@"):
                if v:
                    d1[k] = {}
                    for k1, v1 in list(v.items()):
                        if isinstance(k1, tuple):
                            d1[k]["--".join(k1)] = v1
                        else:
                            d1[k][k1] = v1
                else:
                    d1[k] = v
            else:
                d1[k] = v

        return d1
コード例 #8
0
ファイル: data.py プロジェクト: arafune/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     return d
コード例 #9
0
ファイル: data.py プロジェクト: bocklund/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     return d
コード例 #10
0
 def as_dict(self):
     return MSONable.as_dict(self)
コード例 #11
0
ファイル: input.py プロジェクト: bhourahine/CyGutz
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     d["config_dict"] = list(self.config_dict.items())
     return d
コード例 #12
0
ファイル: input.py プロジェクト: cchenae/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     d["config_dict"] = self.config_dict.items()
     return d
コード例 #13
0
 def as_dict(self):
     return MSONable.as_dict(self)
コード例 #14
0
ファイル: sets.py プロジェクト: experimentAccount0/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     d["lammps_input"] = self.lammps_input.as_dict()
     return d
コード例 #15
0
ファイル: sets.py プロジェクト: czhengsci/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     d["lammps_input"] = self.lammps_input.as_dict()
     return d
コード例 #16
0
ファイル: graph_utils.py プロジェクト: zizai/pymatgen
 def as_dict(self):
     d = MSONable.as_dict(self)
     # Transforming tuple object to a list to allow BSON and MongoDB
     d['nodes'] = list(d['nodes'])
     return d