You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/getting-started/install.rst
+39-35Lines changed: 39 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,7 +74,7 @@ Depening on your level of expertise, we provide two different approaches:
74
74
* If you have never worked with a command line, or if you just want to give CLIMADA a try, follow the :ref:`simple instructions <install-simple>`.
75
75
* If you want to use the very latest development version of CLIMADA or even develop new CLIMADA code, follow the :ref:`advanced instructions <install-advanced>`.
76
76
77
-
Both approaches are not mutually exclusive.
77
+
Both approaches are **not** mutually exclusive.
78
78
After successful installation, you may switch your setup at any time.
79
79
80
80
.. _petals-notes:
@@ -146,9 +146,9 @@ These instructions will install the most recent stable version of CLIMADA withou
146
146
147
147
.. _install-pixi:
148
148
149
-
-------------------
149
+
-------------------------------------------
150
150
Simple Instructions with Pixi (Alternative)
151
-
-------------------
151
+
-------------------------------------------
152
152
153
153
As an alternative to mamba `Pixi`_ can be used to install climada from conda-forge.
154
154
Pixi is a modern package manager, based on Conda, that offers much faster dependency resolution.
@@ -159,8 +159,6 @@ Pixi is a modern package manager, based on Conda, that offers much faster depend
159
159
160
160
pixi init climada_pixi
161
161
162
-
.. _install-simple:
163
-
164
162
#. Add CLIMADA from ``conda-forge``:
165
163
166
164
.. code-block:: shell
@@ -194,6 +192,7 @@ Advanced Instructions: Installing from source
194
192
---------------------------------------------
195
193
196
194
For advanced Python users or developers of CLIMADA, cloning the CLIMADA repository and installing the package from source.
195
+
Installing from source also allows you to :ref:`switch branches <switch-branch>`.
197
196
198
197
.. warning::
199
198
@@ -283,24 +282,6 @@ For advanced Python users or developers of CLIMADA, cloning the CLIMADA reposito
283
282
If this test passes, great!
284
283
You are good to go.
285
284
286
-
.. _change-branch:
287
-
288
-
How to switch branch
289
-
^^^^^^^^^^^^^^^^^^^^^^
290
-
291
-
Advanced users, or reviewers, may also want to check the feature of a specific branch other than develop.
292
-
To do so, **assuming you did install CLIMADA in editable mode (`pip install` with the `-e` flag)**, you just have to:
293
-
294
-
```
295
-
git fetch
296
-
git checkout <branch>
297
-
git pull
298
-
```
299
-
300
-
This will work most of the time, except if the target branch defines new dependencies that you don't have already in your environment (as they will not get installed this way), in that case you can install these dependencies yourself, or create a new environment with the *new* requirements from the branch.
301
-
302
-
If you did not install CLIMADA in editable mode, you can also reinstall CLIMADA from its folder after switching the branch (`pip install [-e] ./`).
303
-
304
285
.. _devdeps:
305
286
306
287
Install Developer Dependencies (Optional)
@@ -311,8 +292,7 @@ They are also not needed for using CLIMADA.
311
292
However, if you want to develop CLIMADA, we strongly recommend you install them.
312
293
313
294
With the ``climada_env`` activated, enter the workspace directory and then the CLIMADA repository as above.
314
-
Then, add the ``test`` extra specification to the ``pip install`` command (**mind the quotation marks**,
315
-
and see also `pip install examples <https://pip.pypa.io/en/stable/cli/pip_install/#examples>`_):
295
+
Then, add the ``test`` extra specification to the ``pip install`` command (**mind the quotation marks**, and see also `pip install examples <https://pip.pypa.io/en/stable/cli/pip_install/#examples>`_):
316
296
317
297
.. code-block:: shell
318
298
@@ -339,7 +319,7 @@ With the ``climada_env`` activated, execute
339
319
340
320
pre-commit install
341
321
342
-
Please refer to the `guide on pre-commit hooks <../development/Guide_CLIMADA_Development.html#pre-commit-hooks>`_ for information on how to use this tool.
322
+
Please refer to the :ref:`guide on pre-commit hooks <dev-pre-commit-hooks>` for information on how to use this tool.
343
323
344
324
For executing the pre-defined test scripts in exactly the same way as they are executed by the automated CI pipeline, you will need ``make`` to be installed.
345
325
On macOS and on Linux it is pre-installed. On Windows, it can easily be installed with Conda:
@@ -348,7 +328,7 @@ On macOS and on Linux it is pre-installed. On Windows, it can easily be installe
348
328
349
329
mamba install -n climada_env make
350
330
351
-
Instructions for running the test scripts can be found in the `Testing Guide <../development/Guide_Testing.html>`_.
331
+
Instructions for running the test scripts can be found in the :doc:`Testing Guide </development/Guide_Testing>`.
352
332
353
333
Install CLIMADA Petals (Optional)
354
334
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -382,9 +362,9 @@ To install CLIMADA Petals, we assume you have already installed CLIMADA Core wit
382
362
python -m pip install -e ./
383
363
384
364
385
-
---------------------------------------
365
+
------------
386
366
Code Editors
387
-
---------------------------------------
367
+
------------
388
368
389
369
JupyterLab
390
370
^^^^^^^^^^
@@ -513,9 +493,9 @@ Therefore, we recommend installing Spyder in a *separate* environment, and then
513
493
#. Set the Python interpreter used by Spyder to the one of ``climada_env``.
514
494
Select *Preferences* > *Python Interpreter* > *Use the following interpreter* and paste the iterpreter path you copied from the ``climada_env``.
515
495
516
-
---------------------------------------
496
+
-----------------------------
517
497
Apps for working with CLIMADA
518
-
---------------------------------------
498
+
-----------------------------
519
499
520
500
To work with CLIMADA, you will need an application that supports Jupyter Notebooks.
521
501
There are plugins available for nearly every code editor or IDE, but if you are unsure about which to choose, we recommend `JupyterLab <https://jupyterlab.readthedocs.io/en/stable/>`_, `Visual Studio Code <https://code.visualstudio.com/>`_ or `Spyder <https://www.spyder-ide.org/>`_.
@@ -571,8 +551,8 @@ Answers to frequently asked questions.
571
551
572
552
.. _update-climada:
573
553
574
-
Updating CLIMADA
575
-
^^^^^^^^^^^^^^^^
554
+
How to update CLIMADA?
555
+
^^^^^^^^^^^^^^^^^^^^^^
576
556
577
557
We recommend keeping CLIMADA up-to-date.
578
558
To update, follow the instructions based on your :ref:`installation type <install-choice>`:
@@ -600,6 +580,30 @@ To update, follow the instructions based on your :ref:`installation type <instal
600
580
601
581
The same instructions apply for CLIMADA Petals.
602
582
583
+
.. _switch-branch:
584
+
585
+
How to switch branches?
586
+
^^^^^^^^^^^^^^^^^^^^^^^
587
+
588
+
This is only available for :ref:`advanced installations <install-advanced>` from source.
589
+
590
+
If you want to check out or review a specific feature, you may want to switch to a `Git branch <https://git-scm.com/book/en/v2/Git-Branching-Branches-in-a-Nutshell>`_ other than ``develop``.
591
+
To switch to a new branch, open a terminal and move to the CLIMADA repository.
592
+
Then fetch the latest changes from the remote, switch to the target branch, and update your local version:
593
+
594
+
.. code-block:: shell
595
+
596
+
cd<path/to/workspace>/climada_python
597
+
git fetch
598
+
git checkout <branch>
599
+
git pull
600
+
601
+
After switching, it is good practice to :ref:`update your environment <update-climada>`, as the dependency definitions might have been changed.
602
+
In rare cases, updating the environment might fail after switching a branch because the dependency updates are incompatible.
603
+
If this happens, create a new environment (see the :ref:`advanced instructions <install-advanced>`).
604
+
605
+
The above instructions also apply for CLIMADA Petals, but you have to ``cd`` into the ``climada_petals`` repository in the first step, of course.
606
+
603
607
.. _install-more-packages:
604
608
605
609
Installing More Packages
@@ -679,12 +683,12 @@ the level set to ``WARNING``.
679
683
680
684
If you prefer another logging configuration, e.g., for using Climada embedded in another application,
681
685
you can opt out of the default pre-configuration by setting the config value for
682
-
``logging.climada_style`` to ``false`` in the :doc:`configuration file <../development/Guide_Configuration>`
686
+
``logging.climada_style`` to ``false`` in the :doc:`configuration file </development/Guide_Configuration>`
683
687
``climada.conf``.
684
688
685
689
Changing the logging level can be done in multiple ways:
686
690
687
-
* Adjust the :doc:`configuration file <../development/Guide_Configuration>` ``climada.conf`` by setting a the value of the ``global.log_level`` property.
691
+
* Adjust the :doc:`configuration file </development/Guide_Configuration>` ``climada.conf`` by setting a the value of the ``global.log_level`` property.
688
692
This only has an effect if the ``logging.climada_style`` is set to ``true`` though.
689
693
690
694
* Set a global logging level in your Python script:
0 commit comments