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

Include object name in UserWarning "Value with data type x is being converted to y" #306

Closed
lvsltz opened this issue Mar 11, 2020 · 1 comment · Fixed by #311
Closed
Labels
category: enhancement improvements of code or code behavior

Comments

@lvsltz
Copy link

lvsltz commented Mar 11, 2020

Follow up on #298

Now I do get a warning like this one on write... but have no clue where it's coming from.
I think the warning message should also contain the object to which it refers.

./miniconda3/envs/nwb_latest/lib/python3.7/site-packages/hdmf/build/objectmapper.py:146:
UserWarning: Value with data type int64 is being converted to data type uint64
(min specification: uint32).
  % (g.name, ret_type.name, s.name))
@lvsltz lvsltz added the category: enhancement improvements of code or code behavior label Mar 11, 2020
@lvsltz lvsltz changed the title Value with data type is being converted to Include object name in UserWarning "Value with data type x is being converted to y" Mar 11, 2020
@rly
Copy link
Contributor

rly commented Mar 12, 2020

@lvsltz I made a PR to fix this issue. #311

The culprit of your situation is likely the sweep number, which is one of the few types that are specified as a uint. You can wrap your integer with np.uint to fix that. Perhaps pynwb.icephys.PatchClampSeries should be changed to cast the sweep number to uint if it can tell that the type is not a uint.

@rly rly closed this as completed in #311 Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: enhancement improvements of code or code behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants