Skip to content
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

Support for PySD in Python 3.x #53

Closed
JamesPHoughton opened this issue Feb 10, 2016 · 6 comments
Closed

Support for PySD in Python 3.x #53

JamesPHoughton opened this issue Feb 10, 2016 · 6 comments

Comments

@JamesPHoughton
Copy link
Collaborator

Sometime in the near future we should figure out how to support both python 2 and python 3.

There seem to be two major pathways:

  1. Maintain the codebase in python 2 and use tools like 2to3 or modernize or futurize in order to generate python 3 code from the python 2 base.
  2. Maintain the codebase in python 3, and use tools like python-future to allow imports into python 2 environments.

For now I'm leaning towards the first option, as that's where the codebase is currently. If it turns out that a lot of the libraries we want to interface with for model analysis require 3, then we can change strategy.

Dev pathway for this probably looks like creating a fork of the current, non-subscripted master branch to to work in. It'll be simpler than trying with the subscripted version, at least until that is cleaned up. Then we can offer a python 3 version of the current codebase on pypi, and repeat the process when we're ready with the subscripted branch.

I expect we'll need to generate some sort of script to run the conversion tools and place new files in their own (python3) directory. Then we'll need to include the conversion and python 3 execution in the unit tests, so that when we make changes in the python2 codebase, we know they don't break the python3 implementation.

@JamesPHoughton
Copy link
Collaborator Author

Thinking now that we do use python3 compatible code with import x from __future__.

Would be good to set up a Tox testing framework on Travis to check against.

This was referenced Jul 28, 2016
@JamesPHoughton
Copy link
Collaborator Author

Resolved this by writing code that was 2/3 compatible. Tests on 158716b pass both 2.7 and 3.5.

@osychenko
Copy link

osychenko commented Jul 24, 2017

Is it Py3-compatible? The documentation's still saying "PySD is built on python 2.7, and may not work as advertized on 3.x." Also, the whole lot of manuals and examples is based on python2, as far as I can see.

@JamesPHoughton
Copy link
Collaborator Author

Yes, you should be able to run on python 3. I haven't gotten around to updating docs (classes, research, etc.). If you've got an interest in helping with the docs, though, I'd love to have the help!

@osychenko
Copy link

Yes, James, I would surely be glad to help with the docs. I have noticed some points that I would expand and/or rectify. How would I do that? And thank you for this unique piece of work, indeed.

@JamesPHoughton
Copy link
Collaborator Author

I'm going to move the discussion to: #123, as this work deserves it's own issue. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants