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.
Some functions (like np.split and others) accidentally dropped metadata. The issue was caused by the way the output TsdFrame was constructed by calling
__class__
without explicitly routing the metadata of the original object.Here I added a new abstract method of
_Base
named_define_instance
for now, that should make sure that the appropriate properties are passed down to the newly defined object.The method allow overwriting any parameter by passing new kwargs, if a kwarg is not passed, the parameter is grabbed from the attributes of self. I replaced all
__class__(...)
with_define_instance(...)
everywhere in the code.Testing
_define_instance
: test that it behaves as expected for all time_series._define_instance
instead of__class__
directly. The test iterates over all pynapple funcitons,_Base
methods and_Base
subclasses methods, making sure that__class__
is not called directly.