Skip to content

Commit

Permalink
added warnings when tweaking eccodes
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankrb committed May 18, 2022
1 parent 48ca883 commit f97bc93
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ecmwflibs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,22 @@
"GRIB_SAMPLES_PATH",
):
if env in os.environ:
del os.environ[env]
if "ECMWFLIBS_" + env in os.environ:
os.environ[env] = os.environ["ECMWFLIBS_" + env]
warnings.warn(
"ecmwflibs: using provided '{}' set to '{}".format(
env, os.environ[env]
)
)
else:
warnings.warn(
(
"ecmwflibs: ignoring provided '{}' set to '{}'. "
"If you want ecmwflibs to use this environment variable, use ECMWFLIBS_{} instead. "
"If you want to use your own ECCODES library, use ECMWFLIBS_ECCODES."
).format(env, os.environ[env], env)
)
del os.environ[env]

# This comes *after* the variables are set, so c++ has access to them
try:
Expand Down

0 comments on commit f97bc93

Please sign in to comment.