psyplot / psy-transect

Visualize and explore transects with psyplot
https://psyplot.github.io/psy-transect/
0 stars 0 forks source link

use apply_ufunc instead of xr.ufuncs #2

Closed Chilipp closed 1 year ago

Chilipp commented 1 year ago

@AnnikaLau could you please try whether this fixes the issue you have in #1? You should be able to install this branch via

pip install git+https://github.com/psyplot/psy-transect.git@fix-ufuncs

closes #1 closes #3

AnnikaLau commented 1 year ago

Thank you! This fix solves the ufuncs error but unfortunately a new issue appears, which is probably independent.

Chilipp commented 1 year ago

@AnnikaLau , my apologies for the delay. I found the issue for #3 and actually I am not sure, whether the issue is on my side here or on the side of xarray. The issue is here

https://github.com/psyplot/psyplot/blob/131e7dc45a6cfd2a963080ec83fa343da362b89d/psyplot/data.py#L831-833

xarray wants to access a variable in a call to DataArray.sel (namely the ncells variable) that, however, has not been provided as an indexer

I don't know why it tries to do that, but anyway, there is no need for the ncells coordinate anymore once the transect has been selected, so I implemented a fix in 44491f2 an remove it

please try again and tell me if it works

AnnikaLau commented 1 year ago

Yes it works! Thank you very much for the fix and the explanation! I might have a similar issue somewhere else, so that might help me to also fix that.

Chilipp commented 1 year ago

alright! thanks. I will merge it then