pydata / patsy

Describing statistical models in Python using symbolic formulas
Other
954 stars 104 forks source link

pass whole module code over 2to3 filter #192

Closed kloczek closed 11 months ago

kloczek commented 1 year ago

Remove python 2.x syntax by use 2to3 script.

bashtage commented 1 year ago

A few substitutions can be skipped it looks like it. The unicode to str all appear unnecessary, as do the long to int. Also many of the print statement changes are inserting unnecessary parentheses.

kloczek commented 1 year ago

OK NP .. so just please close this PR and pass the code over 2to3 filter and fix manually what you thing that should look a biot different 😋

bashtage commented 1 year ago

You can just make some changes and commit them in a new commit. patsy is in long term maintenance mode, and will eventually fall over in pandas 2.x when is_categorical_dtype is removed, unless that is patched. The best odds of getting a PR accepted would be to make it as minimal as possible.

kloczek commented 1 year ago

Issue is that use python 2.x syntax blocks two things:

Sphinx fails even with that PR but to fix that issue as well this one needs to be sorted out first.

matthewwardrop commented 11 months ago

Thanks for taking the time to propose these changes @kloczek ; but as @bashtage mentioned, this project is in heavy maintenance mode. I will step in to fix issues associated with retaining existing functionality as Python evolves for at least a little longer, but I have no intention of making invasive changes or dropping support for Python 2.x / etc.

Regarding the documentation problems, I will work around this by holding back sphinx rather than updating everything to Python 3; assuming it is necessary (but since we don't plan on adding features, the current docs are probably fine).

If you want modern formula tooling, please consider using formulaic instead.

(With that said, if there are specific bugs that are affecting you, feel free to put up a patch and it will likely get merged).