Skip to content

Commit

Permalink
Add conda-forge installation instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
smithara committed Nov 1, 2022
1 parent 171f125 commit 1f6a280
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Publish with flit
env:
FLIT_USERNAME: ${{ secrets.pypi_username }}
Expand Down
13 changes: 11 additions & 2 deletions README.rst
@@ -1,6 +1,11 @@

.. image:: https://badge.fury.io/py/viresclient.svg
:target: https://badge.fury.io/py/viresclient
.. image:: https://img.shields.io/pypi/v/viresclient
:target: https://pypi.org/project/viresclient/
:alt: PyPI

.. image:: https://img.shields.io/conda/vn/conda-forge/viresclient
:target: https://anaconda.org/conda-forge/viresclient
:alt: Conda

.. image:: https://readthedocs.org/projects/viresclient/badge/?version=latest
:target: http://viresclient.readthedocs.io/
Expand All @@ -13,6 +18,10 @@

pip install viresclient

::

conda install -c conda-forge viresclient

viresclient_ is a Python package which connects to a VirES server, of which there are two: *VirES for Swarm* (https://vires.services) and *VirES for Aeolus* (https://aeolus.services), through the WPS_ interface. This package handles product requests and downloads, enabling easy access to data and models from ESA's Earth Explorer missions, Swarm_ and Aeolus_. This service is provided for ESA by EOX_. For enquiries about the service and problems with accessing your account, please email info@vires.services. For help with usage, please email ashley.smith@ed.ac.uk (for Swarm data) or `raise an issue on GitHub`_.

.. _viresclient: https://github.com/ESA-VirES/VirES-Python-Client
Expand Down
67 changes: 42 additions & 25 deletions docs/installation.rst
Expand Up @@ -6,50 +6,67 @@ Installation and First Usage
1. Installation
---------------

Python ≥ 3.6 is required. Testing is primarily on Linux, but macOS and Windows should also work.
Python ≥ 3.6 is required. Testing is primarily on Linux, but macOS and Windows should also work. Available through both pip and conda (conda-forge).

It can currently be installed with::
.. tabs::

.. group-tab:: pip

.. code-block:: sh
pip install viresclient
pip install viresclient
.. group-tab:: conda

Dependencies::
.. code-block:: sh
requests
Jinja2
tables
tqdm
cdflib
pandas
xarray
netCDF4
conda install --channel conda-forge viresclient
pip will fetch these automatically - if you are using conda, it may be better to install these first using conda instead (where available)::
.. group-tab:: mamba

conda install requests jinja2 pytables tqdm pandas xarray netcdf4
pip install viresclient
.. code-block:: sh
mamba install --channel conda-forge viresclient
Recommended setup if starting without Python already
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

1. Install Miniconda: https://docs.conda.io/en/latest/miniconda.html
There are many ways to work with Python. We recommend using conda/mamba to manage your programming environment because of the availability of many data science packages through conda.

.. tabs::

.. group-tab:: conda

1. Install Miniconda: https://docs.conda.io/en/latest/miniconda.html

2. Set the conda-forge channel as the priority to install packages from::

conda config --add channels conda-forge
conda config --set channel_priority strict

You should do this to avoid mixing packages from the anaconda channel (which can result in broken environments), and try to get all packages from conda-forge where available for consistency.

3. Create a new conda environment with some recommended packages, including viresclient::

conda create --name myenv python=3.10 jupyterlab scipy matplotlib pandas xarray cartopy h5py netCDF4 pytables ipywidgets viresclient

2. Set the conda-forge channel as the priority to install packages from::
4. Activate the new environment (you do this each time you want to use it)::

conda config --add channels conda-forge
conda config --set channel_priority strict
conda activate myenv

3. Create a new conda environment with some recommended packages::
.. group-tab:: mamba

conda create --name myenv scipy matplotlib pandas xarray cartopy jupyter jupyterlab flake8 dask h5py netCDF4 jinja2 pytables tqdm ipywidgets
`Mamba <https://mamba.readthedocs.io/>`_ is a drop-in replacement for conda. You can install it into an existing (base) conda environment (``conda install -c conda-forge mamba``) and then just use ``mamba`` in place of ``conda`` in any commands - mamba is significantly faster. You can also install *mambaforge* directly to get mamba and conda-forge immediately configured in the base environment.

Activate the new environment (you do this each time you want to use it)::
1. Download and install the `mambaforge installer <https://github.com/conda-forge/miniforge#mambaforge>`_ or check the `mamba documentation <https://mamba.readthedocs.io/en/latest/installation.html>`_

conda activate myenv
2. Create a new environment for your development work::

4. Use pip to install viresclient::
mamba create --name myenv python=3.10 jupyterlab scipy matplotlib pandas xarray cartopy h5py netCDF4 pytables ipywidgets viresclient

pip install viresclient
3. Activate it to use it::

mamba activate myenv


2. First usage / Configuration
Expand Down
7 changes: 7 additions & 0 deletions docs/release_notes.rst
Expand Up @@ -4,6 +4,13 @@ Release notes
Change log
----------

Changes from 0.11.0 to 0.11.1
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

- ``viresclient`` package now available through conda-forge
- Added parameter to Swarm ``MAG`` collections: ``dF_Sun``
- Added GOCE ML magnetic dataset: ``GO_MAG_ACAL_CORR_ML``

Changes from 0.10.3 to 0.11.0
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 1f6a280

Please sign in to comment.