Skip to content

Commit

Permalink
Merge branch 'develop' into calibrate-impact-functions
Browse files Browse the repository at this point in the history
  • Loading branch information
peanutfun committed Oct 26, 2023
2 parents c40b85a + 12c3190 commit 645862a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 10 deletions.
37 changes: 29 additions & 8 deletions doc/guide/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,31 @@ For advanced Python users or developers of CLIMADA, we recommed cloning the CLIM
cd climada_python
git checkout develop
#. Create an Anaconda environment called ``climada_env`` for installing CLIMADA.
Use the default environment specs in ``env_climada.yml`` to create it.
#. Create an Anaconda environment called ``climada_env`` for installing CLIMADA:

.. code-block:: shell
conda create -n climada_env python=3.9
.. note::

CLIMADA can be installed for different Python versions.
If you want to use a different version, replace the version specification in the command above with another allowed version.

.. list-table::
:width: 60%

* - **Supported Version**
- ``3.9``
* - Allowed Versions
- ``3.9``, ``3.10``, ``3.11``

#. Use the default environment specs in ``env_climada.yml`` to install all dependencies.
Then activate the environment:

.. code-block:: shell
conda env create -n climada_env -f requirements/env_climada.yml
conda env update -n climada_env -f requirements/env_climada.yml
conda activate climada_env
#. Install the local CLIMADA source files as Python package using ``pip``:
Expand Down Expand Up @@ -237,7 +255,6 @@ To install CLIMADA Petals, we assume you have already installed CLIMADA Core wit
.. code-block:: shell
conda env update -n climada_env -f requirements/env_climada.yml
conda env update -n climada_env -f requirements/env_developer.yml
conda activate climada_env
#. Install the CLIMADA Petals package:
Expand Down Expand Up @@ -288,15 +305,20 @@ Basic Setup

See the VSCode docs on `Python <https://code.visualstudio.com/docs/python/python-tutorial>`_ and `Jupyter Notebooks <https://code.visualstudio.com/docs/datascience/jupyter-notebooks>`_ for further information.

.. hint::

Both of the following setup instructions work analogously for Core and Petals.
The specific instructions for Petals are shown in square brackets: []

Workspace Setup
"""""""""""""""

Setting up a workspace for the CLIMADA source code is only available for :ref:`advanced installations <install-advanced>`.

#. Open a new VSCode window.
Below *Start*, click *Open...*, select the ``climada_python`` repository folder in your workspace directory, and click on *Open* on the bottom right.
Below *Start*, click *Open...*, select the ``climada_python`` [``climada_petals``] repository folder in your workspace directory, and click on *Open* on the bottom right.

#. Click *File* > *Save Workspace As...* and store the workspace settings file next to (**not** in!) the ``climada_python`` folder.
#. Click *File* > *Save Workspace As...* and store the workspace settings file next to (**not** in!) the ``climada_python`` [``climada_petals``] folder.
This will enable you to load the workspace and all its specific settings in one go.

#. Open the Command Palette by clicking *View* > *Command Palette* or by using the shortcut keys ``Ctrl+Shift+P`` (Windows, Linux) / ``Cmd+Shift+P`` (macOS).
Expand All @@ -315,7 +337,7 @@ After you set up a workspace, you might want to configure the test explorer for

#. In the left sidebar, select the "Testing" symbol, and click on *Configure Python Tests*.

#. Select "pytest" as test framework and then select ``climada`` as the directory containing the test files.
#. Select "pytest" as test framework and then select ``climada`` [``climada_petals``] as the directory containing the test files.

#. Select "Testing" in the Activity Bar on the left or through *View* > *Testing*.
The "Test Explorer" in the left sidebar will display the tree structure of modules, files, test classes and individual tests.
Expand Down Expand Up @@ -407,7 +429,6 @@ To update, follow the instructions based on your :ref:`installation type <instal
.. code-block:: shell
conda env update -n climada_env -f requirements/env_climada.yml
conda env update -n climada_env -f requirements/env_developer.yml
The same instructions apply for CLIMADA Petals.

Expand Down
1 change: 0 additions & 1 deletion requirements/env_climada.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ dependencies:
- pycountry>=22.3
- pyepsg>=0.4
- pytables>=3.7
- python=3.9
- pyxlsb>=1.0
- rasterio>=1.3
- requests>=2.31
Expand Down
3 changes: 2 additions & 1 deletion script/jenkins/install_env.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash -e

mamba remove --name climada_env --all
mamba env create -f requirements/env_climada.yml --name climada_env
mamba create -n climada_env python=3.9
mamba env update -n climada_env -f requirements/env_climada.yml

source activate climada_env
python -m pip install -e "./[test]"
Expand Down

0 comments on commit 645862a

Please sign in to comment.