schism-dev / pyschism

Python interface for handling the SCHISM model.
https://schism-dev.github.io/schism/master/getting-started/pre-processing-with-pyschism/overview.html
Apache License 2.0
23 stars 18 forks source link

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

Open ghost opened 3 years ago

ghost commented 3 years ago

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.

jreniel commented 2 years ago

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.

hb-9797 commented 6 months ago

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?