-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Single source Python 2 and 3 #473
Conversation
…D arrays. `ravel()` produces 1D arrays. In numpy prior to 1.10 `concatenate()` took any number for `axis``. This is not allowed anymore. Droping `axis` works since the default is `0`.
First off, thank you very much for this contribution! There are a few issues I'd like to see addressed before adoption:
Addresses #432 |
Thanks for your response. All your points are totally valid. Let's see this PR as a proof-of-concept that has some (serious) "procedural" issues.
I would suggest to take this PR as a basis to work from. Basically, don't merged anything into FiPy now but re-do things based on what I've learned. Next steps cold be:
|
OK, great. I think we're on the same page.
|
The survey results are unambiguous (although I'd like to think we have more than 29 people using FiPy). Please proceed with using python-future to make FiPy work with both Python 2.x and 3.x. Let me know what branch you're working on and I can monitor and comment there. |
Great to hear. I will get started. BTW, I cannot see the survey results. I only get a survey monkey login page. |
Survey results are now published at https://www.surveymonkey.com/results/SM-2CDMMVQJ/ |
Any updates on this? |
Fair enough. I'll probably end up maintaining a straight "futurize" branch for the time being, then. At least it sounds like backward compatibility is only necessary as far back as 2.6, which makes things much easier. |
Actually, there's been nothing to address. @pya was going to submit incremental pull requests. Somebody else is welcome to take this on, but this pull request as written will never be merged. |
Thanks for bringing this up again. I was about to start working on this but had a few urgent things on my plate for the last months. I will probably do something here, starting in a week or so. |
I've been working on it too, in the meantime. I broke up the process of futurizing the code into a few smaller steps, and I've been making sure that tests pass (in Python 2) as I go. You can check out my branch here: https://github.com/woodscn/fipy/tree/python23v2 Edit: fixed link |
We completely understand, Mike. Glad to hear you both are willing to tackle this. |
I am enjoying using this library a lot, only tempered by having to go back to python2. I would be able to find some effort in the coming weeks to help the python 3 port. Can somebody please explain what's the best place to contribute this effort? |
@achennu Thanks for offering, but I'm not sure what you mean by "best place to contribute". Do you mean how do you do a pull request? Or how do you do the Py3k conversion? Or ...? Ultimately, we need a pull request against usnistgov/fipy. That pull request can be forked from @woodscn's effort, or you can start fresh. The items I requested of @pya in this pull request would all still apply. |
Yes I know how to make PRs. I have ran a 2to3 version before and it mostly
ran. While trying to solve equations though, I got errors relating to wrong
opcodes. As I didn't know how to solve that, I stopped.
I can look into this. Just to clarify: idea would be to move to a common
code supporting python 2.7+ and 3.5+.
…On Thu, Mar 1, 2018, 01:26 Jonathan Guyer ***@***.***> wrote:
@achennu <https://github.com/achennu> Thanks for offering, but I'm not
sure what you mean by "best place to contribute". Do you mean how do you do
a pull request? Or how do you do the Py3k conversion? Or ...?
Ultimately, we need a pull request against usnistgov/fipy. That pull
request can be forked from @woodscn <https://github.com/woodscn>'s
effort, or you can start fresh. The items I requested of @pya
<https://github.com/pya> in this pull request would all still apply.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#473 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AH7JDE3EZAOTPQ91njycgvd0S45uluXWks5tZ0AzgaJpZM4GeRE0>
.
|
Fixed by #645 |
Many new Python users (rightfully) start with Python 3. Therefore, having FiPy support Python 3 out-of-the box would be very valuable.
This version runs all 195 tests in
example/test.py
with Python 2.7, 3.4, and 3.5 (with the same source). It uses the very good libraryfuture
(http://python-future.org/). This allows to test all changes immediately against Python 2.7 and Python 3.Further development can take advantage of
future
by programming in Python 3 style (thinkrange
,zip
,map
etc.) and still support Python 2.7. In the distance future, when Python 2.7 support is discontinued, only the imports fromfuture
need to be removed to get a pure Python 3 version.