-
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
second phase of alphabet restructuring #943
Conversation
🚧 WIP 🚧 👷♂️ 👷♀️ 🏗️ 😆 |
@eseiler Can you review this? Thanks! |
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.
first tiny look
I have added long(er) snippets to everything and addressed most of your points I think. I have also restructured the documentation for the customisation points a little so that it is hopefully more helpful. I have also added a second custom alphabet test that tests the "not-default-constructible" overloads (the nice adl-hack through associated namespaces of template args). Also requested @rrahn for review. If cereal does not react until Monday I will fork the repo and we need to discuss what to do before the release. |
8576f1a
to
32e2fb9
Compare
Codecov Report
@@ Coverage Diff @@
## master #943 +/- ##
==========================================
- Coverage 96.66% 96.64% -0.02%
==========================================
Files 178 179 +1
Lines 6557 6528 -29
==========================================
- Hits 6338 6309 -29
Misses 219 219
Continue to review full report at Codecov.
|
I have DRYed a lot of the CPO-definitions so the number of added lines is reduces by about 400; there are no more "auxiliary concepts" and also no more free functions inside detail::adl::only. This required adding a small macro, though. Return types are now properly enforced and I fixed some smaller bugs, too. Note that the CPOs are not in anonymous namespaces, because doxygen handles this really badly. It's not necessary though, unless we want to add friends to our own classes within namespace seqan3 that have the same names as the CPOs [we can just use members for this and friends of external types are handled correctly]. please give this a review soon everyone, thanks! |
The design in this file is based loosely on:
(the anonymous namespace and static hackery in the proposal are not necessary, because we have inline variables now) |
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.
First look
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.
Some general questions to the code.
@@ -101,7 +102,7 @@ class parse_condition_base; | |||
* | |||
* \details | |||
* | |||
* The must be invocable with an seqan3::char_adaptation_concept type and supply a static constexpr `msg` member of type | |||
* The must be invocable with an std::Integral type and supply a static constexpr `msg` member of type |
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.
The what?
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.
not resolved?
seqan3::dna5 d2 = seqan3::assign_rank_to(2, seqan3::dna5{}); | ||
|
||
// too-large ranks are undefined behaviour: | ||
seqan3::dna5 d3 = seqan3::assign_rank_to(50, seqan3::dna5{}); // 💣💥 |
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.
Please do not use 💣 💥 in comments.
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.
Why not? 🤔
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.
hm, ok 😿
} | ||
} | ||
|
||
} |
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.
// my_namespace
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.
not resolved?
} | ||
} | ||
|
||
} |
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.
// my_namespace
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.
not resolved?
I can't reply to that inline :| I don't understand what you mean. Because I say "alphabet object"? I have already removed the requirement for the concept... What else would you call it? This is as "correct" as is understandable for the general use-case I think. The only 100% formally correct description would be "Assign an object of type alphabet_rank_t<your_type> to your type where your_type is a type that provides one of three overloads described below". |
I have updated the PR. There is some weird failure in an entirely unrelated alignment snippet, I really don't know what's going on. Apparantly it's trying to invoke to_char() with an any ideas someone? |
Another question that we can also discuss later is whether we want a general customisation namespace, e.g. This would mean renaming seqan3::adaptation to seqan3::customisation or seqan3::custom. I am in favour of this, but we can easily perform this change later, it will just change a few lines here. ¹ https://quuxplusone.github.io/blog/2018/03/19/customization-points-for-functions/ |
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 have some more small issues. I resolved all comments that have been addressed. Some were not.
t && v, \ | ||
[[maybe_unused]] arg_ts && ... args) \ | ||
noexcept(noexcept(TERM)) \ | ||
requires requires (seqan3::detail::priority_tag<PRIO> const &, t && v, [[maybe_unused]] arg_ts && ... args) \ |
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 don't understand why you need seqan3::detail::priority_tag<PRIO> const &
in the requires clause.
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.
good point
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.
Wow, I have just reverted removing this, because it's the only way doxygen will accept the above code. Note that due to the macro I cannot put //!\cond
blocks around the requires and /*\cond*/
does not work. Apparently the ::
confuses Doxygen in that line so it stops parsing the rest of the line which makes everything work. If I remove the tag it somehow thinks the arguments to requires requires
are variable definitions of type requires
🤷♂️
In any case I have reverted this and documented the hack.
* \tparam dependent_ts Any provided types are ignored. | ||
*/ | ||
template <typename t, typename ...dependent_ts> | ||
struct deferred_type |
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 don't think that this should be public API. The use case is very special and would require at least a snippet to get the idea. Instead I would put it into detail and maybe even in the adl stuff/customisation point stuff.
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 can think of other places where this could be useful, but I can also move it to detail, if you prefer.
seqan3::dna5 d2 = seqan3::assign_rank_to(2, seqan3::dna5{}); | ||
|
||
// too-large ranks are undefined behaviour: | ||
// seqan3::dna5 d3 = seqan3::assign_rank_to(50, seqan3::dna5{}); // 💣💥 |
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.
Can you please remove 💣 💥 from the comment?
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.
So sad.
@rrahn did you have a look at this? Do you have a clue whats going on? |
I have a workaround that can hopefully be reverted once the alphabet concepts are split with the next PR. |
I have found a more permanent fix to the problem that makes the workaround obsolete. |
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.
lgtm
I have switched to a local fork to workaround USCiLab/cereal#565 for now.
Changes the alphabet related functions to be function objects. See also #869
I recommend reviewing on a commit-by-commit basis.