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

19 statements  

« prev     ^ index     » next       coverage.py v7.6.7, created at 2024-11-23 02:12 +0000

1#!/usr/bin/env python 

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

3from marshmallow import fields 

4 

5from daiquiri.core.hardware.abstract import HardwareObject 

6from daiquiri.core.schema.hardware import HardwareSchema 

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

8 

9import logging 

10 

11logger = logging.getLogger(__name__) 

12 

13PusherStates = ["UNKNOWN", "RETRACTED", "IN_TOUCH", "MOVING_IN", "MOVING_OUT"] 

14 

15 

16class PusherPropertiesSchema(HardwareSchema): 

17 state = OneOf(PusherStates, metadata={"readOnly": True}) 

18 

19 

20class PusherCallablesSchema(HardwareSchema): 

21 sync_hard = RequireEmpty() 

22 move_in = RequireEmpty() 

23 move_out = RequireEmpty() 

24 push = fields.Float(metadata={"readOnly": True}) 

25 

26 

27class Pusher(HardwareObject): 

28 _type = "pusher" 

29 _state_ok = [PusherStates[1], PusherStates[2]] 

30 

31 _properties = PusherPropertiesSchema() 

32 _callables = PusherCallablesSchema()