Location:
bionetgen/modelapi/blocks.py:46 (docstring on _recompile)
bionetgen/modelapi/blocks.py:142 (reset_compilation_tags body)
Original markers:
_recompile : bool
a tag that tells a potential future simulator if the model
needs to be recompiled. TODO: has to be computed from _changes
property upon get request.
def reset_compilation_tags(self) -> None:
# TODO: Make these properties such that it checks each
# item for changes/recompile tags
# for item in self.items:
# self.items[item]._recompile = False
# self.items[item]._changes = {}
_recompile is currently an imperative bool flag set to True in add_item and reset by reset_compilation_tags. It can drift out of sync with the actual _changes dict — e.g. if items are mutated through their own _changes machinery without going through the block's add_item path.
Recent context: 8de992a (Deduplicate block __setattr__ via shared helper) routed all 17 subclass setters through _set_item_attribute, which uniformly writes self._changes[name] = value. That makes _changes the canonical source of truth for "this block has been edited," which in turn makes deriving _recompile straightforward.
What would unblock this: convert _recompile to a @property that returns bool(self._changes) (or any(item._recompile for item in self.items.values()) if per-item tracking is required). Apply the same shape for cascading resets across child items if needed.
Discovered during: non-Atomizer TODO/FIXME triage sweep, 2026-05-08.
Location:
bionetgen/modelapi/blocks.py:46(docstring on_recompile)bionetgen/modelapi/blocks.py:142(reset_compilation_tagsbody)Original markers:
_recompileis currently an imperative bool flag set toTrueinadd_itemand reset byreset_compilation_tags. It can drift out of sync with the actual_changesdict — e.g. if items are mutated through their own_changesmachinery without going through the block'sadd_itempath.Recent context:
8de992a(Deduplicate block__setattr__via shared helper) routed all 17 subclass setters through_set_item_attribute, which uniformly writesself._changes[name] = value. That makes_changesthe canonical source of truth for "this block has been edited," which in turn makes deriving_recompilestraightforward.What would unblock this: convert
_recompileto a@propertythat returnsbool(self._changes)(orany(item._recompile for item in self.items.values())if per-item tracking is required). Apply the same shape for cascading resets across child items if needed.Discovered during: non-Atomizer TODO/FIXME triage sweep, 2026-05-08.