pylabrobot.heating_shaking.heater_shaker.HeaterShaker.deserialize#

classmethod HeaterShaker.deserialize(data: dict, allow_marshal: bool = False) Self#

Deserialize a resource from a dictionary.

Parameters:
  • allow_marshal (bool) – If True, the marshal module will be used to deserialize functions. This can be a security risk if the data is not trusted. Defaults to False.

  • data (dict)

Return type:

Self

Examples

Loading a resource from a json file:

>>> from pylabrobot.resources import Resource
>>> with open("my_resource.json", "r") as f:
>>>   content = json.load(f)
>>> resource = Resource.deserialize(content)