Record flags in history and draw them as steps
A bool was excluded from the history as "not a measurement", so a true/false port had no curve in the node panel and none on an edge — only the word. It is recorded as 0/1 now and drawn as steps, since a bezier through two states slopes through readings that never happened. The axis is pinned to 0..1, so a flag that was never on sits at the floor rather than mid-box. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -45,12 +45,16 @@ def test_the_series_is_capped():
|
||||
assert points[-1] == (139.0, 139.0)
|
||||
|
||||
|
||||
def test_only_numbers_are_recorded():
|
||||
def test_numbers_and_flags_are_recorded_and_text_is_not():
|
||||
"""A flag plots as the step between 0 and 1; text has no axis to sit on."""
|
||||
state = MemoryState()
|
||||
state.append_history({"f.text": "warm", "f.flag": True, "f.temp": 21}, ts=1.0)
|
||||
state.append_history(
|
||||
{"f.text": "warm", "f.flag": True, "f.off": False, "f.temp": 21}, ts=1.0
|
||||
)
|
||||
|
||||
assert state.history("f.text") == []
|
||||
assert state.history("f.flag") == []
|
||||
assert state.history("f.flag") == [(1.0, 1.0)]
|
||||
assert state.history("f.off") == [(1.0, 0.0)]
|
||||
assert state.history("f.temp") == [(1.0, 21.0)]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user