Skip to content

Fix Parquet emitter issues for colony simulations#390

Open
katha815 wants to merge 7 commits intoCovertLab:masterfrom
katha815:pr-pq-emitter-fix
Open

Fix Parquet emitter issues for colony simulations#390
katha815 wants to merge 7 commits intoCovertLab:masterfrom
katha815:pr-pq-emitter-fix

Conversation

@katha815
Copy link
Copy Markdown

@katha815 katha815 commented Feb 6, 2026

Summary

Fixes several issues preventing Parquet emission when resuming colony simulations from saved JSON state files.

This PR is motivated by and discussed in detail in issue #389.

Changes

  • Fix RandomState deserialization mismatch between JSON and Python tuple formats.
  • Use default serializer to wrap metadata.
  • Ensure emit_config and other features of vivarium.core.engine will be included in engine process.

Context

These issues occur when running ecoli_engine_process.py with "emitter": "parquet" under baseline colony simulations (no online emitter).

@katha815 katha815 changed the title Fix Parquet emitter for colony simulations Fix Parquet emitter issues for colony simulations Feb 6, 2026
Copy link
Copy Markdown
Contributor

@thalassemia thalassemia left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! I left comments on all three changes. I'm very busy next week, but I'll try to get a PR up fixing issue 4 in the linked issue by next Friday.

import numpy as np
import orjson
import re
import ast
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Just moved it as requested.

metadata=metadata,
profile=config["profile"],
initial_global_time=config.get("start_time", 0.0),
emit_topology=config.get("emit_topology", True),
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The 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.

Change serialization to preserve original value type.
Serialize metadata using serialize_value as recommended.
Copy link
Copy Markdown
Author

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.

@katha815 katha815 requested a review from thalassemia February 12, 2026 17:59
@thalassemia thalassemia added long ci PR nearly ready to merge so run longer CI tests labels Mar 4, 2026
Copy link
Copy Markdown
Contributor

@thalassemia thalassemia left a comment

Choose a reason for hiding this comment

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

Sorry for the delay! This looks good to me. Thanks!

initial_global_time=config.get("start_time", 0.0),
emit_topology=config.get("emit_topology", True),
emit_processes=config.get("emit_processes", False),
emit_step=config.get("emit_step", 1),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Interesting, I did not know that the emit_step was configurable. Thanks for filling these in!

@thalassemia thalassemia added long ci PR nearly ready to merge so run longer CI tests and removed long ci PR nearly ready to merge so run longer CI tests labels Mar 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

long ci PR nearly ready to merge so run longer CI tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants