diff --git a/docs/index.rst b/docs/index.rst index c7e0406..1b3d717 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,11 +7,51 @@ Welcome to mapflow's documentation! ``mapflow`` transforms 3D ``xr.DataArray`` into video files in one line of code. +Installation +------------ + +You can install ``mapflow`` using ``pip`` or ``conda``. + +With pip +~~~~~~~~ + +.. code-block:: bash + + pip install mapflow + +With conda +~~~~~~~~~~ + +.. code-block:: bash + + conda install -c conda-forge -y mapflow + +Dependencies +~~~~~~~~~~~~ + +``mapflow`` relies on ``matplotlib`` and ``ffmpeg``. If you're not installing ``mapflow`` from conda-forge, make sure ``ffmpeg`` is installed on your system. + +Usage +----- + +The main function of ``mapflow`` is ``animate``, which creates a video from an ``xarray.DataArray``. + +.. code-block:: python + + import xarray as xr + from mapflow import animate + + ds = xr.tutorial.open_dataset("era5-2mt-2019-03-uk.grib") + animate(da=ds['t2m'].isel(time=slice(120)), path='animation.mp4') + +.. video:: ../_static/animation.mp4 + :width: 640 + :height: 480 + .. toctree:: :maxdepth: 1 :caption: Contents: :hidden: - installation how_to_use api diff --git a/docs/installation.rst b/docs/installation.rst deleted file mode 100644 index 179671e..0000000 --- a/docs/installation.rst +++ /dev/null @@ -1,27 +0,0 @@ -:notoc: true - -.. _installation: - -Installation -============ - -You can install ``mapflow`` using ``pip`` or ``conda``. - -With pip --------- - -.. code-block:: bash - - pip install mapflow - -With conda ----------- - -.. code-block:: bash - - conda install -c conda-forge -y mapflow - -Dependencies ------------- - -``mapflow`` relies on ``matplotlib`` and ``ffmpeg``. If you're not installing ``mapflow`` from conda-forge, make sure ``ffmpeg`` is installed on your system.