pynetdicom_legacy icon indicating copy to clipboard operation
pynetdicom_legacy copied to clipboard

Python 3?

Open tawilkinson opened this issue 9 years ago • 12 comments

I don't know if this is still being actively developed but are their plans to port to Python 3?

tawilkinson avatar Dec 21 '15 11:12 tawilkinson

Hi, How much work would be involved in changing from Python2 to Python3 ?

Has anyone had to do it themselves for this project ?

Thanks, Andrew

AndrewChicco avatar Feb 04 '16 22:02 AndrewChicco

any update on that? doesn't seem to work out of the box. Is this project still actively developed?

NicolasRannou avatar Sep 02 '16 10:09 NicolasRannou

Same question answered on the google group: https://groups.google.com/d/topic/pynetdicom/uOs5aMD6UNQ/discussion

Unfortunately Patrice isn't likely to do this. It does work out of the box on Python 2.7.

Has anyone/would anyone attempt updating this to work with both 3.5 and 2.7?

edmcdonagh avatar Sep 02 '16 10:09 edmcdonagh

Thanks for the heads up.

I have no idea how much work represents switching from 2.* to 3.* and if it has any expected deeper implications. (just replace the "print" statements? does any underlying library will break as well? etc.)

Being new to pynetdicom, I do not even know if it is good for me, that is why I am still weighting my options. I have been using DCMTK in the past and wanted to move to a pure python solution to avoid writing tons of wrapping functions...

NicolasRannou avatar Sep 02 '16 10:09 NicolasRannou

@NicolasRannou I came here looking for the same thing. All of the code in the repository seems to be written in Python (no C APIs or anything), so I think it should be fairly straightforward to convert. The only dependency I can see is pydicom, which supports python3 in the master branch.

stevenengler avatar Nov 06 '16 04:11 stevenengler

I agree that it may not be that big a job converting the code so it can run on python 3 but to my opinion, there are much larger things that need to be done. In my best dreams, I'd like to almost completely rewrite the code to make it more pythonic and more testable. Making any change in the code in its present form makes me unconfortable because I'm never sure that the change will not break anything. With a nicer, more modern code and a good suite of unit/functional tests I would certainly be happy to port it to python 3, or to make it compatible to both 2 and 3. That being said, I don't have time for this right now, but I will start to think at how this code refactoring could be done.

patmun avatar Nov 06 '16 19:11 patmun

I've created a fork for Python 3: pynetdicom3

scaramallion avatar Jan 09 '17 23:01 scaramallion

Fantastic! I'm very exited to see there are unit tests!

patmun avatar Jan 10 '17 02:01 patmun

@scaramallion Is Python 2 also supported in this fork, or only Python 3? Ping @spichardo

stevenengler avatar Jan 10 '17 19:01 stevenengler

Not at the moment, no.

scaramallion avatar Jan 11 '17 05:01 scaramallion

I have started a fork of pynetdicom3 compatible with both python 2.7 and 3.5, which I called, for the moment pynetdicom23. I took some inspiration from pydicom which supports both. So far, unit test almost all pass on both version, and I have tested echosc[u,p] and storesc[u,p] apps.

This pynetdicom3 is not only a python 3 port of pynetdicom, but it cleans up a lot of things, adds unit tests and a lot new documentation. Amazing work @scaramallion!

patmun avatar Jan 17 '17 01:01 patmun

Amazing work both of you @patmun and @scaramallion!

A 2+3 fork of pynetdicom gives my project OpenREM a future!

Really appreciate your work on this. Thanks.

edmcdonagh avatar Jan 17 '17 06:01 edmcdonagh