Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add information for python on how to plug a plugin and how to freshly load a freva config #238

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eelucio
Copy link
Contributor

@eelucio eelucio commented Oct 28, 2024

I realised that different users have been asking these questions so I documented how to do it (unless we update the code, see issues #233, #235 that I was unable to solve).

Still I have the feeling that the information on how to load freva is pretty much scattered around in the docu, if you agree, once merged I will summarize the different ways to connect to freva + a very short introduction to freva-client in the DKRZ documentation so if anyone asks we can refer them to the DKRZ page.

Copy link
Member

@antarcticrainforest antarcticrainforest left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check #239 which makes the workarounds mentioned here depricated.

Comment on lines +385 to +400
.. note::
You cannot freshly set a configuration via ``freva.config("/work/freva/evaluation_system.conf")``
if there was no previous ones. For that you will need to:

::

# 1. Set up the environment variables:
import os
os.environ["EVALUATION_SYSTEM_CONFIG_FILE"]="/work/freva/evaluation_system.conf"
os.environ["EVALUATION_SYSTEM_CONFIG_DIR"]="/work/freva"
# 2. load Freva library:
import freva

Then, you can use :py:class:`freva.config` to switch to a new configuration.


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed with #239.

Comment on lines +175 to +185
.. note::
In python (e.g. jupyter notebook) you will need first to add your plugin(s) as
an entry in the ``EVALUATION_SYSTEM_PLUGINS`` environment variable and *then*
import the Freva module (not the other way around)::

import os
os.environ["EVALUATION_SYSTEM_PLUGINS"] = "/path1,plugin1:/path2,plugin2:/path3,plugin3"

import freva
freva.get_tools_list()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed with #239. If you want you can mention the freva.config(plugin_path="...") option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants