Installation#
Warning
Pyku is not yet on PyPI, but we’re working on it.
To install pyku, ensure your system is properly configured. The following non-python dependencies are necessary:
To build the documentation, you will additionally need pandoc.
Once these prerequisites are met, you can install the latest release of pyku.
from master#
To install the current master from the repository:
pip install "pyku @ git+https://github.com/DeutscherWetterdienst/pyku"
To install the dependencies to build the documentation:
pip install "pyku[documentation] @ git+https://github.com/DeutscherWetterdienst/pyku"
pin version#
To pin a version:
pip install "pyku @ git+https://github.com/DeutscherWetterdienst/pyku@v1.0.0"
from source#
To install from source, clone the repository and run:
pip install .
To install from source with the dependencies to build the documentation
pip install ".[documentation]"
for development#
To install in development mode:
pip install -e .
To install in development mode with the dependencies to build the documentation:
pip install -e ".[documentation]"
Compiled dependencies#
The following dependencies are not installed automatically with pyku because additional non-Python dependencies are required.
python-SBCK
Download and install the required eigen dependency:
wget https://gitlab.com/libeigen/eigen/-/archive/3.4.0/eigen-3.4.0.tar.gz
mkdir build
cd build
cmake ../ -DCMAKE_INSTALL_PREFIX=/path/to/eigen-3.4.0/install
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/path/to/eigen-3.4.0/install/share/pkgconfig
Install the SBCK library from source:
git clone https://github.com/yrobink/SBCK-python.git
CPPFLAGS='-I/path/to/eigen-3.4.0/install/include' pip install SBCK
Conservative resampling
There were issues with multiprocessing when using conservative resampling within pyku. To resolve this, disable multiprocessing in the ESMF library and allow pyku to manage multiprocessing as described below:
# Clone repository
# ----------------
git clone https://github.com/esmf-org/esmf
# Export path to esmf directory
# -----------------------------
export ESMF_DIR=/path/to/esmf/
# Build
# -----
export ESMF_OPENACC='OFF'
export ESMF_OPENMP='OFF'
export ESMF_PTHREADS='OFF'
export ESMF_PIO='OFF'
git checkout v8.6.1
make
make install
# Set that environment variable
# -----------------------------
export ESMFMKFILE=/path/to/esmf/DEFAULTINSTALLDIR/lib/libO/Linux.gfortran.64.mpiuni.default/esmf.mk
pip uninstall esmpy # If applicable
cd esmf/src/addon/esmpy
make install
pip uninstall xESMF # If applicable
pip install xESMF