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

General scientific issues regarding ROMS

Moderators: arango, robertson

Post Reply
Message
Author
Zeng
Posts: 26
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: 4091
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: 4091
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: 26
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:

aswathy121
Posts: 1
Joined: Thu Aug 08, 2024 1:01 pm
Location: IIT Kharagpur

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

#6 Unread post by aswathy121 »

aswathy@DESKTOP-1BJKGLH:~/pyroms/Palau_HYCOM$ python3 make_remap_weights_file.py
Assuming spherical is integer b'T' <class 'numpy.ma.core.MaskedArray'>
Load geographical grid from file
grid shape 20 10
grid shape 20 9
grid shape 19 10
Traceback (most recent call last):
File "/home/aswathy/pyroms/Palau_HYCOM/make_remap_weights_file.py", line 29, in <module>
pyroms.remapping.compute_remap_weights(grid1_file, grid2_file, \
File "/home/aswathy/pyroms/pyroms/pyroms/remapping/compute_remap_weights.py", line 42, in compute_remap_weights
pyroms.remapping.scrip.compute_remap_weights('compute_remap_weights_in')
AttributeError: module 'pyroms.remapping' has no attribute 'scrip'


I'm getting this error. please help

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

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

#7 Unread post by kate »

It has been YEARS since I got scrip to work. Should I take down all reference to it? Should I just take down pyroms entirely as unsupported? Anyway, follow the xesmf example instead.

Post Reply