etsap-TIMES / xl2times

Open source tool to convert TIMES models specified in Excel
https://xl2times.readthedocs.io/
MIT License
12 stars 7 forks source link

Cache some of the attributes of TimesModel class #212

Open olejandro opened 7 months ago

olejandro commented 7 months ago

Currently we don't use model.data_years for any processing. It is only needed to generate a corresponding set for GAMS. I expect calling it once after all the processing is done should suffice. I guess we could cache the value?

_Originally posted by @olejandro in https://github.com/etsap-TIMES/xl2times/pull/211#discussion_r1517695106_

olejandro commented 7 months ago

@siddharth-krishna would using @cached_property be useful here?

siddharth-krishna commented 6 months ago

Thanks, nice idea. Though if we are only calling it once, it shouldn't be necessary.

olejandro commented 6 months ago

Actually 3 times, I think: