From 57918ec29891f15a780d7eb396fefd7d7d249eed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lu=C3=ADs=20Teixeira?= Date: Fri, 18 Jul 2025 09:22:44 +0100 Subject: [PATCH] Move to harp.data namespace MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: José Grilo --- .gitignore | 1 + harp/__init__.py | 5 ----- harp/data/__init__.py | 5 +++++ harp/{ => data}/common.yml | 0 harp/{ => data}/io.py | 2 +- harp/{ => data}/model.py | 0 harp/{ => data}/reader.py | 8 ++++---- harp/{ => data}/schema.py | 2 +- harp/{ => data}/typing.py | 0 tests/params.py | 2 +- tests/test_io.py | 2 +- tests/test_reader.py | 4 ++-- tests/test_schema.py | 2 +- 13 files changed, 17 insertions(+), 16 deletions(-) delete mode 100644 harp/__init__.py create mode 100644 harp/data/__init__.py rename harp/{ => data}/common.yml (100%) rename harp/{ => data}/io.py (99%) rename harp/{ => data}/model.py (100%) rename harp/{ => data}/reader.py (97%) rename harp/{ => data}/schema.py (97%) rename harp/{ => data}/typing.py (100%) diff --git a/.gitignore b/.gitignore index 28aa57a..26d3b7f 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ __pycache__/ # Distribution / packaging dist/ +build/ _version.py *.egg-info/ *.egg diff --git a/harp/__init__.py b/harp/__init__.py deleted file mode 100644 index ba6211c..0000000 --- a/harp/__init__.py +++ /dev/null @@ -1,5 +0,0 @@ -from harp.io import REFERENCE_EPOCH, MessageType, read, to_buffer, to_file -from harp.reader import create_reader -from harp.schema import read_schema - -__all__ = ["REFERENCE_EPOCH", "MessageType", "read", "to_buffer", "to_file", "create_reader", "read_schema"] diff --git a/harp/data/__init__.py b/harp/data/__init__.py new file mode 100644 index 0000000..70faabe --- /dev/null +++ b/harp/data/__init__.py @@ -0,0 +1,5 @@ +from harp.data.io import REFERENCE_EPOCH, MessageType, read, to_buffer, to_file +from harp.data.reader import create_reader +from harp.data.schema import read_schema + +__all__ = ["REFERENCE_EPOCH", "MessageType", "read", "to_buffer", "to_file", "create_reader", "read_schema"] diff --git a/harp/common.yml b/harp/data/common.yml similarity index 100% rename from harp/common.yml rename to harp/data/common.yml diff --git a/harp/io.py b/harp/data/io.py similarity index 99% rename from harp/io.py rename to harp/data/io.py index 2b750c0..cda72d8 100644 --- a/harp/io.py +++ b/harp/data/io.py @@ -8,7 +8,7 @@ import pandas as pd from pandas._typing import Axes # pyright: ignore[reportPrivateImportUsage] -from harp.typing import _BufferLike, _FileLike +from harp.data.typing import _BufferLike, _FileLike REFERENCE_EPOCH = datetime(1904, 1, 1) """The reference epoch for UTC harp time.""" diff --git a/harp/model.py b/harp/data/model.py similarity index 100% rename from harp/model.py rename to harp/data/model.py diff --git a/harp/reader.py b/harp/data/reader.py similarity index 97% rename from harp/reader.py rename to harp/data/reader.py index bcc76f6..581b908 100644 --- a/harp/reader.py +++ b/harp/data/reader.py @@ -12,10 +12,10 @@ from pandas import DataFrame, Series from pandas._typing import Axes # pyright: ignore[reportPrivateImportUsage] -from harp.io import MessageType, read -from harp.model import BitMask, GroupMask, Model, PayloadMember, Register -from harp.schema import read_schema -from harp.typing import _BufferLike, _FileLike +from harp.data.io import MessageType, read +from harp.data.model import BitMask, GroupMask, Model, PayloadMember, Register +from harp.data.schema import read_schema +from harp.data.typing import _BufferLike, _FileLike @dataclass diff --git a/harp/schema.py b/harp/data/schema.py similarity index 97% rename from harp/schema.py rename to harp/data/schema.py index d60b797..57ec82d 100644 --- a/harp/schema.py +++ b/harp/data/schema.py @@ -4,7 +4,7 @@ from pydantic_yaml import parse_yaml_raw_as -from harp.model import Model, Registers +from harp.data.model import Model, Registers def _read_common_registers() -> Registers: diff --git a/harp/typing.py b/harp/data/typing.py similarity index 100% rename from harp/typing.py rename to harp/data/typing.py diff --git a/tests/params.py b/tests/params.py index d675453..e8d9454 100644 --- a/tests/params.py +++ b/tests/params.py @@ -6,7 +6,7 @@ import numpy as np -from harp.model import Model +from harp.data.model import Model datapath = Path(__file__).parent diff --git a/tests/test_io.py b/tests/test_io.py index 3a94632..950bd5e 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -5,7 +5,7 @@ import pytest from pytest import mark -from harp.io import REFERENCE_EPOCH, MessageType, read, to_buffer +from harp.data.io import REFERENCE_EPOCH, MessageType, read, to_buffer from tests.params import DataFileParam testdata = [ diff --git a/tests/test_reader.py b/tests/test_reader.py index 0dc838f..f3c812f 100644 --- a/tests/test_reader.py +++ b/tests/test_reader.py @@ -1,8 +1,8 @@ import pandas as pd from pytest import mark -from harp.io import REFERENCE_EPOCH, MessageType -from harp.reader import create_reader +from harp.data.io import REFERENCE_EPOCH, MessageType +from harp.data.reader import create_reader from tests.params import DeviceSchemaParam testdata = [ diff --git a/tests/test_schema.py b/tests/test_schema.py index 160c540..9c63f92 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -1,6 +1,6 @@ from pytest import mark -from harp.schema import read_schema +from harp.data.schema import read_schema from tests.params import DeviceSchemaParam testdata = [