modelop / hadrian

Implementations of the Portable Format for Analytics (PFA)
Apache License 2.0
130 stars 49 forks source link

Python 3 support #35

Closed bmwilly closed 5 years ago

bmwilly commented 7 years ago

Is there a reason why Python 3 is not supported?

brendanlong commented 7 years ago

And would you be open to pull requests to add Python 3 support?

mahowald-odg commented 7 years ago

@bmwilly : The only reason Python 3 isn't currently supported is that we haven't gotten around to implementing it yet. @brendanlong : Sure, send us your pull requests!

animator commented 7 years ago

For those who are looking for a Python 3 version of titus, I have created a fork - https://github.com/animator/titus2

It is still in experimental stages and I will update on this thread when it is stable.

tyarkoni commented 5 years ago

Is this repository still actively maintained? I have a mostly-working version of titus that adds Python 3 support (I estimate the work is ~80% done). Is there any interest in a PR?

animator commented 5 years ago

hi @tyarkoni .. I have updated the repository link above. It is a working (~ 80%-90% ) version of titus Python 3 implemention .. I was busy with another project so couldn't finish the port. I am open to collaborate (on your source or mine or a combined version, we can discuss ) to speed up the process. Please let me know.

animator commented 5 years ago

Attached test log of the port (still not release ready). Unit Test Report.pdf

tyarkoni commented 5 years ago

Oh, hah—I assumed you'd abandoned your effort since the link was broken. Should have dug a little further; it would probably have saved me some work. :)

It looks like your port is farther along than mine (see fork here). I still have about 130 tests failing, , though it seems like we have the same pain points left (notably, the Tree and Regex functionality). I haven't compared the code bases in any detail; have you done any major refactoring or optimization, or is it pretty much a direct port? In my case I've made as few changes possible to get things working (with the exception of renaming all the test modules to ensure compatibility with PEP8 and py.test).

I guess the only potential benefit I can see to my approach is that I've tried to maintain 2/3 compatibility in the same codebase (the Python 2 tests are nearly all passing, and I'm slowly fixing the Python 3 failures). I think if the maintainers here have any interest in keeping this repo alive, it would be nice to support both versions going forward. But if this is basically abandonware at this point, then I'd definitely support dropping Python 2 support and working from your port.

animator commented 5 years ago

It looks like your port is farther along than mine (see fork here). I still have about 130 tests failing, , though it seems like we have the same pain points left (notably, the Tree and Regex functionality). I haven't compared the code bases in any detail; have you done any major refactoring or optimization, or is it pretty much a direct port? In my case I've made as few changes possible to get things working (with the exception of renaming all the test modules to ensure compatibility with PEP8 and py.test).

Tree is the only major pain point left. The tests are run on a Windows environment so Regex is failing, it will work perfectly fine on Linux machine. I have also tried making few changes along the way and just made 1 major change [Read below].

I guess the only potential benefit I can see to my approach is that I've tried to maintain 2/3 compatibility in the same codebase (the Python 2 tests are nearly all passing, and I'm slowly fixing the Python 3 failures). I think if the maintainers here have any interest in keeping this repo alive, it would be nice to support both versions going forward. But if this is basically abandonware at this point, then I'd definitely support dropping Python 2 support and working from your port.

My port is a pure Python 3 port with no back compatibility as Python 2 is near the end of its lifecycle. To ensure proper Python 3 compatibility, I moved my code to use avro-python3. They have made some changes in the avro code which I had to incorporate in my port.

tyarkoni commented 5 years ago

@animator sounds good, let's move forward with your port. Do you have a list of remaining action items? I can try to help out. (FWIW, I have a fairly specific use case in mind that doesn't include most of the currently failing tests, so getting to 100% isn't that critical, from my perspective).

I'll close my PR here and open an issue for discussion on your repo.

bmwilly commented 5 years ago

I'm happy to close this issue out so that you all can track your progress elsewhere. I no longer use PFA and it's clear that it is no longer actively maintained.

animator commented 5 years ago

@tyarkoni please go ahead and open up an issue on my repo. We can discuss and create a plan. @bmwilly thanks for creating this issue thread, please go ahead and close this issue.

tyarkoni commented 5 years ago

@bmwilly thanks for the update. Out of curiosity, have you found an alternative/better standard or open-source tool that meets the same need, or are you just not working in this space any more? I ask because I'm not wedded to PFA any more and am in principle open to exploring other open-source solutions roughly in the same space (especially if they're actively maintained!).

bmwilly commented 5 years ago

@tyarkoni I currently use serialized model files (e.g., Pickle) and serverless functions (OpenFaaS) to put models into production.

Unfortunately, I don't think there is a completely comparable alternative to PFA, which is a shame!

animator commented 4 years ago

Hi everyone,

With the sunset of Python 2 by the end of this year, I am glad to inform that Titus is now fully supported in Python 3.4-3.8. Please head to this repo - https://github.com/animator/titus2 The migrated code is passing all unit tests and conformance tests. Please don't forget to star the project in case you find it useful.

Cheers, Ankit