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

Cannot cast dtype('uint64') to dtype('int64') #769

Closed
alex-ruehe opened this issue Sep 26, 2022 · 2 comments
Closed

Cannot cast dtype('uint64') to dtype('int64') #769

alex-ruehe opened this issue Sep 26, 2022 · 2 comments

Comments

@alex-ruehe
Copy link
Contributor

Python version

Please run the following snippet and write the output here

python=3.10.2 (main, Jan 27 2022, 14:10:02) [Clang 12.0.5 (clang-1205.0.22.9)]
os=macOS-12.6-x86_64-i386-64bit
numpy=1.23.3
asammdf=7.1.0

Code

MDF version

3.10

Code snippet

works

file = MDF('single_channel.1.mdf')
file.get('channel_x', raw=True)

fails

file = MDF('single_channel.1.mdf')
file.get('channel_x')

Traceback

---> 15 renamed.get('channel_x')

File ~/code/dsp-ops-timeseries-etl/venv/lib/python3.10/site-packages/asammdf/blocks/mdf_v3.py:3103, in MDF3.get(self, name, group, index, raster, samples_only, data, raw, ignore_invalidation_bits, record_offset, record_count, skip_channel_validation)
 3101     if not raw:
 3102         if conversion:
-> 3103             vals = conversion.convert(vals)
 3104             conversion = None
 3106 if vals.dtype.kind == "S":

File ~/code/dsp-ops-timeseries-etl/venv/lib/python3.10/site-packages/asammdf/blocks/v2_v3_blocks.py:1568, in ChannelConversion.convert(self, values, as_object)
 1566 X = values[idx]
 1567 new_values = np.zeros(len(values), dtype=np.float64)
-> 1568 new_values[idx] = evaluate(default)
 1570 idx = np.argwhere(idx1 == idx2).flatten()
 1571 if len(idx):

File ~/code/dsp-ops-timeseries-etl/venv/lib/python3.10/site-packages/numexpr/necompiler.py:829, in evaluate(ex, local_dict, global_dict, out, order, casting, **kwargs)
  827 print(arguments)
  828 print(kwargs)
--> 829 return compiled_ex(*arguments, **kwargs)

TypeError: Iterator operand 1 dtype could not be cast from dtype('uint64') to dtype('int64') according to the rule 'safe'

Description

Use the code snippets above to reproduce the issue.

single_channel.1.mdf.zip

Any ideas why this goes south?

danielhrisca added a commit that referenced this issue Sep 26, 2022
@danielhrisca
Copy link
Owner

@r-xela please try the development branch code

@alex-ruehe
Copy link
Contributor Author

@danielhrisca Looks like the issue is fixed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants