ESMG / pyroms

Python tools for the Regional Ocean Modeling System (ROMS)
Other
138 stars 88 forks source link

New version of NumPy not supporting SCRIP installation #47

Open chnrr1 opened 1 year ago

chnrr1 commented 1 year ago

as described in https://numpy.org/doc/stable/reference/distutils_status_migration.html#distutils-status-migration

numpy.distutils has been deprecated in NumPy 1.23.0, which affects the installation of SCRIP and bathy_smoother

Use python3.10 and numpy1.22 instead of the latest version

YoungEnzo commented 1 year ago

bro, I have successfully installed scrip. When I run the make_remap_weights_file.py, it reported an error..

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'

And I can also import the library successful...

(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 mpl_toolkits
>>> import lpsolve55
>>> from mpl_toolkits.basemap import Basemap
>>> import pyroms
>>> import pyroms_toolbox
>>> import bathy_smoother
>>> import pyroms.scrip
>>> 

Do you konw how to solve it? Thank you!

kshedstrom commented 1 year ago

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

I haven't been able to load scrip in years so I told pyroms to stop trying to load it.

numpy.distutils has been deprecated in NumPy 1.23.0, which affects the installation of SCRIP and bathy_smoother

This affects not just scrip, but a number of other files which still do load. This is a serious problem for the future of pyroms and I don't have a good answer for what to do about it. In an ideal world, someone would start over from scratch to create better, newer, more modern Python tools for ROMS, but it won't be me.

raickhr commented 1 year ago

The following worked for me:

copy "scrip.cpython-38-x86_64-linux-gnu.so" file from the "/home/enzo/pyroms/pyroms/pyroms/" folder to the "/home/enzo/pyroms/pyroms/pyroms/remapping" folder

add "import pyroms.remapping.scrip" to the file "/home/enzo/pyroms/pyroms/pyroms/remapping/compute_remap_weights.py"