Skip to content

Update for python 2/3 #24

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

Open
durack1 opened this issue Jun 19, 2018 · 13 comments
Open

Update for python 2/3 #24

durack1 opened this issue Jun 19, 2018 · 13 comments
Assignees

Comments

@durack1
Copy link
Owner

durack1 commented Jun 19, 2018

@pochedls over to you

@durack1 durack1 self-assigned this Jun 20, 2018
@durack1
Copy link
Owner Author

durack1 commented Jun 20, 2018

Updates

  • print
  • try/except
  • replace (string)
  • ?

@durack1
Copy link
Owner Author

durack1 commented Jun 25, 2018

@pochedls when you get around to getting a first cut, it would be great to get this dropped in a branch - let me know if you need write access to the repo..

I just started migrating myself to py3, and hit problems with this library (as you said!)

@pochedls
Copy link
Collaborator

@durack1 - I think I got this library to the point where I could import it without error and use trimModelList, but I think I broke Python 2. I could push what I have in a branch if you'd like to look at it or in a couple days I'll have more confidence in my modifications.

@durack1
Copy link
Owner Author

durack1 commented Jun 25, 2018

@pochedls perfect, if you want to push this to a branch then I can start trying this out with py2, then you can work to ensure py3 works, and I can make sure it's still working in py2..

pochedls added a commit that referenced this issue Jun 25, 2018
@pochedls
Copy link
Collaborator

@durack1 - I just pushed branch py23. I think one issue (others will surely popup) is that urllib and urllib2 are different.

I'd appreciate if you took a look at this logic. Or I could come up with a couple cases and check-in with you if we have the right behavior when you're back in town.

@durack1
Copy link
Owner Author

durack1 commented Jun 26, 2018

@pochedls it imports, nice.. Not sure I'd be able to test this until I get back, but looks like you've done most of the work, thanks!

@lee1043
Copy link

lee1043 commented Dec 4, 2018

@durack1 @pochedls just following up with this issue, any update? Can I use the durolib in Python 3 env? Thanks.

@pochedls
Copy link
Collaborator

pochedls commented Dec 4, 2018

Not sure... I also don't think durolib is not setup to work with the new xml files. I think I wrote a function that deals with the new files in Python 3. Shoot @durack1 and I an e-mail and we can discuss implementation.

@durack1
Copy link
Owner Author

durack1 commented Dec 4, 2018

@lee1043 what function(s) are you using in durolib? @pochedls is right, a couple of the functions are not python3 friendly yet, I was hoping to do this but hit some problems that @pochedls highlighted..

@lee1043
Copy link

lee1043 commented Dec 4, 2018

@durack1 I use trimModelList, is it possible just make this function python3 friendly?

@durack1
Copy link
Owner Author

durack1 commented Dec 4, 2018

@lee1043 this is the difficult one, as py3 vs py2 changed the logic of lists etc.. @pochedls can elaborate.. I think he mostly ported the function across.. It has already been updated to deal with the new CMIP6 paths..

@lee1043
Copy link

lee1043 commented Dec 4, 2018

@durack1 it would be helpful even before py3. @pochedls could you please point me the durolib version that work with new cmip-dyn? Thanks!

@durack1
Copy link
Owner Author

durack1 commented Dec 4, 2018

@lee1043 the current 1.1.1 release of durolib should work with cmip-dyn in py2, the py3 version is on the py3 branch (see here) but wasn't updated with the cmip-dyn logic on the new paths

durack1 added a commit that referenced this issue Oct 10, 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

No branches or pull requests

3 participants