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

Add backup writing to vivarium simulation Context #455

Merged

Conversation

patricktnast
Copy link
Contributor

@patricktnast patricktnast commented Aug 1, 2024

Add backup writing to vivarium simulation Context

Description

Changes and notes

This is a prerequisite for the simulation backups in psimulate. I elected to make the SimulationContext pickle itself, and also make a new public "past stop time" method that we can use from VCT.

For mysterious reasons, we can't pickle the sim object within a pytest context unless I globally disable cap logging with "pytest -s". Pickling works just fine in normal use, and trying to disable caplog or capsys etc. per-test hasn't worked so far. this appears to be something wrong on dill's end, cf
uqfoundation/dill#663
pytest-dev/pytest#10845
pytest-dev/pytest#12448
For now I've put in a skipped test.

Testing

@patricktnast patricktnast changed the base branch from release-candidate-spring to main August 1, 2024 20:43
@patricktnast patricktnast changed the base branch from main to release-candidate-spring August 1, 2024 20:43
@albrja albrja self-requested a review August 5, 2024 21:53
src/vivarium/framework/engine.py Outdated Show resolved Hide resolved
tests/framework/test_engine.py Outdated Show resolved Hide resolved
src/vivarium/framework/engine.py Outdated Show resolved Hide resolved
tests/framework/test_engine.py Outdated Show resolved Hide resolved
src/vivarium/framework/engine.py Show resolved Hide resolved
@patricktnast patricktnast merged commit 0e60bf7 into release-candidate-spring Aug 12, 2024
6 checks passed
@patricktnast patricktnast deleted the feature/pnast/MIC-5034-psimulate-backup branch August 12, 2024 18:58
stevebachmeier pushed a commit that referenced this pull request Aug 13, 2024
* add feature and test

* remove unused import

* add skipped test

* lint

* lint

* add test and adjust sim.run()

* lint

* change protocol

* add logging statement

* Update test_engine.py

add ticket

* add self.current_time

* Revert "add self.current_time"

This reverts commit 322fd19.

* use current time but do it right instead of wrong
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.

5 participants