Comments (13)
I just tried it and it works for me
import os
print ("Before ECCODES_DEFINITION_PATH ", os.environ['ECCODES_DEFINITION_PATH'])
print ("Before GRIB_DEFINITION_PATH ", os.environ['GRIB_DEFINITION_PATH'])
from gribapi import *
#from eccodes import *
print ("After ECCODES_DEFINITION_PATH ", os.environ['ECCODES_DEFINITION_PATH'])
print ("After GRIB_DEFINITION_PATH ", os.environ['GRIB_DEFINITION_PATH'])
I run with:
ECCODES_DEFINITION_PATH=edp GRIB_DEFINITION_PATH=gdp python3 test_env.py
Tried with importing eccodes as well. No problem
from eccodes-python.
May be there is something wrong in my environment or I missed something in my build of eccodes library...
I'm on RockyLinux 8.5 with python 3.9.7
from eccodes-python.
Maybe something weird in eccodes include file eccodes_config.h :
/* #undef HAVE_MEMFS */
#ifdef HAVE_MEMFS
#undef ECCODES_DEFINITION_PATH
#define ECCODES_DEFINITION_PATH "/MEMFS/definitions"
#undef ECCODES_SAMPLES_PATH
#define ECCODES_SAMPLES_PATH "/MEMFS/samples"
#undef ECCODES_IFS_SAMPLES_PATH
#define ECCODES_IFS_SAMPLES_PATH "/MEMFS/ifs_samples"
#endif
and gribapi.gribapi.codes_definition_path()
returns /MEMFS/definitions
from eccodes-python.
The MEMFS feature is described here:
https://confluence.ecmwf.int/pages/viewpage.action?pageId=143037711
from eccodes-python.
I didn't build eccodes with option ENABLE_MEMFS, but it should be OFF by default ?
My build options are : -DENABLE_PYTHON=OFF -DENABLE_JPG=ON -DENABLE_NETCDF=ON -DENABLE_FORTRAN=ON
codes_info
is ok but, when using eccodes-python 1.4.1, after from gribapi import *
, "something" seems to undefine ECCODES_DEFINITION_PATH as if HAVE_MEMFS was defined in eccodes_config.h
from eccodes-python.
May be I should build explicitely with -DENABLE_MEMFS=OFF
?
from eccodes-python.
I think I found the reason of my problem.
The python package ecmwflibs is also available in my environment (release 0.4.6, may be I should update). It's a required dependency of climetlab.
So eccodes-python doesn't use my eccodes build but the libeccodes library available in ecwmflibs and I suppose this library is built with mode memfs activated ?
Is there a way to force eccodes-python and other ecmwf python packages to use the local built eccodes library or at least to deactivate memfs mode (we need to use local definitions) ?
from eccodes-python.
May be it would be better to use ecmwlibs libraries only if the required libraries are not found rather than the opposite ?
from eccodes-python.
Yes, it seems that I can deactivate the usage of the libeccodes library provided by ecmwflibs by setting the environment variable ECMWFLIBS_ECCODES to my locally built eccodes library.
This is not very intuitive...
from eccodes-python.
From my point of vue, it's not a good idea to activate by default the MEMFS option in the eccodes library provided by ecmwflibs.
from eccodes-python.
May be this issue is rather an ecmwflibs issue...
from eccodes-python.
Yes, it seems that I can deactivate the usage of the libeccodes library provided by ecmwflibs by setting the environment variable ECMWFLIBS_ECCODES to my locally built eccodes library.
This is not very intuitive...
I think this is the main issue (the only issue?): "This is not very intuitive".
Perhaps eccodes-python should warn when there are env variables and they are ignored because it chooses ecmwflibs instead? And give a hint to use ECMWFLIBS_ECCODES?
from eccodes-python.
The commit ecmwf/ecmwflibs@f97bc93 in ecmwflibs solves the problem that "this is not intuitive". Adding warning and help when env variables are ignored.
This issue can be closed.
from eccodes-python.
Related Issues (20)
- Unexpected behavior if not all GRIB messages in a file are read HOT 1
- data file tiggelam_cnmc_sfc.grib2 not included in released tar file eccodes-1.4.0.tar.gz HOT 7
- Can eccodes decode buffr radar image? HOT 6
- open up discussion tab on github?
- Please use the warnings library for selfcheck HOT 6
- failing tests due to missing sample file. HOT 1
- read data from bytes object HOT 2
- Reading NCEP BUFR with Local Tables HOT 2
- Please support Python 3.10 (and 3.11) HOT 2
- Add support for `GRIB_TYPE_BYTES` to `codes_get_native_type` and `codes_get_array` HOT 4
- `codes_get` silently returns `None` for unsupported key types HOT 3
- Please support Python 3.11 HOT 1
- Latitude/longitude grid inconsistent behavior between GRIB1 and GRIB2 HOT 5
- Add method to access the result of the json bufr_dump HOT 5
- Update min_recommended_version for eccodes HOT 3
- Enabling thread safety using pip HOT 2
- aarch64 supports HOT 4
- 1.7.0: build fails with gcc error HOT 3
- Doesn't install on ubuntu HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eccodes-python.