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

RecursionError: maximum recursion depth exceeded #588

Open
anaprietonem opened this issue Jan 21, 2025 · 0 comments
Open

RecursionError: maximum recursion depth exceeded #588

anaprietonem opened this issue Jan 21, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@anaprietonem
Copy link

anaprietonem commented Jan 21, 2025

What happened?

I have some grib2 files for 3 different variables and I am trying to group them into a single file. However when trying to save the results to this new file I am hitting a RecursionError

What are the steps to reproduce the bug?

See code snippet below:

from earthkit.data import from_source
import sys
import datetime
ds = from_source('empty')
for path in sys.argv[1:]:
    print(path)
    new = from_source('file', path)

    # Define start and end dates for the loop
    start_date = datetime.datetime(2021, 1, 1, 0, 5)
    end_date = datetime.datetime(2021, 1, 10, 10, 50)
    delta = datetime.timedelta(minutes=15)

    # Loop from start_date to end_date
    current_date = start_date
    while current_date <= end_date:
        ds += new.sel(valid_datetime=current_date.isoformat())
        current_date += delta

# Save the final dataset
ds.save('combined.grib')

Where sys.argv[1:] can be a path pointing to the grib file you want to modify.

error logs below:
Image

Version

0.12.0

Platform (OS and architecture)

Linux

Relevant log output

Accompanying data

No response

Organisation

ECMWF

@anaprietonem anaprietonem added the bug Something isn't working label Jan 21, 2025
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
None yet
Development

No branches or pull requests

1 participant