Installation

NinoLearn works with virtual Conda environments. If you do not have Anaconda or Miniconda installed check out https://conda.io/docs/user-guide/install/.

To install NinoLearn on your machine clone the master branche of the NinoLearn GitHub repository by executing the following snippet in your terminal:

git clone https://github.com/pjpetersik/ninolearn

Now put the PYTHONPATH to the base folder of Ninolearn into your .bashrc file:

export PYTHONPATH="$PYTHONPATH:/path/to/ninolearn"

Open a new terminal or run:

source .bashrc

From now on, NinoLearn will be available for your python. Now, a new conda environment needs to be initialized such that you have the right dependencies within your environment to work with NinoLearn.

Currently, a .yml file is just generated for python3 and linux. For this run the following command in your terminal:

conda env create -f py3_linux.yml

If you are on another system you might try:

conda create --name ninolearn -c conda-forge python=3.6 tensorflow keras matplotlib basemap pandas xarray dask scikit-learn netcdf4 xesmf esmpy python-igraph nbsphinx jupyter spyder

The particular package is used for the following purpose:

  • tenserflow and keras for neural networks

  • matplotlib and basemap for plotting

  • pandas and xarray for data handeling

  • dask for reading large data files

  • scikit-learn for machine learning

  • netcfd4 to open files with the NetCDF4 format

  • xesmf and esmpy for regridding data

  • python-igraph for fast computation of complex network metrics

  • nbsphinx to include jupyter notebooks in the documentation

  • jupyter to work in jupyter notebooks (e.g. in the tutorials)

  • spyder as integrated development environment (optional)

The environment activated by running

source $HOME/YOURCONDA/bin/activate ninolearn

Here, YOURCONDA is a placeholder for your conda base directory. The environment can be deactivated by running:

conda deactivate

You might consider to put the following alias into your .bashrc file to shorten the activation process:

alias ninolearn_env="source $HOME/YOURCONDA/bin/activate ninolearn"

Open a new terminal or source the .bashrc file (as above). From now on you can activate the environment by running ninolearn_env in your terminal. Within this environment NinoLearn will be available for you. To make the code working you need to enter some directory pathes into the file privateTEMPLATE.py in the ninolearn directory. Then, rename the file to ‘private.py’. You may not push this file to a public repository.

Note, that the package is still in the beginning of its development. Hence, its certainly not free from bugs. If you encouter some problems, feel free to post them as an issue on the GitHub repository of NinoLearn.