-
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
[FIX] Add data access for containers #1208
Conversation
7ce3123
to
25d06a0
Compare
Codecov Report
@@ Coverage Diff @@
## master #1208 +/- ##
=======================================
Coverage 96.84% 96.84%
=======================================
Files 217 217
Lines 8616 8616
=======================================
Hits 8344 8344
Misses 272 272
Continue to review full report at Codecov.
|
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 operators compare all the bitcompressed data from one vector to another, right?
seqan3/include/seqan3/range/container/bitcompressed_vector.hpp
Lines 978 to 981 in 25d06a0
constexpr bool operator==(bitcompressed_vector const & rhs) const noexcept | |
{ | |
return raw_data() == rhs.raw_data(); | |
} |
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 thing I noticed that did not data with raw_data() swap:
seqan3/include/seqan3/range/container/bitcompressed_vector.hpp
Lines 937 to 941 in 25d06a0
constexpr void swap(bitcompressed_vector & rhs) noexcept | |
{ | |
std::swap(data, rhs.data); | |
} | |
Is there any reason for that?
We delegate to the compairson operator of the underlying data type (sdsl::int_vector), which then compares the content. |
No reason, just didn't see it. I can access the private |
25d06a0
to
f5d55a3
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.
👍 Ok everything is 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.
Just some minor stuff
CHANGELOG.md
Outdated
@@ -40,6 +40,10 @@ If possible, provide tooling that performs the changes, e.g. a shell-script. | |||
* **The `type_list` header has moved:** | |||
If you included `<seqan3/core/type_list.hpp>` you need to change the path to `<seqan3/core/type_list/type_list.hpp>`. | |||
|
|||
### The `data()` function of `seqan3::concatenated_sequences` has been deprecated | |||
|
|||
Use `raw_data()` instead. |
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 changelog format is now different...
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.
If we mark the functions as noapi we don't need to include it in the changelog?
@@ -518,6 +518,19 @@ class bitcompressed_vector | |||
return (*this)[size()-1]; | |||
} | |||
|
|||
//!\brief Direct access to the underlying SDSL vector. |
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.
Maybe you should describe more clearly what the type will be as this is exposed to the API. Note that if we expose this to the API, we cannot change the internal type anymore without breakage.
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 changed it a bit. I'd like to link to a documentation of the bitvector. But there are no online docs for the sdsl3 bitvector. And the sdsl2 one looks like this.
Anyway, I noticed that in concatenated_sequences
we added this sentence:
This exact representation of the data is implementation defined. Do not rely on it for API stability.
So it's basically not API and we could add \noapi
for doxygen to this function?
Then we could discuss if all our container data
/raw_data
functions are no api.
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 it's basically not API and we could add \noapi for doxygen to this function?
👍
Then we could discuss if all our container data/raw_data functions are no api.
👍
@@ -964,37 +977,37 @@ class bitcompressed_vector | |||
//!\brief Checks whether `*this` is equal to `rhs`. | |||
constexpr bool operator==(bitcompressed_vector const & rhs) const noexcept | |||
{ | |||
return data == rhs.data; | |||
return raw_data() == rhs.raw_data(); |
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.
Are these changes necessary? I don't care much ....
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.
Mhm, I was afraid of the code coverage since I didn't want to test the data
/raw_data
functions.
I'll revert it and see what happens.
SEQAN3_DEPRECATED_310 std::pair<decltype(data_values) const &, decltype(data_delimiters) const &> data() const | ||
{ | ||
return raw_data(); | ||
} |
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.
👍
f5d55a3
to
532609f
Compare
532609f
to
b0b8ec0
Compare
raw_data()
forbitcompressed_vector
and allows access of the underlying SDSL vector.data()
toraw_data()
inconcatenated_sequences
sincedata()
implies contiguous memory locations.small_vector
andsmall_string
havedata()
and are contiguous, ergo no changes here.