Beispiel #1
0
 def to_dict(self):
     return {
         'type': type(self).__name__,
         'base': to_dict(self.base),
         'material': to_dict(self.material),
         'fraction': to_dict(self.fraction),
     }
Beispiel #2
0
 def to_dict(self):
     ret = MagneticLayer.to_dict(self)
     ret['rhoM'] = to_dict(self.rhoM)
     ret['thetaM'] = to_dict(self.thetaM)
     ret['interfaceM'] = to_dict(self.interfaceM)
     ret['weight'] = to_dict(self.weight)
     return ret
Beispiel #3
0
 def to_dict(self):
     result = BaseMagnetism.to_dict(self)
     result['weight'] = to_dict(self.weight)
     result['rhoM'] = to_dict(self.rhoM)
     result['thetaM'] = to_dict(self.thetaM)
     #result['interfaceM'] = to_dict(self.interfaceM)
     return result
Beispiel #4
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'dll_path': self.model._dll_path,
         'index': self.index,
         'parameters': self.parameters(),
     })
Beispiel #5
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'rho': self.rho,
         'irho': self.irho,
     })
Beispiel #6
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'material': self.material,
         'profile': self.profile,
         'fraction': self.fraction,
     })
Beispiel #7
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'solvent': self.solvent,
         'parts': self.parts,
     })
Beispiel #8
0
 def to_dict(self):
     pars = self.parameters()
     pars.pop('inflections')  # derived parameter not needed for save
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'parameters': pars,
     })
Beispiel #9
0
 def to_dict(self):
     ret = self.parameters()
     ret.update({
         'type': type(self).__name__,
         'name': self.name,
         'method': self.method,
     })
     return to_dict(ret)
Beispiel #10
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'formula': str(self.formula),
         'density': self.density,
         'use_incoherent': self.use_incoherent,
         # TODO: what about fitby, natural_density and cell_volume?
     })
Beispiel #11
0
 def to_dict(self):
     ret = BaseMagnetism.to_dict(self)
     ret.update(
         to_dict({
             'profile': self.profile,
             'parameters': {k: getattr(self, k)
                            for k in self._parameters},
             'tol': self.tol,
         }))
Beispiel #12
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'P': self.P,  # Note: use parameter id to restore
         'distribution': self.distribution,
         'experiment': self.experiment,
         # Don't need self.probe since it is the experiment probe.
         'coherent': self.coherent,
     })
Beispiel #13
0
 def to_dict(self):
     """
     Return a dictionary representation of the Stack object
     """
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'interface': self.interface,
         'layers': self._layers,
     })
Beispiel #14
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'edges': self.edges.tolist(),
         'cdf': self.cdf.__name__,  # TODO: can't lookup name
         'args': self.args,
         'loc': self.loc,
         'scale': self.scale,
         'truncated': self.truncated,
     })
Beispiel #15
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'method': self.method,
         'thickness': self.thickness,
         'vf': self.vf,
         'material': self.material,
         'solvent': self.solvent,
     })
Beispiel #16
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'extent': self.extent,
         'dead_below': self.dead_below,
         'dead_above': self.dead_above,
         'interface_below': self.interface_below,
         'interface_above': self.interface_above,
     })
Beispiel #17
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'profile': self.profile,
         'thickness': self.thickness,
         'interface': self.interface,
         'parameters': {k: getattr(self, k) for k in self._parameters},
         'solvent': self.solvent,
         'material': self.material,
     })
Beispiel #18
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'samples': self.samples,
         'ratio': self.ratio,
         'probe': self.probe,
         'parts': self.parts,
         'coherent': self.coherent,
         'interpolation': self.interpolation,
     })
Beispiel #19
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'sample': self.sample,
         'probe': self.probe,
         'roughness_limit': self.roughness_limit,
         'dz': self.dz,
         'dA': self.dA,
         'step_interfaces': self.step_interfaces,
         'interpolation': self.interpolation,
     })
Beispiel #20
0
 def save_json(self, basename):
     """ Save the experiment as a json file """
     try:
         experiment = to_dict(self)
         experiment['refl1d'] = __version__
         json_file = basename + "-expt.json"
         with open(json_file, 'w') as fid:
             data = json.dumps(experiment)
             fid.write(data)
     except Exception:
         traceback.print_exc()
         warn("failed to create json structure for model")
Beispiel #21
0
 def to_dict(self):
     """
     Return a dictionary representation of the Repeat object
     """
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'interface': self.interface,
         'magnetism': self.magnetism,
         'repeat': self.repeat,
         'stack': self.stack,
     })
Beispiel #22
0
 def to_dict(self):
     """
     Return a dictionary representation of the Slab object
     """
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'thickness': self.thickness,
         'interface': self.interface,
         'material': self.material,
         'magnetism': self.magnetism,
     })
Beispiel #23
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'thickness': self.thickness,
         'interface': self.interface,
         'profile': self.profile,
         'parameters': {k: getattr(self, k)
                        for k in self._parameters},
         'tol': self.tol,
         'magnetism': self.magnetism,
     })
Beispiel #24
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'base_vf': self.base_vf,
         'base': self.base,
         'length': self.length,
         'power': self.power,
         'sigma': self.sigma,
         'solvent': self.solvent,
         'polymer': self.polymer,
     })
Beispiel #25
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'profile': self.profile,
         'thickness': self.thickness,
         'interface': self.interface,
         'delta': self.delta,
         'vf': self.vf,
         'sigma': self.sigma,
         'solvent': self.solvent,
         'polymer': self.polymer,
     })
Beispiel #26
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'thickness': self.thickness,
         'interface': self.interface,
         'chi': self.chi,
         'chi_s': self.chi_s,
         'h_dry': self.h_dry,
         'l_lat': self.l_lat,
         'mn': self.mn,
         'm_lat': self.m_lat,
         'pdi': self.pdi,
         'phi_b': self.phi_b,
         'solvent': self.solvent,
         'polymer': self.polymer,
     })
Beispiel #27
0
 def to_dict(self):
     ret = {
         'type': type(self).__name__,
     }
     ret.update(to_dict(self.parameters()))
     return ret
Beispiel #28
0
 def to_dict(self):
     ret = MagneticLayer.to_dict(self)
     ret['rhoM'] = to_dict(self.rhoM)
     ret['thetaM'] = to_dict(self.thetaM)
     ret['z'] = to_dict(self.z)
     return ret
Beispiel #29
0
 def to_dict(self):
     result = BaseMagnetism.to_dict(self)
     result['z'] = to_dict(self.z)
     result['rhoM'] = to_dict(self.rhoM)
     result['thetaM'] = to_dict(self.thetaM)
     return result
Beispiel #30
0
 def to_dict(self):
     return to_dict({
         'type': type(self).__name__,
         'name': self.name,
         'parameters': self.parameters(),
     })