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

replace deprecated time.clock() in tests #245

Merged
merged 1 commit into from
Apr 11, 2019
Merged

Conversation

cjmayo
Copy link
Contributor

@cjmayo cjmayo commented Apr 6, 2019

Fix warnings and prepare for Python 3.8.

@snowman2
Copy link
Member

snowman2 commented Apr 6, 2019

I think a python 2/3 compatible solution would be good to add here.

@micahcochran
Copy link
Collaborator

The release of Python "3.8.0 final: Monday, 2019-10-21."

This could merged once this project has dropped Python 2.7 support. For the moment, I agree with @snowman2 for a solution compatible with both Python 2/3.

@cjmayo
Copy link
Contributor Author

cjmayo commented Apr 7, 2019

My mistake - I forgot I had been starting the process of removing Python 2 from my system.

Unfortunately I can't see a good solution that works for Python 2 and Python 3. I think it means going for either a potentially lower resolution time.time() or removing the timings completely. At least there is no immediate need as pointed out.

@snowman2
Copy link
Member

snowman2 commented Apr 7, 2019

You could instead use datetime.datetime.utcnow(), but I guess that is about the same as time.time().

@snowman2
Copy link
Member

snowman2 commented Apr 7, 2019

Maybe a try/except ImportError using as with a preference towards the new version would provide the solution.

@micahcochran
Copy link
Collaborator

Another way to do this might be to convert this code to some kind of benchmark package, which would involve more effort.

Recently, there have been some issues regarding performance concerns.

I do find it interesting the osx test should be running Python 3.6, but instead is running Python 2.7.

@snowman2
Copy link
Member

snowman2 commented Apr 8, 2019

I do find it interesting the osx test should be running Python 3.6, but instead is running Python 2.7.

I noticed it as well, but didn't fix it yet as it is not a huge problem until python2 support is dropped.

Fix warnings and prepare for Python 3.8.
@cjmayo
Copy link
Contributor Author

cjmayo commented Apr 8, 2019

Maybe a try/except ImportError using as with a preference towards the new version would provide the solution.

OK. That works. I went with as perf_counter thinking that although clock may not be equivalent (depending on platform) it would cause the least work when eventually dropping Python 2.

@snowman2
Copy link
Member

snowman2 commented Apr 8, 2019

Approved from my end. 👍

@snowman2 snowman2 requested a review from jswhit April 8, 2019 20:44
@snowman2 snowman2 merged commit bc92bda into pyproj4:master Apr 11, 2019
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

Successfully merging this pull request may close these issues.

4 participants