Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/implementors/imageviewer/myscan.py: 78%

18 statements  

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

1import time 

2 

3from daiquiri.core.components import ComponentActor 

4from marshmallow import Schema, fields 

5 

6from bliss.common.scans import ct 

7from bliss.config.static import get_config 

8 

9cfg = get_config() 

10 

11 

12class MyscanSchema(Schema): 

13 subsampleid = fields.Int(required=True) 

14 

15 class Meta: 

16 uischema = {"subsampleid": {"classNames": "hidden-row", "ui:widget": "hidden"}} 

17 

18 

19class MyscanActor(ComponentActor): 

20 schema = MyscanSchema 

21 name = "myscan today" 

22 

23 def method(self, **kwargs): 

24 time.sleep(5) 

25 print("changed") 

26 

27 diode = cfg.get("diode") 

28 

29 ct(1, diode)