Skip to content

Conversation

@danovaro
Copy link
Member

@danovaro danovaro commented Apr 8, 2024

added support for to-by for stepRanges
step=0-6/to/18-24/by/6 ==> 0-6/6-12/12-18/18-24

@danovaro danovaro requested a review from simondsmart April 8, 2024 15:16
step("0/to/6/by/30m", "0/30m/1/1h30m/2/2h30m/3/3h30m/4/4h30m/5/5h30m/6");
step("0-6/to/18-24/by/6", "0-6/6-12/12-18/18-24");
step("0-24/to/48-72/by/24", "0-24/24-48/48-72");
step("0/to/24/by/3/0-6/to/18-24/by/6", "0/3/6/9/12/15/18/21/24/0-6/6-12/12-18/18-24");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we make sure there is a test here testing the ranges with the by syntax using e.g.

0-24/to/48-72/by/90m

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, added!

TimeUnit unit = std::min(maxUnit(f), maxUnit(t));
s << canonical(f, unit) << '-' << canonical(t, unit);
// s << canonical(f, unit) << '-' << canonical(t, unit);
s << canonical(f) << '-' << canonical(t);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we no longer using unit here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the initial request was to use the same unit for stepranges,
so 30m-1h ==> 30m-60m

with the to-by, we have horrible sequences:
0-6/to/3-9/by/30m ==> 0-6/30m-390m/1-7/90m-450m/2-8/150m-510m/3-9
with the proposed change we have:
0-6/to/3-9/by/30m ==> 0-6/30m-6h30m/1-7/1h30m-7h30m/2-8/2h30m-8h30m/3-9

@simondsmart
Copy link
Contributor

You need to address why the tests aren't passing ...

@danovaro danovaro merged commit 03aff1f into develop Apr 10, 2024
@danovaro danovaro deleted the hotfix/1.11.10 branch April 10, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants