From 8af52bcfead2e0849a10ed0e6369d0b2b9d4ef7d Mon Sep 17 00:00:00 2001 From: George McCabe <23407799+georgemccabe@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:16:36 -0700 Subject: [PATCH] use conda instead of mamba for xesmf because the package breaks using mamba --- .../scripts/docker_env/scripts/xesmf_env.sh | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/internal/scripts/docker_env/scripts/xesmf_env.sh b/internal/scripts/docker_env/scripts/xesmf_env.sh index bf170708c9..529c7bbcfb 100755 --- a/internal/scripts/docker_env/scripts/xesmf_env.sh +++ b/internal/scripts/docker_env/scripts/xesmf_env.sh @@ -24,4 +24,29 @@ BASE_ENV=metplus_base.${METPLUS_VERSION} mamba create -y --clone ${BASE_ENV} --name ${ENV_NAME} mamba install -y --name ${ENV_NAME} -c conda-forge netcdf4==1.6.2 mamba install -y --name ${ENV_NAME} -c conda-forge xarray==2022.3.0 -mamba install -y --name ${ENV_NAME} -c conda-forge xesmf==0.3.0 +conda install -y --name ${ENV_NAME} -c conda-forge xesmf==0.3.0 + +# had to use conda to install xesmf==0.3.0 because conda and mamba obtain +# different versions of dependencies and a use case fails trying +# to import from xesmf: +# +# ERROR: +# File "/usr/local/conda/envs/xesmf.v6.0/lib/python3.10/site-packages/xesmf/backend.py", line 19, in +# import ESMF +#ModuleNotFoundError: No module named 'ESMF' +# +# Conda dependencies obtained: +# +# esmf-8.2.0 | nompi_h61edca3_0 27.4 MB conda-forge +# esmpy-8.2.0 |nompi_py310ha0140b2_1 175 KB conda-forge +# netcdf-fortran-4.5.4 |nompi_h2b6e579_100 1.3 MB conda-forge +# scipy-1.11.3 | py310hb13e2d6_1 14.3 MB conda-forge +# xesmf-0.3.0 | py_0 19 KB conda-forge +# +# Mamba dependencies obtained: +# +# esmf 8.4.1 nompi_he2e5181_0 conda-forge/linux-64 24MB +# esmpy 8.4.1 pyhc1e730c_0 conda-forge/noarch 48MB +# netcdf-fortran 4.6.0 nompi_heb5813c_103 conda-forge/linux-64 417kB +# scipy 1.11.3 py310hb13e2d6_1 conda-forge/linux-64 15MB +# xesmf 0.3.0 py_0 conda-forge/noarch 20kB