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

Cache some of the attributes of TimesModel class #212

Open
olejandro opened this issue Mar 8, 2024 · 3 comments
Open

Cache some of the attributes of TimesModel class #212

olejandro opened this issue Mar 8, 2024 · 3 comments

Comments

@olejandro
Copy link
Member

olejandro commented Mar 8, 2024

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 #211 (comment)

@olejandro
Copy link
Member Author

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

@siddharth-krishna
Copy link
Collaborator

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

@olejandro
Copy link
Member Author

Actually 3 times, I think:

  • once to get data_years for export to dd
  • once to determine past_years
  • and once to determine model_years

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants