-
Notifications
You must be signed in to change notification settings - Fork 176
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
Python3new #90
Python3new #90
Conversation
Any timescale for when this might get merged? |
@paulray Not quite sure. A lot of the basic infrastructure code has been changed and at least basically checked, but most of the python applications have not yet been. That will take some effort. I'm hoping to work on it some more this week and next. I'd like to have it all merged in by the end of the month. If there is any code that you use that you might be able to easily test, that would be appreciated! |
I've just cloned this branch on my linux box. I'm running Python 3.6.6. It compiles fine, once I add "gfortran" to pgplot_libraries in setup.py. And it passes test_presto_python.py. So far, so good. I'll try to run some other tests. |
Yeah, all that stuff looks good. I'm worried mostly about a bunch of the *.py files in $PRESTO/bin. And also about many of the useful scripts in $PRESTO/python. Issues with integer division are what worry me the most. |
Yeah, I see what you mean. I tried single_pulse_search and it doesn't work with either 2 or 3!
|
I see that you now have to Also, I think that probably there should now be a $PRESTO/lib/python2.7 and $PRESTO/lib/python3.6 so that compiled versions of the codes are separate. Is that a good idea? Or, in the end the best solution may be to make it a python package so it gets installed in the appropriate site-packages directory and not to use PYTHONPATH, which is a bit of a hack. |
lib/python/pypsrcat.py
Outdated
m = -m | ||
s = -s | ||
self.dec = psr_utils.dms_to_rad(d, m, s) | ||
if parts[part_index].split(":")[0]=="-00": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I strongly recommend that parsing angle strings like this be done in astropy, so that dec=-0 bugs and the like don't creep in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup. That is old code that I have already flagged to convert. I'm going to update the way that the ATNF pulsar data are imported as well. Just haven't had time to do it yet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I figured. I just like to pester you :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't blame you! I'd pester me too! That code is atrocious!!!
Fixed python2 --> 3 issues with float vs integer division and str vs byte types
be used as a slice index in arrays
Explicitly cast 'bins' as integer in 'rotate' function so that it can
Any updates on when this might be merged? I'd like to switch to Python3 as my default python, but I don't want to lose psr_utils and all the PRESTO stuff |
Hopefully soon! I'm traveling a bunch over the next 3 weeks, though, so
it certainly won't happen before then.
Have you tried using it as your main branch? That would be a really
good idea if you can do it since it might help catch some of the last bugs.
And note that I'll probably actually merge this one:
#94
which is based on Python3New.
Scott
…On 6/3/19 9:47 AM, Paul Ray wrote:
Any updates on when this might be merged? I'd like to switch to Python3
as my default python, but I don't want to lose psr_utils and all the
PRESTO stuff
—
--
Scott M. Ransom Address: NRAO
Phone: (434) 296-0320 520 Edgemont Rd.
email: sransom@nrao.edu Charlottesville, VA 22903 USA
GPG Fingerprint: A40A 94F2 3F48 4136 3AC4 9598 92D5 25CB 22A6 7B65
|
OK, so if I want to try that, and I have a clone of sransom/presto, what branch should I checkout? |
Hmmm. Well, it is probably easiest to install the python3new branch, since that is actually a branch. Although it isn't quite up-to-date with the pull request that I mentioned above. And now I notice that it has some conflicting files since I've since updated master. Maybe I can see if I can re-base it on the most recent master to help that a bit. |
be used as a slice index in arrays
OK. So I just fixed those merge conflicts. @paulray you should try to use this branch and see if you get any issues. |
Thanks! I'm taking the plunge! I've made my default Python 3.6, with this PRESTO branch. We'll see how it goes... |
I know that some stuff will work. But I also know that there are almost certainly going to be a bunch of issues. Thanks for trying this! |
Closing this because I finally merged #106 |
This is work-in-progress, based on a bunch of work by @matteobachetti ( see #72 ) to allow both Python 2 and Python 3 in PRESTO.