Skip to content

Commit

Permalink
[FIX] API stability (#2559)
Browse files Browse the repository at this point in the history
* [FIX] api stability since 3.0.2

* [MISC] interleaved_bloom_filter: make single argument  constructor explicit

* [MISC] add deprecated equality operator
  • Loading branch information
eseiler authored Apr 26, 2021
2 parents 18d0234 + f75493a commit 5cd019b
Show file tree
Hide file tree
Showing 7 changed files with 138 additions and 15 deletions.
21 changes: 21 additions & 0 deletions include/seqan3/alphabet/nucleotide/dna16sam.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,3 +217,24 @@ constexpr std::array<dna16sam, dna16sam::alphabet_size> dna16sam::complement_tab
};

} // namespace seqan3

namespace seqan3
{
//!\deprecated Please use seqan3::dna16sam instead.
using sam_dna16 SEQAN3_DEPRECATED_310 = seqan3::dna16sam;

//!\deprecated Please use seqan3::dna16sam_vector instead.
using sam_dna16_vector SEQAN3_DEPRECATED_310 = dna16sam_vector;

//!\deprecated Please use seqan3::operator""_dna16sam instead.
SEQAN3_DEPRECATED_310 constexpr dna16sam operator""_sam_dna16(char const c) noexcept
{
return seqan3::operator""_dna16sam(c);
}

//!\deprecated Please use seqan3::operator""_dna16sam instead.
SEQAN3_DEPRECATED_310 inline dna16sam_vector operator""_sam_dna16(char const * s, size_t n)
{
return seqan3::operator""_dna16sam(s, n);
}
} // namespace seqan3
6 changes: 0 additions & 6 deletions include/seqan3/alphabet/nucleotide/sam_dna16.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,5 @@

#include <seqan3/alphabet/nucleotide/dna16sam.hpp>

namespace seqan3
{
//!\deprecated Please use seqan3::dna16sam instead.
using sam_dna16 SEQAN3_DEPRECATED_310 = seqan3::dna16sam;
} // namespace seqan3

SEQAN3_DEPRECATED_HEADER(
"This header is deprecated and will be removed in SeqAn-3.1.0; Please #include <seqan3/alphabet/nucleotide/dna16sam.hpp> instead.")
6 changes: 0 additions & 6 deletions include/seqan3/alphabet/quality/phred68legacy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,5 @@

#include <seqan3/alphabet/quality/phred68solexa.hpp>

namespace seqan3
{
//!\deprecated Please use seqan3::phred68solexa instead.
using phred68legacy SEQAN3_DEPRECATED_310 = seqan3::phred68solexa;
} // namespace seqan3

SEQAN3_DEPRECATED_HEADER(
"This header is deprecated and will be removed in SeqAn-3.1.0; Please #include <seqan3/alphabet/quality/phred68solexa.hpp> instead.")
18 changes: 18 additions & 0 deletions include/seqan3/alphabet/quality/phred68solexa.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,21 @@ inline std::vector<phred68solexa> operator""_phred68solexa(char const * s, std::
//!\}

} // namespace seqan3

namespace seqan3
{
//!\deprecated Please use seqan3::phred68solexa instead.
using phred68legacy SEQAN3_DEPRECATED_310 = seqan3::phred68solexa;

//!\deprecated Please use seqan3::operator""_phred68solexa instead.
SEQAN3_DEPRECATED_310 constexpr phred68solexa operator""_phred68legacy(char const c) noexcept
{
return seqan3::operator""_phred68solexa(c);
}

//!\deprecated Please use seqan3::operator""_phred68solexa instead.
SEQAN3_DEPRECATED_310 inline std::vector<phred68solexa> operator""_phred68legacy(char const * s, size_t n)
{
return seqan3::operator""_phred68solexa(s, n);
}
} // namespace seqan3
40 changes: 37 additions & 3 deletions include/seqan3/search/dream_index/interleaved_bloom_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -592,7 +592,9 @@ class interleaved_bloom_filter<data_layout_mode>::membership_agent
* \private
* \param ibf The seqan3::interleaved_bloom_filter.
*/
membership_agent(ibf_t const & ibf) : ibf_ptr(std::addressof(ibf)), result_buffer(ibf.bin_count()) {}
explicit membership_agent(ibf_t const & ibf) :
ibf_ptr(std::addressof(ibf)), result_buffer(ibf.bin_count())
{}
//!\}

//!\brief Stores the result of bulk_contains().
Expand Down Expand Up @@ -679,7 +681,9 @@ class interleaved_bloom_filter<data_layout_mode>::membership_agent::binning_bitv
~binning_bitvector() = default; //!< Defaulted.

//!\brief Construct with given size.
binning_bitvector(size_t const size) : data(size) {}
explicit binning_bitvector(size_t const size) :
data(size)
{}
//!\}

//!\brief Returns the number of elements.
Expand Down Expand Up @@ -730,6 +734,36 @@ class interleaved_bloom_filter<data_layout_mode>::membership_agent::binning_bitv
{
return !(lhs == rhs);
}

#ifdef SEQAN3_DEPRECATED_310
//!\brief Test for equality.
//!\deprecated Use binning_bitvector.raw_data() == rhs
SEQAN3_DEPRECATED_310 friend bool operator==(binning_bitvector const & lhs, sdsl::bit_vector const & rhs) noexcept
{
return lhs.data == rhs;
}

//!\brief Test for equality.
//!\deprecated Use lhs == binning_bitvector.raw_data()
SEQAN3_DEPRECATED_310 friend bool operator==(sdsl::bit_vector const & lhs, binning_bitvector const & rhs) noexcept
{
return lhs == rhs.data;
}

//!\brief Test for inequality.
//!\deprecated Use binning_bitvector.raw_data() != rhs
SEQAN3_DEPRECATED_310 friend bool operator!=(binning_bitvector const & lhs, sdsl::bit_vector const & rhs) noexcept
{
return !(lhs.data == rhs);
}

//!\brief Test for inequality.
//!\deprecated Use lhs != binning_bitvector.raw_data()
SEQAN3_DEPRECATED_310 friend bool operator!=(sdsl::bit_vector const & lhs, binning_bitvector const & rhs) noexcept
{
return !(lhs == rhs.data);
}
#endif // SEQAN3_DEPRECATED_310
//!\}

/*!\name Access
Expand Down Expand Up @@ -916,7 +950,7 @@ class interleaved_bloom_filter<data_layout_mode>::counting_agent_type
* \private
* \param ibf The seqan3::interleaved_bloom_filter.
*/
counting_agent_type(ibf_t const & ibf) :
explicit counting_agent_type(ibf_t const & ibf) :
ibf_ptr(std::addressof(ibf)), membership_agent(ibf), result_buffer(ibf.bin_count())
{}
//!\}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
From 12b7805b266a7477492657756fa77dda9b8f5fe5 Mon Sep 17 00:00:00 2001
From: marehr <[email protected]>
Date: Sun, 25 Apr 2021 18:12:55 +0200
Subject: [PATCH 23/24] [NOAPI] [INCLUDE] add missing includes
seqan3::views::persist

---
.../pairwise_alignment/pairwise_alignment_solution_6.cpp | 1 +
.../fm_index_cursor/bi_fm_index_cursor_collection_test.cpp | 1 +
2 files changed, 2 insertions(+)

diff --git a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp
index 1ed35c8cd..32b6077d2 100644
--- a/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp
+++ b/doc/tutorial/pairwise_alignment/pairwise_alignment_solution_6.cpp
@@ -6,6 +6,7 @@
#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/core/debug_stream.hpp>
#include <seqan3/range/views/pairwise_combine.hpp>
+#include <seqan3/range/views/persist.hpp>
#include <seqan3/std/ranges>

using seqan3::operator""_dna4;
diff --git a/test/unit/search/fm_index_cursor/bi_fm_index_cursor_collection_test.cpp b/test/unit/search/fm_index_cursor/bi_fm_index_cursor_collection_test.cpp
index 48be041bc..5d055adb9 100644
--- a/test/unit/search/fm_index_cursor/bi_fm_index_cursor_collection_test.cpp
+++ b/test/unit/search/fm_index_cursor/bi_fm_index_cursor_collection_test.cpp
@@ -9,6 +9,7 @@

#include <seqan3/alphabet/nucleotide/dna4.hpp>
#include <seqan3/alphabet/nucleotide/dna5.hpp>
+#include <seqan3/range/views/persist.hpp>
#include <seqan3/range/views/slice.hpp>
#include <seqan3/range/views/char_to.hpp>
#include <seqan3/range/views/to.hpp>
--
2.31.1

Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From ccf8a01d614f20c114d384003092a60366056be8 Mon Sep 17 00:00:00 2001
From: marehr <[email protected]>
Date: Sun, 25 Apr 2021 18:13:15 +0200
Subject: [PATCH 24/24] [NOAPI] [INCLUDE] add missing includes std::isnan

---
test/unit/std/charconv_float_test.cpp | 1 +
1 file changed, 1 insertion(+)

diff --git a/test/unit/std/charconv_float_test.cpp b/test/unit/std/charconv_float_test.cpp
index 123f2e3d8..654d2a8c2 100644
--- a/test/unit/std/charconv_float_test.cpp
+++ b/test/unit/std/charconv_float_test.cpp
@@ -7,6 +7,7 @@

#include <gtest/gtest.h>

+#include <cmath>
#include <iostream>
#include <limits>

--
2.31.1

1 comment on commit 5cd019b

@vercel
Copy link

@vercel vercel bot commented on 5cd019b Apr 26, 2021

Choose a reason for hiding this comment

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

Please sign in to comment.