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

modify FDB env var checks #414

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/earthkit/data/sources/fdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ def __init__(self, *args, stream=True, **kwargs):
self.request.update(a)
self.request.update(kwargs)

fdb_home = os.environ.get("FDB_HOME", None)
fdb_conf = os.environ.get("FDB5_CONFIG", None)
if fdb_home is None and fdb_conf is None:
fdb5_home = os.environ.get("FDB5_HOME", None)

Choose a reason for hiding this comment

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

FDB5_DIR can also be used to locate the library

fdb5_conf = os.environ.get("FDB5_CONFIG", None)
fdb5_config_file = os.environ.get("FDB5_CONFIG_FILE", None)
if fdb5_home is None and (fdb5_conf is None and fdb5_config_file is None):
raise ValueError(
"""Neither FDB_HOME nor FDB5_CONFIG environment variable
was set! Please define either one to access FDB.
"""FDB5_HOME and either FDB5_CONFIG or FDB5_CONFIG_FILE need to be set.
See: https://fields-database.readthedocs.io for details about FDB."""
)

Expand Down