-
Notifications
You must be signed in to change notification settings - Fork 82
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
[MISC] Deprecate views::take_until #2604
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/seqan/seqan3/HBKjDQPKx2hJuNw6mX7spyM2QsNd [Deployment for 038edae failed] |
What is currently missing is a more elaborated deprecation warning on how to replace |
2c5a1a4
to
abcd146
Compare
Codecov Report
@@ Coverage Diff @@
## master #2604 +/- ##
=======================================
Coverage 98.27% 98.27%
=======================================
Files 273 273
Lines 10795 10795
=======================================
Hits 10609 10609
Misses 186 186
Continue to review full report at Codecov.
|
343df6e
to
f12e6b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is possible that one of the includes is not needed, since I could not find a take_until
in the file.
f12e6b2
to
809a185
Compare
@Irallia I have update the deprecation message in |
809a185
to
8ae9f58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tip, I took a look at it.
I'm really not good at formulating nice English sentences, but I may have a few small improvements.
* as their non-consuming counter-parts if the underlying range models at least `std::forward_range`. | ||
* If, however, the underlying range is a pure `std::input_range`, the view will keep moving the underlying |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* as their non-consuming counter-parts if the underlying range models at least `std::forward_range`. | |
* If, however, the underlying range is a pure `std::input_range`, the view will keep moving the underlying | |
* as their non-consuming counter-parts if the underlying range models at least `std::ranges::forward_range`. | |
* If, however, the underlying range is a pure `std::ranges::input_range`, the view will keep moving the underlying |
4bb5226
to
c9fee82
Compare
c9fee82
to
ff4a179
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One review you did not answer and one more I found. Also, the comment from marcel is still open (you changed it to std::range::
but it should be std::ranges::
).
8346a1a
to
b8baaae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, thank you!
CHANGELOG.md
Outdated
* We deprecated `seqan3::views::take_until` and it will be removed in 3.1.0. Use `std::views::take_while` in | ||
combination with `std::not_fn` ([\#2604](https://github.com/seqan/seqan3/pull/2604)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would have just said "with an inverted predicated/condition"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or just "Use std::views::take_while(std::not(predicate))
instead" (I'd prefer this).
I think it's concise enough for a changelog, and it's more detailed in the documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, much better, thx!
* \deprecated A previous call `view | take_until_and_consume(is_space)` could be convert to | ||
* `view | std::take_while(std::not_fn(is_space)) | std::drop_while(is_space)` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* \deprecated A previous call `view | take_until_and_consume(is_space)` could be convert to | |
* `view | std::take_while(std::not_fn(is_space)) | std::drop_while(is_space)` | |
* \deprecated Use `std::take_while(std::not_fn(functor)) | std::drop_while(functor)` instead of | |
* `seqan3::views::take_until_and_consume(functor)`. |
For me, this would be more helpful, because it reuses the functor
which is mentioned in the brief, and technically you don't need the view |
.
Could you adjust the other ones?
take_until
should also get the "long" deprecation documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this correct though?
I thought this does the stuff in sequence. First take everything until the first space and after that skip all spaces.
Right now it would be for an element: first take (filter) everything until first space and from that resulting range drop until the first space. That means you should get an empty range.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, right. Is there even an easy replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No there isn't if it isn't an input iterator.
I would just write that we don't have a replacement for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching this! I remember Marcel and I already talked about this not being an appropriate replacement.
I now replaced the deprecation warning with "No alternative" as it was done in "as_const.hpp".
- `seqan3::views::take_until` is moved to `seqan3/io/detail` for internal use only. As an alternative please use `std::views::take_while` in combination with `std::not_fn`. - moved snippets and test accordingly. - add CHANGLELOG entry
b8baaae
to
6eaee70
Compare
Fixing issue seqan/product_backlog#332
seqan3::views::take_until
is moved toseqan3/io/detail
forinternal use only. As an alternative please use
std::views::take_while
in combination withstd::not_fn
.or if using the
seqan3::views::take_until_and_consume_*
version add an extrastd::views::drop_while
to reproduce the same results.