Pyroms update
Pyroms update
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.
Anyway, let us know of any problems. I've got it working under Linux, but I have some wacky problems on the Mac.
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: Pyroms update
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?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.
Re: Pyroms update
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.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?
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: Pyroms update
General stuff: analysis of model output; generating input files. With an emphasis on nested grids.kate wrote:What are you planning to do exactly?
Does PyCNAL have a Python 3 version?
Re: Pyroms update
What is the advantage on moving the code from python2.7 to python 3?
Andres Sepulveda
------------------------------
Geophysics Department
University of Concepcion
------------------------------
Geophysics Department
University of Concepcion
Re: Pyroms update
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.
- m.hadfield
- Posts: 521
- Joined: Tue Jul 01, 2003 4:12 am
- Location: NIWA
Re: Pyroms update
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...andres wrote:What is the advantage on moving the code from python 2.7 to python 3?
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.
Re: Pyroms update
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.
Re: Pyroms update
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...