module 'pyroms.remapping' has no attribute 'scrip'

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Zeng
Posts: 27
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

module 'pyroms.remapping' has no attribute 'scrip'

#1 Unread post by Zeng »

Hello, everyone!
Thanks for your attention. Due to my hard drive breaking, I had to rebuild the ROMS environment. I have already successfully installed ROMS and PYROMS, but when I run the make_remap_weights_file.py, it reported an error:

Code: Select all

(base) enzo@enzo:~/pyroms/inputfiles/yangjiang$ python make_remap_weights_file.py 
Assuming spherical is integer b'T' <class 'numpy.ma.core.MaskedArray'>
Load geographical grid from file
grid shape 750 1100
grid shape 750 1099
grid shape 749 1100
Traceback (most recent call last):
  File "/home/enzo/pyroms/inputfiles/yangjiang/make_remap_weights_file.py", line 33, in <module>
    pyroms.remapping.compute_remap_weights(
  File "/home/enzo/pyroms/pyroms/pyroms/remapping/compute_remap_weights.py", line 41, in compute_remap_weights
    pyroms.remapping.scrip.compute_remap_weights('compute_remap_weights_in')
AttributeError: module 'pyroms.remapping' has no attribute 'scrip'
I am so confused, because I can import it in the python: :cry:

Code: Select all

(base) enzo@enzo:~/pyroms/inputfiles/yangjiang$ python
Python 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy
>>> import lpsolve55
>>> import mpl_toolkits
>>> from mpl_toolkits.basemap import Basemap
>>> import pyroms
>>> import pyroms_toolbox
>>> import bathy_smoother
>>> import pyroms.scrip
>>> 
Kate suggests using XESMF instead of SCRIP which I am doing, but since I am not very familiar with Python, I need time to learn how to modify the remap*.py. if someone could tell me how to solve the problem with Scrip, I would be very grateful! After all, this may be a bit simpler for me. I use the ubuntu22.04, python 3.10, and installed all dependent libraries with conda. I am very grateful for any of your suggestions!

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: module 'pyroms.remapping' has no attribute 'scrip'

#2 Unread post by kate »


abiola
Posts: 6
Joined: Sat Dec 03, 2022 5:05 pm
Location: Florida Atlantic University

Re: module 'pyroms.remapping' has no attribute 'scrip'

#3 Unread post by abiola »

HI Zeng,

Open the compute_remap_weights.py file, edit your first 4 lines to:
import os
import pyroms
from pyroms import _remapping
from pyroms.remapping import scrip

Regards

User avatar
kate
Posts: 4088
Joined: Wed Jul 02, 2003 5:29 pm
Location: CFOS/UAF, USA

Re: module 'pyroms.remapping' has no attribute 'scrip'

#4 Unread post by kate »

My latest code is not even trying to load scrip because I commented out these two lines:
```
try:
from pyroms import scrip
```
from pyroms/pyroms/remapping/__init__.py

I got tired of all those scrip warnings! If you really, really want to try loading scrip, uncomment them out again.

Zeng
Posts: 27
Joined: Mon Sep 19, 2022 1:06 pm
Location: Sun Yat-Sen University

Re: module 'pyroms.remapping' has no attribute 'scrip'

#5 Unread post by Zeng »

Dear, abiola and Kate, thank you for your kindly and helpfule suggestions! I am so sorry about my late reply. :cry:
I rerun the scripts, it works after I added the import words as you said!!!! :D :D
This error confused me for several days, and abiola and Kate, you have all helped me more than once. Words cannot express my sincerely gratitudes. Thank you for million times! :lol: :lol: :flower: :flower:

Post Reply