File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ registers:
1818 type : U8
1919 maskType : DigitalInputs
2020 description : Reports the state of the digital input lines.
21+ AnalogData :
22+ address : 44
23+ type : S16
24+ length : 3
25+ access : Event
26+ description : Reports the current values of the analog input lines.
2127bitMasks :
2228 DigitalInputs :
2329 description : Specifies the state of the digital input lines.
Original file line number Diff line number Diff line change 1- import numpy as np
1+ import pandas as pd
22from pytest import mark
33
44from harp .io import REFERENCE_EPOCH , MessageType
99 DeviceSchemaParam (
1010 path = "data" ,
1111 expected_whoAmI = 0 ,
12- expected_registers = ["DigitalInputMode " ],
12+ expected_registers = ["AnalogData " ],
1313 ),
1414 DeviceSchemaParam (
1515 path = "data/device.yml" ,
1616 expected_whoAmI = 0 ,
17- expected_registers = ["DigitalInputMode " ],
17+ expected_registers = ["AnalogData " ],
1818 ),
1919]
2020
@@ -26,8 +26,13 @@ def test_create_reader(schemaFile: DeviceSchemaParam):
2626
2727 whoAmI = reader .WhoAmI .read ()
2828 assert reader .device .whoAmI == whoAmI .iloc [0 , 0 ]
29- assert whoAmI .index . dtype . type == np . datetime64
29+ assert isinstance ( whoAmI .index , pd . DatetimeIndex )
3030
3131 whoAmI = reader .WhoAmI .read (epoch = None , keep_type = True )
32- assert whoAmI .index . dtype . type == np . float64
32+ assert isinstance ( whoAmI .index , pd . Index )
3333 assert whoAmI .iloc [0 , - 1 ] == MessageType .READ .name
34+
35+ if schemaFile .expected_registers :
36+ for register_name in schemaFile .expected_registers :
37+ data = reader .registers [register_name ].read ()
38+ assert isinstance (data .index , pd .DatetimeIndex )
You can’t perform that action at this time.
0 commit comments