pyschism icon indicating copy to clipboard operation
pyschism copied to clipboard

replace `cf` with `xarray` to remove dependency on `udunits2`

Open ghost opened this issue 4 years ago • 2 comments

cf requires udunits2, which adds an extra non-Python dependency (udunits-bin) to installation

cf is currently used by SfluxDataset to read from disk to a Python object: https://github.com/schism-dev/pyschism/blob/d5ae2a0d29da85bd2a265a4b49aaacd3fa7d2263/pyschism/forcing/atmosphere/nws/nws2/sflux.py#L9 https://github.com/schism-dev/pyschism/blob/d5ae2a0d29da85bd2a265a4b49aaacd3fa7d2263/pyschism/forcing/atmosphere/nws/nws2/sflux.py#L326

To remove the reliance on udunits2, we should explore the possibility of using xarray here instead.

ghost avatar May 10 '21 15:05 ghost

Update: There are several additional issues with cf-python. We are planning on switching cf-python with xarray in the near-future, but it will have to wait because of some other priorities/time constraints. The workaround for the time being is to use conda to install esmpy.

conda install -c nesii -c conda-forge esmpy

This of course means you need to install pyschism in a conda environment which is unfortunate. But for now, we'll have to bite the bullet, because making the swith to xarray is not trivial.

jreniel avatar Aug 14 '21 12:08 jreniel

Update: There are several additional issues with cf-python. We are planning on switching cf-python with xarray in the near-future, but it will have to wait because of some other priorities/time constraints. The workaround for the time being is to use conda to install esmpy.

conda install -c nesii -c conda-forge esmpy

This of course means you need to install pyschism in a conda environment which is unfortunate. But for now, we'll have to bite the bullet, because making the swith to xarray is not trivial.

Hello,I have the same problem and followed your answer "conda install -c nesii -c conda-forge esmpy" and successfully installed it in the pyschism environment, but still have the same error, why?

hb-9797 avatar Jan 20 '24 08:01 hb-9797