Ocean Modeling Discussion

ROMS/TOMS

Search for:
It is currently Thu Feb 22, 2018 8:30 pm




Post new topic Reply to topic  [ 9 posts ] 

All times are UTC

Author Message
 Post subject: Pyroms update
PostPosted: Thu Jan 11, 2018 2:00 am 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3316
Location: IMS/UAF, USA
I have created a python3 branch of the pyroms repository on github. This is much like the previous PyCNAL repository, but the guys want to start fresh with all new PyCNAL code.

Anyway, let us know of any problems. I've got it working under Linux, but I have some wacky problems on the Mac.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Tue Jan 23, 2018 4:02 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 497
Location: NIWA
kate wrote:
I have created a python3 branch of the pyroms repository on github. This is much like the previous PyCNAL repository, but the guys want to start fresh with all new PyCNAL code.


So, if I want to develop my own ROMS Python 3 code (using existing packages like xarray) but also want to build on (and sometimes contribute to) the best existing Python code, should I use your pyroms/python3 or should I use PyCNAL?


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Tue Jan 23, 2018 5:15 am 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3316
Location: IMS/UAF, USA
m.hadfield wrote:
So, if I want to develop my own ROMS Python 3 code (using existing packages like xarray) but also want to build on (and sometimes contribute to) the best existing Python code, should I use your pyroms/python3 or should I use PyCNAL?

What are you planning to do exactly? If you want feedback from the guys, they're more likely to see it if you create a PyCNAL issue on github.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Wed Jan 24, 2018 4:44 am 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 497
Location: NIWA
kate wrote:
What are you planning to do exactly?


General stuff: analysis of model output; generating input files. With an emphasis on nested grids.

Does PyCNAL have a Python 3 version?


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Wed Jan 24, 2018 2:53 pm 
Offline

Joined: Tue May 06, 2003 4:35 pm
Posts: 52
Location: University of Concepcion
What is the advantage on moving the code from python2.7 to python 3?

_________________
Andres Sepulveda

------------------------------
Geophysics Department
University of Concepcion


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Wed Jan 24, 2018 4:22 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3316
Location: IMS/UAF, USA
I believe code that runs on version 3 should also run on version 2.7, so there should be no downside. One colleague of mine is running python in a gui that's only version 3 and I've switched to version 3 when we switched supercomputers. It was time.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Wed Jan 24, 2018 8:55 pm 
Offline
User avatar

Joined: Tue Jul 01, 2003 4:12 am
Posts: 497
Location: NIWA
andres wrote:
What is the advantage on moving the code from python 2.7 to python 3?


I'm approaching this as someone who has used Python (version 2) for many years as a scripting language but is looking to adopt it as my main language for data analysis. I have looked at various discussions like this...

https://learntocodewith.me/programming/ ... -python-3/

...and decided provisionally to adopt Python 3, because it's cleaner in various ways and (I think) more future-proof. And now, 3.5 years after the above discussion was written, most libraries are available in Python 3 versions.

So I guess my, selfish answer to your question is, "To make it easier for me to use it."

Kate can advise about what's involved in rewriting the code, but I don't think it's too difficult. The main tasks seem to be rewriting the string formatting to the new style (which also works in 2.7, I believe) and the exception handling.

Most libraries are available in both flavours of Python. I haven't yet looked at how they achieve that.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Wed Jan 24, 2018 10:13 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3316
Location: IMS/UAF, USA
Most of the code conversion can be accomplished with the "2to3 -w" command. For pyroms, what's left over is mostly converting tabs to spaces - python 3 is pickier about that.


Top
 Profile  
Reply with quote  
 Post subject: Re: Pyroms update
PostPosted: Tue Jan 30, 2018 9:09 pm 
Offline
User avatar

Joined: Wed Jul 02, 2003 5:29 pm
Posts: 3316
Location: IMS/UAF, USA
I downloaded the latest PyCNAL. It's pretty bare bones at this point, but you can follow it on github to find out about updates. What's there now is a remapping tool for generating MOM6 boundary files using ESMPy. If you're sticking with ROMS, stick with pyroms. For now...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group