fix for VisibleDepritiationWarning due to numpy #838
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.
Fixed Deprecation Warning for ndarray Creation from Ragged Nested Sequences
In this update, we've addressed a deprecation warning that was triggered when creating an
ndarray
from ragged nested sequences (i.e., a list or tuple of lists or tuples with differing lengths or shapes). The code previously allowed the creation of an array without specifying a data type, which is now deprecated behavior and can lead to unexpected results or errors in future versions.The fix involved specifying the data type explicitly when creating the
ndarray
by addingdtype=object
to the array creation call. This ensures that the intention is clear when ragged nested sequences are used, and it aligns the code with the updated NumPy requirements, maintaining compatibility and avoiding deprecation issues.The specific line of code updated is in the
augmentations.py
file where thendarray
is created:After the fix, this line ensures that any ndarray created from sequences of differing lengths or shapes is treated as an object array, thus conforming to the latest best practices and maintaining the stability of the codebase.