hainegroup / oceanspy

A Python package to facilitate ocean model data analysis and visualization.
https://oceanspy.readthedocs.io
MIT License
102 stars 32 forks source link

binder failed to build #249

Closed Mikejmnez closed 2 years ago

Mikejmnez commented 2 years ago

Description

The binder link on the documentation www.bndr.it/nakt7 is broken since it is still associated with the master branch. The "lazy/quick" fix to build the image (the image gets built after each PR merge) and successfully run the binder was to replace master by main on the link which allowed the image to build and notebooks to run. Only the URL was wrong, since the binder icon on the GH page correctly build the binder image and ran the notebooks.

However, another issue that needed to get fixed was to update the binder environment which we fail to do before. An updated environment requires to pin both xgcm and xarray to the previous version, the way we did recently for the Sciserver image, given the big internal refactoring changes that happened with those in the last couple of weeks. All this pinning down is just a temporary fix while we need to work on making Oceanspy compatible with the new changes to xarray and particularly with xgcm.

As a result of not having updated the binder environment both the Tutorial.ipynb and Live_Demo.ipynb notebooks presented errors.

On Live_Demo.ipynb the error arise in the following:

# Extract survey overlapping the mooring array
# Note: This function interpolates, getting rid of staggered grids
varList = ["Temp", "S", "U", "V"]
od_surv = od.subsample.survey_stations(
    Xsurv=lons_Kogur, Ysurv=lats_Kogur, delta=2, varList=varList
)

# Change background color
mpl.rcParams["axes.facecolor"] = ".25"

On Tutorial.ipynb the error arise when computing the Kinetic Energy (in the following cell):

ds_KE = ospy.compute.kinetic_energy(od_drop)
print(ds_KE)

od_KE = od_drop.compute.kinetic_energy()
print(od_KE.dataset)

The issue in all of these cases is associated with using xgcm to interpolate, and the errors are associated with chunking along core dimensions, an error we've been getting with the new refactoring changes to xgcm and xarray.

What I Did

I updated the environment file on the binder to somewhat follow the environment used to build the image on Sciserver. The changes can be seen in PR #248 . I merged this PR but now the binder fails to build. A snapshot of the final error is show below

Screen Shot 2022-08-16 at 4 33 05 PM

You can check the full logs of the error in the attached file

binder_logs.pdf

I kind of rushed to get this done in the wee hours last night, a bit last minute before the workshop in Bergen (since we fail to catch this issue earlier), thinking the merged PR wouldn't cause any issues. I was wrong. I will continue to work on this in the next day or so. Expect a new PR solving this issue in the next couple of days.