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

Albrja/mic 5383/psimulate clock configuration #236

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

albrja
Copy link
Contributor

@albrja albrja commented Oct 4, 2024

Albrja/mic 5383/psimulate clock configuration

Updates how vivarium work horse gets number of simulation steps

Changes and notes

-Updates vivarium work horse method to get number of steps from InteractiveContext method

Testing

Successfully ran parallel simulation with custom clock

end_time = pd.Timestamp(**sim.configuration.time.end.to_dict())
step_size = pd.Timedelta(days=sim.configuration.time.step_size)
num_steps = int(math.ceil((end_time - start_time) / step_size))
num_steps = sim.get_number_of_steps(start_time)
Copy link
Contributor

Choose a reason for hiding this comment

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

We shouldn't be providing start time to this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But we have to get it from the Parallel sim context or the backups

Copy link
Contributor

Choose a reason for hiding this comment

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

On the line above, it gets the start time from sim.configuration.time.start Isn't that just the model spec start time? Or does this value actually change in the event you're starting from a backup?

CHANGELOG.rst Outdated
@@ -1,3 +1,7 @@
**2.0.4 - TBD**
Copy link
Contributor

Choose a reason for hiding this comment

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

just a reminder to change the date here

end_time = pd.Timestamp(**sim.configuration.time.end.to_dict())
step_size = pd.Timedelta(days=sim.configuration.time.step_size)
num_steps = int(math.ceil((end_time - start_time) / step_size))
num_steps = sim.get_number_of_steps(start_time)
Copy link
Contributor

Choose a reason for hiding this comment

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

On the line above, it gets the start time from sim.configuration.time.start Isn't that just the model spec start time? Or does this value actually change in the event you're starting from a backup?

@albrja albrja merged commit e283932 into main Oct 7, 2024
6 checks passed
@albrja albrja deleted the albrja/mic-5383/psimulate-clock-configuration branch October 7, 2024 22:02
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.

4 participants