Repository navigation
Conversation
…bject, not the result. A reader with a false flag went directly to the private method. For a reader with a method that shouldn't be used (like the Blackrock on PTP files) it returned a wrong description with no errors. An ExampleRawIO reader, whos flag is False, must raise ValueError.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BaseRawIO.get_analogsignal_buffer_descriptionguarded withif not self.has_buffer_description_api:. That is the bound method, which is always truthy, so the guard never raised. A reader without the API went straight to the private_get_analogsignal_buffer_description: readers that do not override it raisedNotImplementedErrorinstead of the intendedValueError("This reader do not support buffer_description API"), and a reader that overrides it while its flag is off returned a description with no error.The fix calls the method:
if not self.has_buffer_description_api():.The new test,
test_buffer_description_api_checkintest_examplerawio.py, asserts thatExampleRawIO(flag False) raisesValueError. Without the fix it fails withNotImplementedError; with it, it passes. The existing callers (common_rawio_test.py,xarray_utils) check the flag first, so none of them is affected. I also ran the Blackrock, Axon and SpikeGLX rawio tests (29 passed) andblack --check.Found by Colin McNabb while adding buffer descriptions to
BlackrockRawIO.