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

[FIX] Relax sequence_file_input_traits #3128

Merged
merged 1 commit into from
Apr 25, 2023
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
10 changes: 6 additions & 4 deletions include/seqan3/io/sequence_file/input.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ namespace seqan3
* \brief Alphabet of the characters for the seqan3::field::seq; must satisfy seqan3::alphabet.
*/
/*!\typedef using sequence_legal_alphabet
* \brief Intermediate alphabet for seqan3::field::seq; must satisfy seqan3::alphabet and be convertible to
* `sequence_alphabet`.
* \brief Intermediate alphabet for seqan3::field::seq; must satisfy seqan3::alphabet and be either convertible to
* `sequence_alphabet` or a character type.
*
* \details
*
Expand Down Expand Up @@ -99,7 +99,8 @@ concept sequence_file_input_traits =
requires (t v) {
requires writable_alphabet<typename t::sequence_alphabet>;
requires writable_alphabet<typename t::sequence_legal_alphabet>;
requires explicitly_convertible_to<typename t::sequence_legal_alphabet, typename t::sequence_alphabet>;
requires detail::is_char_adaptation_v<typename t::sequence_alphabet>
|| explicitly_convertible_to<typename t::sequence_legal_alphabet, typename t::sequence_alphabet>;
requires sequence_container<typename t::template sequence_container<typename t::sequence_alphabet>>;

requires writable_alphabet<typename t::id_alphabet>;
Expand Down Expand Up @@ -228,7 +229,8 @@ class sequence_file_input
using field_ids = fields<field::seq, field::id, field::qual>;

static_assert(
[]() constexpr {
[]() constexpr
{
for (field f : selected_field_ids::as_array)
if (!field_ids::contains(f))
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ TEST_F(read, whitespace_in_seq)
struct char_traits : public seqan3::sequence_file_input_default_traits_dna
{
using sequence_alphabet = char;
using sequence_legal_alphabet = char;
using sequence_legal_alphabet = seqan3::dna4;
};
using sequence_file_type = seqan3::sequence_file_input<char_traits,
seqan3::fields<seqan3::field::id, seqan3::field::seq>,
Expand Down