-
Notifications
You must be signed in to change notification settings - Fork 3
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
base: main
Are you sure you want to change the base?
Conversation
…reshly load a freva config
There was a problem hiding this 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.
.. 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. | ||
|
||
|
There was a problem hiding this comment.
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.
.. 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() | ||
|
There was a problem hiding this comment.
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.
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.