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

31 statements  

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

1# -*- coding: utf-8 -*- 

2from marshmallow import Schema, fields 

3 

4from daiquiri.core.hardware.abstract import HardwareObject 

5from daiquiri.core.schema.hardware import HardwareSchema 

6from daiquiri.core.schema.validators import RequireEmpty 

7 

8import logging 

9 

10logger = logging.getLogger(__name__) 

11 

12 

13class PDAValueUnitSchema(Schema): 

14 values = fields.Float(metadata={"readOnly": True}) 

15 unit = fields.String(metadata={"readOnly": True}) 

16 

17 

18# class PDAValuesSchema(Schema): 

19# channel = fields.String(metadata={"readOnly": True}) 

20# wavelength = fields.Nested(PDAValueUnitSchema, many=False, metadata={"readOnly": True}) 

21# absorbance = fields.Nested(PDAValueUnitSchema, many=False, metadata={"readOnly": True}) 

22# bdanwidth = fields.Nested(PDAValueUnitSchema, many=False, metadata={"readOnly": True}) 

23# range = fields.Float(metadata={"readOnly": True}) 

24# polarity = fields.String(metadata={"readOnly": True}) 

25 

26 

27class PDADataSchema(Schema): 

28 xdata = fields.List(fields.Float(), metadata={"many": True}) 

29 ydata = fields.List(fields.Float(), metadata={"many": True}) 

30 

31 

32class PDAValuesSchema(Schema): 

33 channels = fields.List(fields.String(), metadata={"many": True}) 

34 w0 = fields.Nested(PDADataSchema, many=False) 

35 w1 = fields.Nested(PDADataSchema, many=False) 

36 w2 = fields.Nested(PDADataSchema, many=False) 

37 w3 = fields.Nested(PDADataSchema, many=False) 

38 

39 

40class ShimadzuPDACallablesSchema(HardwareSchema): 

41 connect_pda = RequireEmpty(metadata={"readOnly": True}) 

42 disconnect_pda = RequireEmpty(metadata={"readOnly": True}) 

43 read_wl = RequireEmpty(metadata={"readOnly": True}) 

44 read_all = RequireEmpty(metadata={"readOnly": True}) 

45 start_read = RequireEmpty(metadata={"readOnly": True}) 

46 stop_read = RequireEmpty(metadata={"readOnly": True}) 

47 

48 

49class ShimadzuPDAPropertiesSchema(HardwareSchema): 

50 data = fields.Nested(PDAValuesSchema, metadata={"readOnly": True}) 

51 

52 

53class ShimadzuPDA(HardwareObject): 

54 _type = "shimadzupda" 

55 

56 _properties = ShimadzuPDAPropertiesSchema() 

57 _callables = ShimadzuPDACallablesSchema()