suever / pydicom-experimental

pydicom test
0 stars 1 forks source link

support for "true division" #80

Closed suever closed 9 years ago

suever commented 9 years ago

From seb.ha...@gmail.com on March 01, 2010 11:34:48

Hi,

I just got this error message:

import dicom from dicom import image ds = dicom.read_file('JPEG2000.dcm') /home/shaase/code/dicom/filereader.py:370: DeprecationWarning: integer argument expected, got float return MultiValue([fp.read_tag() for i in range(length / 4)])

OK, it's only a warning, but could you change the " / 4" to "// 4" I'm always running Python (2.5) with command line option "-Qnew" To find more places like that, one can start Python with "-Qwarn".

Thanks, Sebastian Haase

PS: I like 1/2 being .5 , not 0

Original issue: http://code.google.com/p/pydicom/issues/detail?id=80

suever commented 9 years ago

From darcymason@gmail.com on March 05, 2010 08:06:53

Thanks for this -- it's a good point. On the surface it is a simple fix, but I'd like to look into it a bit more, as I think it is worth having assertion statements wherever this kind of operation appears to make sure that, e.g. (in this case) the length is actually evenly divisible by 4. I've also started looking at python 3 conversion, and want to have a quick think whether there are other issues related to that (I don't think there are, but want to make sure, because there are changes in integer types).

Status: Started
Labels: -Difficulty-Medium Difficulty-Easy

suever commented 9 years ago

From darcymason@gmail.com on March 30, 2010 17:57:39

Running python26 -Qwarn run_tests.py gives no integer warnings as of revision 8167894b13 , at least for pydicom code (although I do get some from numpy).

Status: Verified