User Tools

Site Tools


other:uvcdat:cdat_conda:cdat_8_2_1

This is an old revision of the document!


CDAT 8.2.1 installation notes

Using JYP version

If you mostly want to use the CDAT 8.2.1 installed by JYP, just use the following steps and then read the What should I do now? section below

  • Initialize conda with:
Server tcsh bash
LSCE source ~jypeter/.conda3_21-02_jyp.csh source ~jypeter/.conda3_21-02_jyp.sh
ciclad source ~jypmce/.conda3_jyp.csh
n/a
source ~jypmce/.conda3_jyp.sh
n/a
  • Choose one of the installed environments and activate it with: conda activate env_name
    • python 2.7.x: Deprecated! If you still need to use python 2.7, please use CDAT 8.1
    • python 3.x: conda activate cdatm_py3
  • Type which python (or the wp alias) and make sure you get something like
    […]/miniconda3/envs/env_name/bin/python

What should I do now?

You just want to use the installed version

You are ready if you have typed the conda activate command specified in the previous section!

  • You may want to add the source line to your shell configuration file so that you don't have to remember it and type it each time you open a new terminal
    • Note: it's better to type the activate command in a terminal only when you want to use this specific version of python, rather than having the activate in your shell configuration file. This may have some side effects in some cases
  • Have a look at the Extra package list at the bottom of this page to see what is available in this distribution
  • If you have not done it yet, read (or at least have a look at the list of sections):

You want to replicate this installation on your own server or desktop/laptop

What's New in CDAT 8.2.1?

Note: this particular CDAT installation at LSCE (and on other machines/servers) provides many extra (non-CDAT) packages. You can jump directly to the Extra package list at the bottom of this page to see what is available

Installation with Miniconda3

We assume that Miniconda3 is already installed. Otherwise, follow the the Installing Miniconda steps (and the Post-Miniconda3 installation section) we followed when installing CDAT 8.0

Updating conda

The conda package itself can be updated (if need be) with
conda update -n base -c defaults conda

Installing CDAT 8.2.1

Prerequisites

We first check that we have indeed access to a (mini)conda installation (the base environment we get if we have correctly installed miniconda3), and we assume that we have a write-access to the conda disk hierarchy, and a few Gb of disk space available

 > conda env list | grep base
base                  *  /home/share/unix_files/cdat/miniconda3_21-02

 > df -h  /home/share/
Filesystem      Size  Used Avail Use% Mounted on
prolix3:/share  917G  245G  626G  29% /home/share

 > du -sh /home/share/unix_files/cdat/miniconda3_21-02
577M    /home/share/unix_files/cdat/miniconda3_21-02

We can also use conda env list and remove some obsolete versions with conda remove -n obsolete_environment --all, in order to free up some space

Python 2.7 version

Python 2.x is deprecated in CDAT, starting with CDAT 8.2.1.

If you still need to use python 2.7, please use CDAT 8.1

Python 3.8 version

It's possible that, when using the tcsh shell and trying to use the conda create -n cdat-8.2.1_py3 lots_of_parameters_with_wildcards line, you will get the following error message:

conda: No match

Apparently the tcsh version of conda does not like wildcards too much (CSH install/search fail with '*' variable in an argument)…

In that case, just type bash and run the installation command in a bash shell

The installation line below is based on information from the CDAT wiki page. See also Some questions and notes about 8.2.1 installation

$ conda create -n cdat-8.2.1_py3 -c conda-forge -c cdat/label/v8.2.1 cdat "libnetcdf=*=mpi_openmpi_*" "mesalib=18.3.1" "python=3"

Resulting list of installed packages

Some extra installation notes

Cloning the base CDAT environment before adding specific packages for LSCE

You can skip this section if you are installing CDAT just for one user (yourself) on a Linux machine (or a Windows 10 machine with WSL)

You will directly make changes and install packages in your main python environment

This section is about the creation of the cdatm19 environment

Notes about actually using the cdatm19 conda-based python

Notes:

  • Why cloning? The initial CDAT environment is strictly the one created at PCMDI and certified by PCMDI. Rather than making changes directly in there, we keep it as it is, clone it, and make changes in the cloned environment
  • Carefully working on different python environments (possibly cloned) is safer in a multi-user environment (i.e. you can have people use a specific environment, and make tests in another environment)
  • Cloning a full environment uses Linux hard links and requires less disk space than making a real copy
$ conda create -n cdatm19_py3 --clone cdat-8.2.1_py3
$ cd /home/share/unix_files/cdat/miniconda3_21-02/envs
$ du -sh cdat-8.2.1_py3 cdatm19_py3
2.5G    cdat-8.2.1_py3
538M    cdatm19_py3

Getting ready for a moving default CDAT environment

You can skip this section if you are installing CDAT just for one user (yourself) on a Linux machine (or a Windows 10 machine with WSL)

You will directly make changes and install packages in your main python environment

This step could probably be listed at the end, especially in a multi-user environment!

If there is already a cdatm_py3 link (pointing to an older environment), make sure that the new CDAT environment is stable and working correctly before updating the cdatm_py3 link

We create a cdatm_py3 symbolic link in the envs directory, that has a stable name but can be moved to point to the latest default (and hopefully stable) CDAT environment. In that case, most users can just activate this cdatm_py3 environment and always get the latest stable version.

$ cd /home/share/unix_files/cdat/miniconda3_21-02/envs
$ ln -s cdatm19_py3 cdatm_py3

conda env list
# conda environments:
#
base                  *  /home/share/unix_files/cdat/miniconda3_21-02
cdat-8.2.1_py3           /home/share/unix_files/cdat/miniconda3_21-02/envs/cdat-8.2.1_py3
cdatm19_py3              /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_py3
cdatm_py3                /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm_py3

$ ls -l /home/share/unix_files/cdat/miniconda3_21-02/envs/
drwxr-xr-x [...] cdat-8.2.1_py3/
drwxr-xr-x [...] cdatm19_py3/
lrwxrwxrwx [...] cdatm_py3 -> cdatm19_py3/

Customizing UV-CDAT for LSCE

A quick test of cdms2 and vcs

You can use the quick test shown in To Test Your CDAT Installation, and check if you get the expected png file

You can also check the Testing vcs section of the LSCE installation of CDAT 8.1

Downloading cdms2/vcs test data

You should download the test data (174M of data…) and use it in the example scripts that you want to distribute, and scripts you write for reporting the errors you find (if any…)

$ conda activate cdatm19_py3

(cdatm19_py3) $ python -c 'import vcs; vcs.download_sample_data_files(); print("\nFinished downloading sample data to " + vcs.sample_data)'
[...]
Finished downloading sample data to /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_py3/share/cdat/sample_data

(cdatm19_py3) $ du -sh /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_py3/share/cdat/sample_data
174M    /home/share/unix_files/cdat/miniconda3_21-02/envs/cdatm19_py3/share/cdat/sample_data

Packages that have no dependency problems

After cloning, we are ready to install some extra packages that may be requested by LSCE users

  • We first try to install together as many packages as possible that don't require other channels than conda-forge, and that don't request a downgrade of what is already installed
  • We then install individual extra packages with conda install or pip install
# You can use the following to keep a trace of what will be installed
#$ conda install --dry-run -n cdatm19_py3 -c conda-forge pillow pandas statsmodels seaborn scikit-image seawater gsw netcdf4 pyferret basemap-data-hires xlsxwriter cmocean rpy2 gdal windspharm  > somewhere/extra_packages.txt

# Install...
$ conda install -n cdatm19_py3 -c conda-forge pillow pandas statsmodels seaborn scikit-image seawater gsw netcdf4 pyferret ferret_datasets basemap-data-hires xlsxwriter cmocean rpy2 gdal windspharm
[...]

# Use a similar install line if you want to install the same packages in the python3 version

List of installed packages: lsce-extra_01_install_190304.txt

Packages installed with pip

  • dreqPy: CMIP6 Data Request Python API
    • conda activate cdatm19_py3
      pip install dreqPy
    • Update with: pip install --upgrade dreqPy
      • Get version number with:
        $ drq -v
        dreqPy version 01.00.29 [Version 01.00.29]
  • ipython_ferretmagic: IPython notebook extension for ferret
    • conda activate cdatm19_py3
      pip install ferretmagic

The following packages have no dependency problems and were installed (or updated) later

  • CMOR: CMOR (Climate Model Output Rewriter) is used to produce CF-compliant netCDF files
    • conda install -n cdatm19_py3 -c conda-forge cmor
    • Get version number with: python -c 'from cmor import *; print( (CMOR_VERSION_MAJOR, CMOR_VERSION_MINOR, CMOR_VERSION_PATCH) )'
  • spanlib: Spectral Analysis Library
    • conda install -n cdatm19_py3 -c stefraynaud -c conda-forge spanlib
    • Test: python -c 'from spanlib.analyzer import Analyzer'
  • cartopy: a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses
    • conda install -n cdatm19_py3 -c conda-forge cartopy
  • joblib: running Python functions as pipeline jobs
    • conda install -n cdatm19_py3 -c conda-forge joblib
  • Palettable: Color palettes for Python
    • conda install -n cdatm19_py3 -c conda-forge palettable

TODO

Add here packages that would be useful and have not been installed yet, or have some problems that prevent their installation

  • iris: A Python library for Meteorology and Climatology
    • conda install -n cdatxxx -c conda-forge iris
  • wrf-python: A collection of diagnostic and interpolation routines for use with output from the Weather Research and Forecasting (WRF-ARW) Model
    • conda install -n cdatm15 -c conda-forge wrf-python
  • glances: a cross-platform monitoring tool (similar to top)

Other packages

There is no warranty that the packages listed below will work correctly, because it was required to bypass the compatibility checks in order to install them…
  • NO such packages now!

Updating some packages

Some packages change more often than others, and can be easily updated the following way:

    • Update with: pip install --upgrade dreqPy
      • Get version number with: drq -v

Cleaning up things

Some packages may have files that can only be read by the person who installed CDAT and the LSCE extensions (eg pcmdi-metrics in 2.8.0 and cdp in 2.10)

We check if some of the installed files are missing read access for the group or other, and we manually change the permissions

 >find /home/share/unix_files/cdat/miniconda3/envs \! -perm /g+r,o+r -ls
# Everything OK!

Extra packages list

  • pillow: the friendly PIL (Python Imaging Library) fork
  • pandas: Python Data Analysis Library
  • statsmodels: a Python module that allows users to explore data, estimate statistical models, and perform statistical tests
  • seaborn: statistical data visualization
  • scikit-image: image processing in Python
  • seawater: Python re-write of the CSIRO seawater toolbox
  • gsw: Python implementation of the Thermodynamic Equation Of Seawater
  • vacumm: Validation, Analysis, Comparison - Utilities written in Python to validate and analyze Multi-Model outputs, and compare them to observations
  • netcdf4: a Python interface to the netCDF C library
  • pyferret: Ferret encapsulated in Python
  • ipython_ferretmagic: IPython notebook extension for ferret
  • basemap-data-hires: high resolution data for basemap
  • PCMDI metrics package (PMP): objectively compare results from climate models with observations using well-established statistical tests
  • XlsxWriter: a Python module for creating Excel XLSX files
    • Note: this is a dependency of dreqPy
  • dreqPy: CMIP6 Data Request Python API
  • CMOR: CMOR (Climate Model Output Rewriter) is used to produce CF-compliant netCDF files
  • dtw: DTW (Dynamic Time Warping) python module
  • shapely: a Python wrapper for GEOS for algebraic manipulation of geometry (manipulation and analysis of geometric objects in the Cartesian plane)
  • cartopy: a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses
  • rpy2: providing simple and robust access to R from within Python
  • cmocean: beautiful colormaps for oceanography
  • OSGeo/GDAL: Geospatial Data Abstraction Library. GDAL is a translator library for raster and vector geospatial data formats
  • spanlib: Spectral Analysis Library
  • windspharm: spherical harmonic wind analysis in Python
  • CliMAF: a Climate Model Assessment Framework
  • joblib: running Python functions as pipeline jobs
  • Palettable: Color palettes for Python

Removed packages

  • NO removed packages!

Environments summary

After following the steps above, we get the following environments. Use the conda env list command (same result as conda info --envs) to get the up-to-date list of available environments.

Use conda list -n env_name to get a detailed list of which packages/modules are installed, or check the conda Installation history section to get more details

Environment
name
Server Summary
cdat-8.2.1_py3 LSCE
ciclad
CDAT 8.2.1 & Python 2.7
cdat-8.2.1_py3 LSCE CDAT 8.2.1 & Python 3.6
cdatm19_py3
or cdatm_py3
LSCE
ciclad
CDAT 8.2.1 & P 2.7 JYP version
cdatm19_py3
or cdatm_py3
LSCE CDAT 8.2.1 & P 3.7 JYP version





[ PMIP3 Wiki Home ] - [ Help! ] - [ Wiki syntax ]

other/uvcdat/cdat_conda/cdat_8_2_1.1614773727.txt.gz · Last modified: 2021/03/03 12:15 by jypeter