.. _installing: Install packages ================ Required dependencies --------------------- osdyn requires ``python>3.6.7`` and depends on the following packages: .. list-table:: Basic requirements :widths: 15 90 * - `netCDF4 `__ (1.5.8) - netCDF4 provides an object-oriented python interface to the netCDF version 4 library * - `xarray `__ (>0.20.2) - Xarray is an open source project and Python package that makes working with labelled multi-dimensional arrays simple, efficient, and fun! * - `dask `__ (2021.12.0) - Dask is a flexible library for parallel computing in Python. * - `configobj `__ (>5.0) - ConfigObj is a simple but powerful config file reader and writer: an ini file round tripper. .. list-table:: Requirements for treatments :widths: 15 90 * - `xesmf `__ (>0.6.2) - xESMF is a powerful, easy-to-use and fast Python package for regridding. * - `esmpy `__: (=7.1.0) (=8.2.0) - ESMPy is a Python interface to the Earth System Modeling Framework (ESMF) regridding utility. * - `xgcm `__: (0.6.0) - xgcm is a python packge for working with the datasets produced by numerical General Circulation Models (GCMs) .. list-table:: Requirements for oceanic estimates :widths: 15 90 * - `gsw `_ (3.4.0) - This Python implementation of the Thermodynamic Equation of Seawater 2010 (TEOS-10). * - `cf-units `__ (3.0.1) - Units of measure as required by the Climate and Forecast (CF) metadata conventions. .. list-table:: Requirements for plotting :widths: 15 90 * - `cartopy `__ (0.20.1) - Cartopy is a Python package designed for geospatial data processing in order to produce maps and other geospatial data analyses. * - `nc-time-axis `__ (1.4.0) - nc-time-axis supports for cftime.datetime axis in matplotlib. * - `seaborn `__ - Seaborn is a Python data visualization library based on matplotlib. .. list-table:: Requirements for accelerating xarray :widths: 15 90 * - `bottleneck `__ (1.3.2) - Bottleneck is a collection of fast NumPy array functions written in C and allows to speeds up NaN-skipping and rolling window aggregations by a large factor .. - `numbagg `_: for exponential rolling .. window operations Optional dependencies --------------------- .. list-table:: IDE requirements :widths: 15 90 * - `jupyter `__ - The Jupyter Notebook is an open-source web application that allows you to create and share documents that contain live code, equations, visualizations and explanatory text. * - `nbdime `__ - nbdime provides tools for diffing and merging Jupyter notebooks. * - `spyder `__ (5.2.1) - Spyder is a powerful scientific environment written in Python, for Python, and designed by and for scientists, engineers and data analysts. .. list-table:: Testing :widths: 15 90 * - `pytest `__ (6.2.5) - Pytest is a testing framework which allows us to write test codes using python. .. list-table:: Formatting :widths: 15 90 * - `black `__ (2021.12b0) - Black is the uncompromising Python code formatter. * - `flake8 `__ (4.0.1) - Flake8 is a great toolkit for checking your code base against coding style and programming errors .. list-table:: Documentation :widths: 15 90 * - `sphinx `__ (>2.3) - Sphinx is a tool that makes it easy to create intelligent and beautiful documentation. * - `sphinx_rtd_theme `__ (>=0.5.0rc1) - Sphinx theme for readthedocs.org * - `nbsphinx `__ (>=0.8.6) - Jupyter Notebook Tools for Sphinx * - `sphinx-copybutton `__ (>=0.4.0) - A small sphinx extension to add a "copy" button to code blocks * - `sphinx-gallery `__ (>=0.9.0) - Sphinx extension for automatic generation of an example gallery Create python environment ------------------------- osdyn library is available from `osdyn project `__ As under progress, it is a private project at the moment. Feel free to ask Valerie Garnier from Ifremer institute to any information. osdyn is not a pure Python package but its dependencies are. The easiest way to get all the packages installed is to use conda_ (conda 4.8.2 or later) from `conda distribution `__. .. _conda: https://docs.conda.io/projects/conda/en/latest/ From scratch ^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 installing_from_scratch From .yaml osdyn environment ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. toctree:: :maxdepth: 1 installing_from_yaml Add packages unvailable from conda ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ A few packages are not available from conda, so install them into osdyn environment from `pip install` command. .. (but never mix pip and conda installation !) Load osdyn environment and then add packages from their respective cloned or remote projects. .. code-block:: bash source PATH/Anaconda3-2019.10/etc/profile.d/conda.csh [or sh...] conda activate osdyn [or myname] .. As long as sphinx_rtd_theme is not in 1.5.1 in anaconda cloud, remove this package from the conda list and add sphinx_rtd_theme through :: .. pip install sphinx-rtd-theme eo_harvest library .................. For user-friendly downloads from CMEMS and other databases, feel free to add eo_harvest. The package can be downloaded at `ifremer eo_harvest `__ and then add it to osdyn environment :: cd path_to_eo_harvest python setup.py install .. geopandas (pour notebook hvplot hors osdyn) USELESS for osdyn I think .. - geo-py: .. .. - `download `__ .. - tar xvf geo-py-0.4.tar.gz .. - cd geo-py-0.4 .. - python setup.py install .. .. warning:: geo-py has been replaced by pyproj datarmor usage .............. To speed up access to your dataset of interest (or a subset), the user is encouraged to use intake datarmor catalogues. To do so, install dask-hpconfig package:: python -m pip install git+https://extranetlogin@gitlab.ifremer.fr/iaocea/dask-hpcconfig.git osdyn library ............. First, get the package. At the moment, you need to register to the project and then .. code-block:: bash git clone https://gitlab.ifremer.fr/vg056b7/osdyn.git .. Second, compile fortran tools:: .. cd osdyn/lib/fortran .. make _interp_.so > & outmake_osdyn202102 Second, install osdyn library into your python environment:: python -m pip install . .. warning:: You need a **fortran compiler** to install osdyn. .. Or run only the build command to compile fortran source command:: .. $ python setup.py build You are ready ! Have a look at :ref:`overview` and at all the notebooks under :ref:`nbs`. Have fun !