Exemple #1
0
 def as_dict(self):
     """
     Json-serializable dict representation.
     """
     d = MSONable.as_dict(self)
     d["translation_vector"] = self.translation_vector.tolist()
     return d
 def as_dict(self):
     """
     Json-serializable dict representation.
     """
     d = MSONable.as_dict(self)
     d["translation_vector"] = self.translation_vector.tolist()
     return d
Exemple #3
0
 def as_dict(self):
     """
     Returns dict representations of Xmu object
     """
     d = MSONable.as_dict(self)
     d["data"] = self.data.tolist()
     return d
Exemple #4
0
 def as_dict(self):
     """
     Returns dict representations of Xmu object
     """
     d = MSONable.as_dict(self)
     d["data"] = self.data.tolist()
     return d
Exemple #5
0
 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
Exemple #6
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
Exemple #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
Exemple #8
0
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     return d
Exemple #9
0
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     return d
 def as_dict(self):
     return MSONable.as_dict(self)
Exemple #11
0
 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
Exemple #12
0
 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
Exemple #13
0
 def as_dict(self):
     return MSONable.as_dict(self)
Exemple #14
0
 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
Exemple #15
0
 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
Exemple #16
0
 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