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

Create a version of pipeable_config_element without value #1871

Merged
merged 3 commits into from
Jun 10, 2020

Conversation

joergi-w
Copy link
Member

@joergi-w joergi-w commented Jun 3, 2020

In this way we can introduce alternative config variables and simply remove the true template argument when it's done.

Discussed in the meeting on 2nd June.

@joergi-w joergi-w requested review from a team and eseiler and removed request for a team June 3, 2020 16:48
Copy link
Member

@eseiler eseiler left a comment

Choose a reason for hiding this comment

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

Thank you!

I would suggest to invert the default, so you don't need to adjust all existing configurations.

CHANGELOG.md Outdated Show resolved Hide resolved
include/seqan3/core/algorithm/concept.hpp Outdated Show resolved Hide resolved
include/seqan3/core/algorithm/concept.hpp Outdated Show resolved Hide resolved
@marehr
Copy link
Member

marehr commented Jun 4, 2020

I think this must go back to the drawing board, because it will not work as intended:

https://godbolt.org/z/YjFyZc

The main problem is that we all assumed that an empty base class must not be explicitly brace initialised. The main problem is that the memory order is always {{base_class1}, {base_class2}, ..., {base_classn}, member1, member2, ...} and in brace initialisation you can only fill from left to right.

The exception to the rule would be designated intialisers {.member1{}}


We can't keep this an aggregate type if we want to keep the base class approach.

  • We could make them aggregate, but we would need remove the base class and thus change the piping syntax (over concepts).
  • We could keep the base class, making them non-aggregate, but we would need to add constructors. (note: the different issue with the piping; the base class shouldn't be allowed to be constructed)

@marehr
Copy link
Member

marehr commented Jun 7, 2020

@rrahn used in #1876 the constructor variant, see

8cec061#diff-f9b7ceceaf010f2731caabb17553d00aR72-R73

@joergi-w
Copy link
Member Author

joergi-w commented Jun 8, 2020

Are you discussing this today in the core meeting? Please let me know if there is a decision and then I can implement it accordingly.

@marehr
Copy link
Member

marehr commented Jun 8, 2020

Core-Meeting 2020-06-08:

Configs will add constructors for their members

marehr
marehr previously requested changes Jun 8, 2020
Copy link
Member

@marehr marehr left a comment

Choose a reason for hiding this comment

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

These were the changes that we wanted and were decided in the meeting. Thank you so much!

include/seqan3/core/algorithm/pipeable_config_element.hpp Outdated Show resolved Hide resolved
include/seqan3/core/algorithm/pipeable_config_element.hpp Outdated Show resolved Hide resolved
@joergi-w
Copy link
Member Author

joergi-w commented Jun 9, 2020

Rebased on master.

Copy link
Member

@eseiler eseiler left a comment

Choose a reason for hiding this comment

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

Somewhere the docs reference the now missing value; thats why documentation is still failing

@marehr
Copy link
Member

marehr commented Jun 9, 2020

Travis says:

seqan3/include/seqan3/core/type_list/traits.hpp:40:

/*!\brief Implementation for seqan3::pack_traits::find_if.
 * \tparam pred_t   The predicate that is being evaluated.
 * \tparam pack_t   The type pack.
 * \returns The position of the first type `t` in `pack_t` for whom `pred_t<t>::value` is true.
 * \ingroup type_list
 */

It seems that pred_t<t>::value is associated with configuration::value xD

Let's look in the docs: https://docs.seqan.de/seqan/3-master-dev/group__type__list.html#ga5246fc497be7a3b38e42b804f35bcd7e

Indeed 😆

Not sure how to escape this class member name with doxygen.

@marehr marehr dismissed their stale review June 9, 2020 20:48

Just wanted to show waht to change

@marehr marehr requested review from a team and rrahn and removed request for a team June 9, 2020 20:48
@eseiler
Copy link
Member

eseiler commented Jun 9, 2020

It seems that pred_t<t>::value is associated with configuration::value xD

Let's look in the docs: https://docs.seqan.de/seqan/3-master-dev/group__type__list.html#ga5246fc497be7a3b38e42b804f35bcd7e

Indeed 😆

Not sure how to escape this class member name with doxygen.

%pred_t<t>::value should work. % disables link generation.
But you should look at the generated docs to make sure it's correct

@joergi-w
Copy link
Member Author

joergi-w commented Jun 9, 2020

%pred_t<t>::value should work. % disables link generation.
But you should look at the generated docs to make sure it's correct

Thank you pointing this out! I'm going to fix it.

@joergi-w joergi-w changed the title [API] Create a version of pipeable_config_element without value Create a version of pipeable_config_element without value Jun 10, 2020
@joergi-w
Copy link
Member Author

I could fix the documentation with the % sign and double backticks. The output website looks good. Now the Travis CI is green, but Jenkins reports red, although the tests were successful.

@eseiler
Copy link
Member

eseiler commented Jun 10, 2020

Thanks for checking the docs 👍

Jenkins fail is unrelated.

Copy link
Contributor

@rrahn rrahn left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. Looks good. Some suggestion and one addition I would like to have.

@@ -38,7 +38,7 @@ constexpr ptrdiff_t find()
/*!\brief Implementation for seqan3::pack_traits::find_if.
* \tparam pred_t The predicate that is being evaluated.
* \tparam pack_t The type pack.
* \returns The position of the first type `t` in `pack_t` for whom `pred_t<t>::value` is true.
* \returns The position of the first type `t` in `pack_t` for whom ``pred_t<t>::%value`` is true.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* \returns The position of the first type `t` in `pack_t` for whom ``pred_t<t>::%value`` is true.
* \returns The position of the first type `t` in `pack_t` for whom `pred_t<t>\::value` is true.

?

Copy link
Member Author

Choose a reason for hiding this comment

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

No sorry, this gives a warning:

seqan3/include/seqan3/core/type_list/traits.hpp:40: warning: explicit link request to 'value' could not be resolved

I keep the double backticks and percent sign, because the output is good and there are no warnings.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok

@@ -57,19 +57,14 @@ class config_element_base;
/*!\var id
* \brief Algorithm specific static id used for internal validation checks.
*/
/*!\var value
* \brief Member storing the configuration value.
*/
//!\}
//!\cond
template <typename config_t>
SEQAN3_CONCEPT config_element = std::semiregular<std::remove_reference_t<config_t>> &&
Copy link
Contributor

Choose a reason for hiding this comment

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

can you make a new commit and rename this to config_element_specialisation. We decided to call concepts that repesent a type specialisation so where we would ask for is_type_specialisation_of with the suffix _specialisation To avoid clashes with the actual type defintion.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure!

@joergi-w joergi-w requested a review from rrahn June 10, 2020 16:36
Copy link
Contributor

@rrahn rrahn left a comment

Choose a reason for hiding this comment

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

Looks good. Thank you.

@rrahn rrahn merged commit 2248404 into seqan:master Jun 10, 2020
@joergi-w joergi-w deleted the config_values branch June 16, 2020 12:36
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.

4 participants