Skip to content
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

Copy to buffer breaks if dtype changes. #781

Closed
WenzDaniel opened this issue Nov 30, 2023 · 1 comment
Closed

Copy to buffer breaks if dtype changes. #781

WenzDaniel opened this issue Nov 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@WenzDaniel
Copy link
Collaborator

Describe the bug
Not necessarily a bug, but more of a missing feature? If the dtype used in copy_to_buffer is reduced by a field, but using the same function name it fails. This is problematic for example when adding removing the data_top field in straxen peaks.

See screenshot below for an example.

example
@WenzDaniel WenzDaniel added the bug Something isn't working label Nov 30, 2023
@dachengx
Copy link
Collaborator

With MWE copied from @WenzDaniel linked image:

import numpy as np
import strax

a = np.ones (1, strax.peak_dtype(digitize_top=True))
b = np.zeros(1, strax.peak_dtype(digitize_top=True))
strax.copy_to_buffer(a, b, '_my_copy_function_name')
a = np.ones(1, strax.peak_dtype(digitize_top=False))
b = np.zeros(1, strax.peak_dtype(digitize_top=False))
strax.copy_to_buffer(a, b, '_my_copy_function_name')

There is no error anymore, thanks to #785.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants