-
Notifications
You must be signed in to change notification settings - Fork 16
Fix Parquet emitter issues for colony simulations #390
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
base: master
Are you sure you want to change the base?
Changes from all commits
61c3327
2b2c683
08cfe41
233dec3
e92d91b
70b730b
3c5e80a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -452,6 +452,7 @@ def run_simulation(config): | |
| metadata.pop("initial_state", None) | ||
| metadata["git_hash"] = get_git_revision_hash() | ||
| metadata["git_diff"] = get_git_diff() | ||
| metadata = serialize_value(metadata) | ||
|
|
||
| # Since unique numpy updater is an class method, internal | ||
| # deepcopying in vivarium-core causes this warning to appear | ||
|
|
@@ -467,11 +468,20 @@ def run_simulation(config): | |
| topology=composite.topology, | ||
| initial_state=initial_state, | ||
| experiment_id=experiment_id, | ||
| emit_config=config.get("emit_config", False), | ||
|
thalassemia marked this conversation as resolved.
|
||
| emitter=emitter_config, | ||
| progress_bar=config["progress_bar"], | ||
| metadata=metadata, | ||
| profile=config["profile"], | ||
| initial_global_time=config.get("start_time", 0.0), | ||
| emit_topology=config.get("emit_topology", True), | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added missing options with respect to vivarium-core Engine class. Default values also imported from Engine class initiation. |
||
| emit_processes=config.get("emit_processes", False), | ||
| emit_step=config.get("emit_step", 1), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Interesting, I did not know that the |
||
| display_info=config.get("display_info", True), | ||
| global_time_precision=config.get("global_time_precision", None), | ||
| store_schema=config.get("store_schema", None), | ||
| description=config.get("description", ""), | ||
| experiment_name=config.get("experiment_name", None), | ||
| ) | ||
| # Unnecessary reference to initial_state | ||
| engine.initial_state = None | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,7 @@ | ||
| import numpy as np | ||
| import orjson | ||
| import re | ||
| import ast | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just moved it as requested. |
||
| from unum import Unum | ||
| from vivarium.core.registry import Serializer | ||
| from vivarium.library.topology import convert_path_style, normalize_path | ||
|
|
@@ -80,9 +81,12 @@ def deserialize(self, data): | |
| matched_regex = self.regex_for_serialized.fullmatch(data) | ||
| if matched_regex: | ||
| data = matched_regex.group(1) | ||
| data = orjson.loads(data) | ||
| if data.startswith("("): | ||
| data = ast.literal_eval(data) | ||
| else: | ||
| data = orjson.loads(data) | ||
| rng = np.random.RandomState() | ||
| rng.set_state(data) | ||
| rng.set_state(tuple(data)) | ||
| return rng | ||
|
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Serialize metadata using default serializer.