-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move AxisArray monkey patch to
util
module so downstream can use it…
… without importing pylsl.
- Loading branch information
Showing
2 changed files
with
18 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from dataclasses import dataclass, field | ||
import typing | ||
|
||
from ezmsg.util.messages.axisarray import AxisArray | ||
|
||
|
||
@dataclass | ||
class CustomAxis(AxisArray.Axis): | ||
labels: typing.List[str] = field(default_factory=lambda: []) | ||
|
||
@classmethod | ||
def SpaceAxis(cls, labels: typing.List[str]): # , locs: typing.Optional[npt.NDArray] = None): | ||
return cls(unit="mm", labels=labels) | ||
|
||
|
||
# Monkey-patch AxisArray with our customized Axis | ||
AxisArray.Axis = CustomAxis |