Skip to content

Allow user to specify that profiles are the same as a previous scenario#313

Merged
danielolsen merged 3 commits intodevelopfrom
daniel/profiles_as
Oct 15, 2020
Merged

Allow user to specify that profiles are the same as a previous scenario#313
danielolsen merged 3 commits intodevelopfrom
daniel/profiles_as

Conversation

@danielolsen
Copy link
Copy Markdown
Contributor

Purpose

When we're iterating through scenarios with identical renewable capacity/profiles, most of the scenario setup time is in uploading another identical copy of the same profiles to the server. This allows the user to specify 'don't do that, just directly copy them from a given previous scenario'.

What is the code doing

  • In Execute, we add a optional parameter to the prepare_simulation_input method to specify e.g. profiles_as=1464, and we type-check this input.
  • In SimulationInput, we add an optional parameter to the prepare_profile method. If this is given, then we perform a cp via the ssh connection, raising an error if the call does not complete successfully.

Validation

Testing on my local machine & internet connection, this reduces the scenario setup time from 15-20 minutes to 2 minutes. I've tested with the first commit (logic in Execute), but not with the second (logic in SimulationInput).

Time to review

15 minutes. This is a relatively low priority to merge, since I can run this branch locally and there shouldn't be any downstream effects.

)
copy_to_TMP_DIR = posixpath.join(
server_setup.EXECUTE_DIR, f"scenario_{self._scenario_info['id']}"
)
Copy link
Copy Markdown
Collaborator

@rouille rouille Oct 15, 2020

Choose a reason for hiding this comment

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

can we use from_dir and to_dir for the variables' name. I think it would be more readable.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown
Collaborator

@rouille rouille left a comment

Choose a reason for hiding this comment

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

Cool. Glad to know that it is going to speed up the process.

@danielolsen danielolsen merged commit 50399e2 into develop Oct 15, 2020
@danielolsen danielolsen deleted the daniel/profiles_as branch October 15, 2020 23:47
@ahurli ahurli mentioned this pull request Mar 11, 2021
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

Successfully merging this pull request may close these issues.

2 participants