with_interval_cache

with_interval_cache(get_data_function)[source]

Wraps a get_data_function with cache functionality.

Should only be used when you expect to request the same or overlapping intervals. The decorator makes sure you only request the missing data. E.g. when requesting data for the period [3, 4) and then [2, 5), the last request is transformed into two requests, namely [2, 3) and [4, 5).