Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
basic_users_guide_xces_new [2024/01/08 14:41] – [Access through python module (pypi, jupyter)] etorma | basic_users_guide_xces_new [2025/02/12 09:42] (current) – [Creating your own conda/mamba environment with the freva library] etorma | ||
---|---|---|---|
Line 188: | Line 188: | ||
</ | </ | ||
BUT be aware that there is currently NO API to call freva functionalities within R, so it will only work as an additional R kernel, nothing more. | BUT be aware that there is currently NO API to call freva functionalities within R, so it will only work as an additional R kernel, nothing more. | ||
+ | |||
+ | ===== Creating your own conda/mamba environment with the freva library ===== | ||
+ | |||
+ | If you want to use freva as a python library alongside others (e.g. in a conda environment) then you can: | ||
+ | - install the package via pypi '' | ||
+ | - add the environment config of XCES in your script, e.g.: | ||
+ | <code python> | ||
+ | import os,sys | ||
+ | os.environ[" | ||
+ | os.environ[" | ||
+ | import freva | ||
+ | </ | ||
+ | |||
+ | <WRAP round important> | ||
+ | **NOTE**: since 2024 DKRZ does not allow access to '' | ||
+ | * use flag '' | ||
+ | * create '' | ||
+ | < | ||
+ | channels: | ||
+ | - conda-forge | ||
+ | </ | ||
+ | * (similar to 2): | ||
+ | < | ||
+ | # check what is currently set | ||
+ | conda config --show channels | ||
+ | |||
+ | # remove what you find | ||
+ | conda config --remove channels defaults | ||
+ | |||
+ | # add conda-forge | ||
+ | conda config --add channels conda-forge | ||
+ | </ | ||
+ | |||
+ | </ | ||
===== Using XCES/Freva R/Python environment to locally install your own packages ===== | ===== Using XCES/Freva R/Python environment to locally install your own packages ===== | ||
+ | |||
+ | <WRAP round info> | ||
+ | Not recommended! Your libraries would depend on the current Freva python/R environment that will eventually be updated and, hence, get obsolete. | ||
+ | </ | ||
xces/Freva ships with its own R and Python environment, | xces/Freva ships with its own R and Python environment, | ||
Line 232: | Line 270: | ||
The package will then be downloaded, built, including dependencies, | The package will then be downloaded, built, including dependencies, | ||
+ | |||
+ | **NOTE**: conda/mamba does not allow to do something similar to that, so if the package you want to append can only be installed via conda then you will need to create your own environment. | ||
==== 2. Installing R packages locally ==== | ==== 2. Installing R packages locally ==== | ||
Line 256: | Line 296: | ||
You can get some more information on e.g. how to build packages locally (I adapted some of the above mentioned text from there) [[https:// | You can get some more information on e.g. how to build packages locally (I adapted some of the above mentioned text from there) [[https:// | ||
- | |||
- | ===== Creating your own conda/mamba environment with the freva library ===== | ||
- | |||
- | If, on the other hand you want to use freva as a python library alongside others (e.g. in a conda environment) then you can: | ||
- | - install the package via pypi '' | ||
- | - add the environment config of XCES in your script, e.g.: | ||
- | <code python> | ||
- | import os,sys | ||
- | os.environ[" | ||
- | os.environ[" | ||
- | import freva | ||
- | </ | ||
- | |||
===== Additional info ===== | ===== Additional info ===== |