Пример #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
 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
 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
    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
 def as_dict(self):
     d = MSONable.as_dict(self)
     if hasattr(self, "kwargs"):
         d.update(**self.kwargs)
     return d
Пример #9
0
 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
 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
 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
 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
 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
 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