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 [2025/01/24 15:06] – [Creating your own conda/mamba environment with the freva library] etorma | basic_users_guide_xces_new [2025/05/19 11:50] (current) – [Installing the freva library] etorma | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Getting familiar with the XCES Platform ====== | ===== Getting familiar with the XCES Platform ====== | ||
+ | <WRAP round info> | ||
+ | * For a **quick tour** through Freva and Freva Plugins please [[https:// | ||
+ | * You also have some **hands-on exercises** to get yourself familiarised with freva and plugins [[https:// | ||
+ | </ | ||
The XCES platform is an instance of the Free Evaluation System Framework (Freva), designed by the Freva team and adapted for the scientists of the ClimXtreme project by Module D. Below you will find relevant information on how to get started with the system. | The XCES platform is an instance of the Free Evaluation System Framework (Freva), designed by the Freva team and adapted for the scientists of the ClimXtreme project by Module D. Below you will find relevant information on how to get started with the system. | ||
- | The system can used either through the [[basic_users_guide_xces_new# | + | The system can used either through the [[basic_users_guide_xces_new# |
+ | |||
Line 189: | Line 195: | ||
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 (e.g. for plugins) ===== | ||
- | ===== Using XCES/Freva R/Python environment to locally install your own packages ===== | + | We **strongly** suggest creating your own environment to run your plugin code. There are several reasons for that, among them: |
+ | - to not rely on centrally offered environments, | ||
+ | - to offer flexibility (e.g. via Makefile) to install other packages / binaries via other means (e.g. directly CRAN, other means) | ||
+ | - to allow more reproducibile environment (ideally if e..g the library versions are set frozen). | ||
+ | |||
+ | A way of doing it is creating a '' | ||
+ | * Create a New Environment in Default Location (i.e. ' | ||
+ | < | ||
+ | conda create --name myenv | ||
+ | </ | ||
+ | to find your conda env you simply do '' | ||
+ | * Create a New Environment in a Specific Folder (e.g. in a plugin repo): | ||
+ | < | ||
+ | conda create --prefix / | ||
+ | </ | ||
+ | * Create a New Environment with specific libraries and e.g. python version: | ||
+ | < | ||
+ | conda create --name myenv python=3.8 numpy pandas | ||
+ | </ | ||
+ | |||
+ | You can do more elaborate installations for e.g. your plugin environments, | ||
+ | |||
+ | <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 | ||
+ | </ | ||
+ | |||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ==== Creating a jupyter kernel out of your environment ==== | ||
+ | |||
+ | For that, you will need to previously install the '' | ||
+ | |||
+ | <code python> | ||
+ | conda create --name myenv python=3.8 ipykernel # with conda | ||
+ | python -m pip install ipykernel # with pip | ||
+ | </ | ||
+ | |||
+ | And then, given you are using the python binary of your environment: | ||
+ | |||
+ | <code python> | ||
+ | python -m ipykernel install --user --name=$(KERNEL_NAME) --display-name $(KERNEL_NAME) | ||
+ | </ | ||
+ | |||
+ | ==== Installing 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 freva | ||
+ | freva.config(config_file="/ | ||
+ | </ | ||
+ | that should work on a python script, python env console and jupyter notebook (e.g. [[https:// | ||
+ | |||
+ | Incidentally, | ||
+ | <code python> | ||
+ | import freva | ||
+ | freva.config(config_file="/ | ||
+ | | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== 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 258: | Line 352: | ||
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 | ||
- | </ | ||
- | |||
- | <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 | ||
- | </ | ||
- | |||
- | </ | ||
- | |||
- | |||
===== Additional info ===== | ===== Additional info ===== |