Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/hardware/abstract/laserheating.py: 0%

21 statements  

« prev     ^ index     » next       coverage.py v7.6.4, created at 2024-11-14 02:13 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import fields 

4from marshmallow.validate import Length 

5 

6from daiquiri.core.hardware.abstract import HardwareObject 

7from daiquiri.core.schema.hardware import HardwareSchema 

8from daiquiri.core.schema.validators import OneOf, RequireEmpty 

9 

10import logging 

11 

12logger = logging.getLogger(__name__) 

13 

14LaserheatingStates = ["READY", "ERROR", "UNKNOWN"] 

15 

16 

17class LaserheatingPropertiesSchema(HardwareSchema): 

18 state = OneOf(LaserheatingStates, metadata={"readOnly": True}) 

19 exposure_time = fields.Float() 

20 background_mode = OneOf(["ON", "OFF", "ALWAYS"]) 

21 fit_wavelength = fields.List(fields.Int(), validate=Length(2, 2)) 

22 current_calibration = fields.Str() 

23 

24 

25class LaserheatingCallablesSchema(HardwareSchema): 

26 measure = RequireEmpty() 

27 

28 

29class Laserheating(HardwareObject): 

30 _type = "laserheating" 

31 _state_ok = [LaserheatingStates[0]] 

32 

33 _properties = LaserheatingPropertiesSchema() 

34 _callables = LaserheatingCallablesSchema()