def serialize(self) -> "IOData": """ Convert the content of the current class instance into IOData format. """ initdata = {name: getattr(self, name) for name in self._init_params} initdata["_lookup"] = self._lookup iodata = serializers.dict_serialize(initdata) iodata.typename = type(self).__name__ return iodata
def serialize(self) -> "IOData": """ Convert the content of the current class instance into IOData format. Returns ------- IOData """ initdata = { "paramvals_by_name": self._parameters.ordered_dict, "hilbertspace": self._hilbertspace, "evals_count": self._evals_count, "_data": self._data, } iodata = serializers.dict_serialize(initdata) iodata.typename = "StoredSweep" return iodata
def serialize(self): """ Convert the content of the current class instance into IOData format. Returns ------- IOData """ initdata = { 'param_name': self.param_name, 'param_vals': self.param_vals, 'evals_count': self.evals_count, 'hilbertspace': self._hilbertspace, 'dressed_specdata': self._lookup._dressed_specdata, 'bare_specdata_list': self._lookup._bare_specdata_list } iodata = serializers.dict_serialize(initdata) iodata.typename = 'StoredSweep' return iodata
def serialize(self) -> "IOData": """ Convert the content of the current class instance into IOData format. Returns ------- IOData """ if self._lookup is None: raise ValueError( "Nothing to save - no lookup data has been generated yet.") initdata = { "param_name": self.param_name, "param_vals": self.param_vals, "evals_count": self.evals_count, "hilbertspace": self._hilbertspace, "_lookup": self._lookup, } iodata = serializers.dict_serialize(initdata) iodata.typename = "StoredSweep" return iodata
def serialize(self) -> 'IOData': """ Convert the content of the current class instance into IOData format. Returns ------- IOData """ if self._lookup is None: raise ValueError( 'Nothing to save - no lookup data has been generated yet.') initdata = { 'param_name': self.param_name, 'param_vals': self.param_vals, 'evals_count': self.evals_count, 'hilbertspace': self._hilbertspace, '_lookup': self._lookup } iodata = serializers.dict_serialize(initdata) iodata.typename = 'StoredSweep' return iodata