Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion harp/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import numpy as np
import numpy.typing as npt
import pandas as pd
from pandas._typing import Axes
from pandas._typing import Axes # pyright: ignore[reportPrivateImportUsage]

from harp.typing import _BufferLike, _FileLike

Expand Down
4 changes: 2 additions & 2 deletions harp/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from numpy import dtype
from pandas import DataFrame, Series
from pandas._typing import Axes
from pandas._typing import Axes # pyright: ignore[reportPrivateImportUsage]

from harp.io import MessageType, read
from harp.model import BitMask, GroupMask, Model, PayloadMember, Register
Expand Down Expand Up @@ -82,7 +82,7 @@ def _compose_parser(
params: _ReaderParams,
) -> Callable[..., DataFrame]:
def parser(
data,
data: Optional[Union[_FileLike, _BufferLike]] = None,
columns: Optional[Axes] = None,
epoch: Optional[datetime] = params.epoch,
keep_type: bool = params.keep_type,
Expand Down
16 changes: 16 additions & 0 deletions tests/data/device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,22 @@ registers:
length: 3
access: Event
description: Reports the current values of the analog input lines.
AnalogDataPayloadSpec:
address: 44
type: S16
length: 3
access: Event
description: Reports the current values of the analog input lines.
payloadSpec:
AnalogInput0:
offset: 0
description: The voltage at the output of the ADC channel 0.
Encoder:
offset: 1
description: The quadrature counter value on Port 2
AnalogInput1:
offset: 2
description: The voltage at the output of the ADC channel 1.
bitMasks:
DigitalInputs:
description: Specifies the state of the digital input lines.
Expand Down
5 changes: 5 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
expected_whoAmI=0,
expected_registers=["AnalogData"],
),
DeviceSchemaParam(
path="data/device.yml",
expected_whoAmI=0,
expected_registers=["AnalogDataPayloadSpec"],
),
]


Expand Down