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

get-airnow xarray error #258

Open
dwfncar opened this issue May 22, 2024 · 4 comments
Open

get-airnow xarray error #258

dwfncar opened this issue May 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dwfncar
Copy link
Collaborator

dwfncar commented May 22, 2024

melodies-monet get-airnow --start-date 20240521 --end-date 20240522

results in an xarray error

Fetching data with monetio ...
Aggregating AIRNOW files...
Building AIRNOW URLs...
Adding in Meta-data
Fetching data with monetio succeeded in 0.619 seconds
Forming xarray Dataset ...
Forming xarray Dataset failed in 0.00887 seconds
Error message: single positional indexer is out-of-bounds

@zmoon
Copy link
Collaborator

zmoon commented May 23, 2024

@dwfncar I suspect this means no data was found for the period at the time of your invocation. It works for me now. But the error message could certainly be improved for this situation. In the future, note that if you add the --debug flag you can see the full traceback.

@blychs
Copy link
Collaborator

blychs commented Oct 8, 2024

@rschwant What is the task here? Is it improving the error message, as Zach mentioned?

@rschwant
Copy link
Collaborator

rschwant commented Oct 8, 2024

I'm not sure. I think this was resolved right @zmoon. I think David was looking for data that was not yet available as there is a delay for uploading the data to the amazon servers we use for downloading.

@zmoon
Copy link
Collaborator

zmoon commented Oct 8, 2024

We have yet to improve the error message. It's the .iloc[0] here that causes this error when there is no data for a requested period.

units = df[unit_cols][~df[unit_cols].isnull()].iloc[0].to_dict()

So, just need to check if it's empty and print an appropriate error message (and exit with rc 1) before attempting to create the units dict.

There's another confusing error you can get if you request when the files on S3 are in the midst of being updated/uploaded, Dask complaining about files not matching dtype/cols.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

4 participants