Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle MIN30 resolution #431

Merged
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: 2 additions & 0 deletions src/volue/mesh/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,8 @@ def _from_proto_resolution(
resolution = Timeseries.Resolution.BREAKPOINT
elif proto_resolution.type == type.resources_pb2.Resolution.MIN15:
resolution = Timeseries.Resolution.MIN15
elif proto_resolution.type == type.resources_pb2.Resolution.MIN30:
resolution = Timeseries.Resolution.MIN30
elif proto_resolution.type == type.resources_pb2.Resolution.HOUR:
resolution = Timeseries.Resolution.HOUR
elif proto_resolution.type == type.resources_pb2.Resolution.DAY:
Expand Down
2 changes: 2 additions & 0 deletions src/volue/mesh/_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Resolution(Enum):
UNSPECIFIED:
BREAKPOINT:
MIN15:
MIN30:
HOUR:
DAY:
WEEK:
Expand All @@ -63,6 +64,7 @@ class Resolution(Enum):
WEEK = 5
MONTH = 6
YEAR = 7
MIN30 = 8

class PointFlags(Enum):
"""
Expand Down
1 change: 1 addition & 0 deletions src/volue/mesh/tests/test_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def test_preparing_transform_request_with_timezone_should_add_this_parameter_to_
"resolution, expected_number_of_points",
[
(Timeseries.Resolution.MIN15, 33),
(Timeseries.Resolution.MIN30, 17),
(Timeseries.Resolution.HOUR, 9),
(Timeseries.Resolution.DAY, 1),
(Timeseries.Resolution.WEEK, 1),
Expand Down
Loading