IAMconsortium / pyam

Analysis & visualization of energy & climate scenarios
https://pyam-iamc.readthedocs.io/
Apache License 2.0
227 stars 119 forks source link

Better reliability of `lazy_read_iiasa()` #703

Open danielhuppmann opened 2 years ago

danielhuppmann commented 2 years ago

696 added a top-level function lazy_read_iiasa() which tries to load from file before querying the database. One problem with the current implementation is that the file does not "remember" the filters applied for querying an existing file.

For example, if you

df = lazy_read_iiasa("some/file.csv", TEST_API, model="model_a")

and later

df = lazy_read_iiasa("some/file.csv", TEST_API, model="model_b")

you will get a different result for the second call depending on whether any data in model_b changed in the database in the meantime.

I think that @phackstock implemented some smart solutions for such a problem in the downscaling-package...