carlosqueiroz / pydicom

Automatically exported from code.google.com/p/pydicom
0 stars 0 forks source link

support for "true division" #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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 reported on code.google.com by seb.ha...@gmail.com on 1 Mar 2010 at 4:34

GoogleCodeExporter commented 9 years ago
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).

Original comment by darcymason@gmail.com on 5 Mar 2010 at 4:06

GoogleCodeExporter commented 9 years ago
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).

Original comment by darcymason@gmail.com on 31 Mar 2010 at 12:57