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

'unknown' data name when installing pygrib with pip #218

Open
PouPass opened this issue Apr 4, 2023 · 4 comments
Open

'unknown' data name when installing pygrib with pip #218

PouPass opened this issue Apr 4, 2023 · 4 comments

Comments

@PouPass
Copy link

PouPass commented Apr 4, 2023

I faced the following issue while using pygrib 2.1.4 installed using pip.

File "src/pygrib/_pygrib.pyx", line 538, in pygrib._pygrib.open.select
ValueError: no matches found

The grib file i used is from ECMWF and contain '2m Temperature' and 'Total precipitation' data.

Ubuntu 22.04.2 LTS, Python==3.8.13 in a conda environement.

Using pip

pip install pygrib

Test case :

import pygrib

grb = pygrib.open('resources/forecast.grib')

for entry in grb.read(10):
	print(entry.name)

Output :

unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature
unknown
2 metre temperature

Using conda

conda install pygrib -c conda-forge

Test case :

import pygrib

grb = pygrib.open('resources/forecast.grib')

for entry in grb.read(10):
	print(entry.name)

Output :

Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
Total precipitation
2 metre temperature
@PouPass
Copy link
Author

PouPass commented Apr 4, 2023

Same issue in #125 and #182 ?

@jswhit
Copy link
Owner

jswhit commented Jul 15, 2023

Some grib records don't have a name attribute, apparently. This is not the fault of pygrib.

@PouPass
Copy link
Author

PouPass commented Jul 17, 2023

This issue is related to a different behavior of pygrib when installed using pip or conda. I used the same grib file for my tests and the grib records attribute name are returned correctly when pygrib is installed with conda and returned as unknown when pygrib is installed with pip.

@jswhit
Copy link
Owner

jswhit commented Nov 13, 2023

probably conda is using a newer version of eccodes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants