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

Remove clean_assets #644

Closed
wants to merge 2 commits into from
Closed

Remove clean_assets #644

wants to merge 2 commits into from

Conversation

tsmbland
Copy link
Collaborator

@tsmbland tsmbland commented Jan 27, 2025

This doesn't have any impact apart from the trade model, which is broken anyway. It also uses the agent.forecast_year attribute which I'm trying to get rid of in #645, so it's just easier to delete the whole thing

@tsmbland tsmbland marked this pull request as ready for review January 30, 2025 15:58
@tsmbland tsmbland requested a review from dalonsoa January 30, 2025 15:58
Copy link
Collaborator

@dalonsoa dalonsoa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks OK, but just for clarity, what was this supposed to do and why it was not used? I see the docstrings of the removed functions. Is this cleaning not needed to run MUSE?

@@ -275,7 +275,7 @@ def _shared_capacity(


def _standardize_inputs(
housekeeping: str | Mapping | Callable = "clean",
housekeeping: str | Mapping | Callable = "noop",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ehmmm?

@tsmbland
Copy link
Collaborator Author

"noop" means no operation.

By default, newcapa agents (used for most simulations) were using "noop", whereas retrofit and noninvesting agents were using "clean" (I don't know why it was done like this).

So the deleted code was only ever seen by some simulations

The purpose of the "clean" seems three-fold:

  • interpolate capacity data so the required years are covered
  • delete data from before the current year
  • delete any assets that have zero capacity now and in the future

The first isn't required as this interpolation happens repeatedly elsewhere. The latter two aren't strictly necessary as this is just dropping unused data, but this could have an impact on performance, otherwise self.assets just ends up accumulating stale assets.

Thinking about this again, it might be better if we don't delete this, start using it for all models, and I can modify it so it just drops stale data without doing the interpolation (and this won't need the forecast_year attribute, which I'm trying to get rid of)

See #652

@tsmbland
Copy link
Collaborator Author

tsmbland commented Feb 3, 2025

Dropped in favour of #652

@tsmbland tsmbland closed this Feb 3, 2025
@tsmbland tsmbland deleted the clean branch February 3, 2025 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants