You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make _recompile derived state computed from _changes #74
_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.
defreset_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.
Activity