def from_dict(cls, noise_model_item: dict) -> NoiseModelInstruction: """ Converts a dictionary representing an object of this class into an instance of this class. Args: noise_model_item (dict): A dictionary representation of an object of this class. Returns: NoiseModelInstruction: An object of this class that corresponds to the passed in dictionary. """ return NoiseModelInstruction( noise=Noise.from_dict(noise_model_item["noise"]), criteria=Criteria.from_dict(noise_model_item["criteria"]), )
def test_invalid_deserializatoin(): Noise.from_dict({})