Hello CROCO Community,
I am running into an error while attempting to generate boundary files (make_bry.py) using the Python preprocessing tools (pytools_X) for a Bay of Bengal setup.
The script crashes during the horizontal interpolation of sea surface height (ssh) from GLORYS data, specifically throwing an AttributeError related to the pyinterp backend.
Environment Details:
-
Python Version: 3.11
-
Input Data: GLORYS Mercator data
-
Boundary being processed: South
Error Traceback:
Plaintext
Interpolate ssh
Traceback (most recent call last):
File "make_bry.py", line 54, in <module>
main()
File "make_bry.py", line 50, in main
croco.create_bry()
File "Modules/croco_class.py", line 289, in create_bry
self.bry = create_bry(self.config)
^^^^^^^^^^^^^^^^^^^^^^^
File "Modules/ibc_tools.py", line 368, in create_bry
crocovars, extrapolators = compute_ibc_core(
^^^^^^^^^^^^^^^^^
File "Modules/ibc_tools.py", line 488, in compute_ibc_core
zeta, extrapolator_zeta = interp_horiz(
^^^^^^^^^^^^^
File "Modules/interp_tools.py", line 102, in interp_horiz
tmpvar = val_interpolator.bilinear(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "site-packages/pyinterp/backends/xarray.py", line 318, in __getattr__
return getattr(self._instance, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'GridHolder' object has no attribute 'bilinear'
Relevant Code Block (interp_tools.py around line 102):
Python
# Perform pyinterp bicubic interpolation on CROCO grid
val_interpolator = pyxr.Grid2D(data_array)
tmpvar = val_interpolator.bilinear(
coords=dict(lon=crocogrd.lon.ravel(), lat=crocogrd.lat.ravel()),
num_threads=1,
).reshape(crocogrd.lon.shape)
Questions:
-
Is this a known incompatibility between recent versions of the
pyinterplibrary (which seem to have deprecated or renamed.bilinear()) and the currentpytools_Xcode? -
What is the recommended or stable version of
pyinterprequired for CROCO Python preprocessing? -
Should I manually patch
interp_tools.pyto use.bivariate()instead of.bilinear(), Or is there a standard environment file I should use to downgrade conflicting packages?
Any guidance or workarounds would be greatly appreciated!
Thank you, Asish