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

Change order of pre_run hook in SimulationManager #2582

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

marcelkrueger
Copy link
Contributor

@marcelkrueger marcelkrueger commented Jan 10, 2023

By rearranging the pre_run hook call it allows callees to access information about the simulation time in their pre_run implementation.
Otherwise callees are not able to reliable get these information before the run starts as the simulation time is only known when calling the run() method and the sim time is currently set after the pre_run hook.

Additionally, the pre_run hook is only called if a run will take place at all.

As far as I see the reordering should be safe as there are no dependencies between the reordered lines.

@jougs jougs self-requested a review January 12, 2023 11:27
@jougs jougs added I: Internal API Changes were introduced in basic internal workings of the simulator that developers need to know S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation. labels Jan 12, 2023
@jougs jougs requested a review from med-ayssar January 12, 2023 11:35
Copy link
Contributor

@jougs jougs left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@med-ayssar
Copy link
Contributor

I have no objection, thanks!

@terhorstd terhorstd added this to PRs in progress in Kernel via automation Jan 17, 2023
@terhorstd
Copy link
Contributor

@med-ayssar , could you give approval in the review, so that we can more easily spot that this is ready to merge?

@jougs jougs changed the title Change order of pre_run hook in sim manager Change order of pre_run hook in SimulationManager Jan 17, 2023
@jougs jougs merged commit 1a3e6f8 into nest:master Jan 17, 2023
Kernel automation moved this from PRs in progress to Done (PRs and issues) Jan 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I: Internal API Changes were introduced in basic internal workings of the simulator that developers need to know S: Normal Handle this with default priority T: Maintenance Work to keep up the quality of the code and documentation.
Projects
Kernel
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants