Skip to content

Commit

Permalink
Merge pull request #129 from b8raoult/master
Browse files Browse the repository at this point in the history
Add support for pyeccodes (experimental)
  • Loading branch information
alexamici committed Mar 12, 2020
2 parents 2f50a1e + 1547c0d commit d838014
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion cfgrib/__init__.py
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

__version__ = '0.9.7.7.dev0'
__version__ = '0.9.8.0.dev0'

# cfgrib core API depends on the ECMWF ecCodes C-library only
from .cfmessage import CfMessage
Expand Down
13 changes: 8 additions & 5 deletions cfgrib/messages.py
Expand Up @@ -29,11 +29,14 @@
import attr
import numpy as np

# select between using the external ecCodes bindings or the internal implementation
if os.environ.get('CFGRIB_USE_EXTERNAL_ECCODES_BINDINGS'):
import eccodes
else:
from . import bindings as eccodes
try:
# select between using the external ecCodes bindings or the internal implementation
if int(os.environ.get('CFGRIB_USE_EXTERNAL_ECCODES_BINDINGS', '0')):
import eccodes
else:
from . import bindings as eccodes
except RuntimeError:
import pyeccodes.compat as eccodes

eccodes_version = eccodes.codes_get_api_version()

Expand Down

0 comments on commit d838014

Please sign in to comment.