Skip to content
This repository has been archived by the owner on Apr 30, 2021. It is now read-only.

Use io.open instead of just open #11

Merged
merged 1 commit into from
Dec 19, 2018

Conversation

mnlevy1981
Copy link
Contributor

Python 2 doesn't support open(encoding=...)

Python 2 doesn't support open(encoding=...)
@kmpaul
Copy link

kmpaul commented Dec 6, 2018

Do we care about python 2 anymore?

@mnlevy1981
Copy link
Contributor Author

Yup - the CESM postprocessing utilities rely on the NCAR python library which is still based on 2.7. I have a library I'd like to add to the postprocessing scripts, and the plan is to have it depend on esmlab.

@andersy005
Copy link
Contributor

andersy005 commented Dec 6, 2018

Do we care about python 2 anymore?

I was surprised when I found out that https://github.com/NCAR/CESM_postprocessing is still 2.7.

Earlier this year, xarray decided that it is dropping support for Python 2 by the end of 2018. Same thing for NumPy and Pandas. IMO, it makes sense to move forward with Python 3.

To sound optimistic, I think we should focus on Python 3 and try to nudge the upstream development of CESM_postprocessing and NCAR python library to switch to Python3. I understand that this might not be an easy task and maybe not a good use of our time :)

Do we know whether there is some timeline for when CESM_postprocessing and NCAR python library will switch to Python 3? In case, these tools are going to still support Python 2 in 2020, it makes sense to care about Python 2 compatibility maybe?

ref:

@mnlevy1981
Copy link
Contributor Author

mnlevy1981 commented Dec 7, 2018

I can't imagine CESM_postprocessing making the jump from py2 to py3 before the CMIP analysis is done, but I did file an issue. In the meantime, I think it would be prudent for esmlab to support python 2.

@kmpaul
Copy link

kmpaul commented Dec 7, 2018 via email

@kmpaul
Copy link

kmpaul commented Dec 7, 2018

Unless we expect the CESM post-processing code to use esmlab in the near future, we should expect for them to upgrade to Python 3. Everyone should, at this point, and not making this Python 3 now adds extra work for us down the road.

@mnlevy1981
Copy link
Contributor Author

Why? Is there supposed to be some dependency on CESM post processing here? Why isn’t this independent of the other CESM code?

Are you asking why I think CESM postprocessing is going to continue to rely on a python 2 environment until after the CMIP analysis is done? Because it's tens of thousands of lines of code written and tested in python 2, and I think it's unreasonable for the few people developing it to make the python 3 conversion a priority.

Unless we expect the CESM post-processing code to use esmlab in the near future

I want to incorporate marbl-diags into CESM postprocessing ASAP, and I also want marbl-diags to rely on esmlab when it needs to operate on xarray datasets.

@kmpaul
Copy link

kmpaul commented Dec 7, 2018 via email

@kmpaul
Copy link

kmpaul commented Dec 7, 2018

Look at the six package for help.

@mnlevy1981
Copy link
Contributor Author

Then we need to make it compatible with both 2 and 3.

Thanks! I understand that this is adding more work for minimal gain, but hopefully we don't have to go too far down this path before esmlab can go back to just being python 3-compatible.

@andersy005
Copy link
Contributor

@mnlevy1981, this looks good to me!

@andersy005 andersy005 merged commit 16a5c63 into NCAR:master Dec 19, 2018
@mnlevy1981 mnlevy1981 deleted the more-py2-compat branch March 4, 2019 22:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants