Expressions unification#177
Open
DaanVanVugt wants to merge 6 commits into
Open
Conversation
DaanVanVugt
requested review from
MireilleSchneider,
SBlokhuizen and
maarten-ic
as code owners
June 25, 2026 11:56
SBlokhuizen
reviewed
Jun 25, 2026
| @@ -0,0 +1,135 @@ | |||
| import ast | |||
Comment on lines
86
to
89
| # Derived waveforms are parsed as YAML block strings | ||
| elif "'" in editor_text or '"' in editor_text: | ||
| indented_text = textwrap.indent(editor_text, " ") | ||
| waveform_yaml = f"{name}: |\n{indented_text}" |
Collaborator
There was a problem hiding this comment.
Don't think this will work anymore with the new expressions.
Comment on lines
+9
to
+12
| # Configuration schema version. Bumped to 2 when bare-string values became literal | ||
| # string constants instead of derived-waveform expressions. | ||
| CURRENT_SCHEMA_VERSION = 2 | ||
|
|
Collaborator
There was a problem hiding this comment.
If we want to have YAML schema versions, should we use semantic versioning instead?
DaanVanVugt
commented
Jul 7, 2026
- Rename is_string -> is_categorical so booleans are treated like strings (held as a zero-order-hold step rather than coerced to float and interpolated) - Reject mixing categorical (string/boolean) and numeric values within a single waveform, since the gaps between them cannot be interpolated - Document the constant tendency value types (float/int/categorical) in the docs
np.full preserved int dtype for integer constants, so get_value() (the time=None path) returned an int64 array while the explicit-time path upcast to float. Force float for numeric values; categorical values (str/bool) keep their native dtype.
A piecewise-constant tendency that holds each value from its breakpoint until the next, supporting non-numeric (string/boolean) values. Registered as 'steps'. - start is inferred from the first breakpoint; an explicit end/duration may be given so the final value is held for a real duration (defaults to the last time) - shared time/value validation and start/end resolution are factored out of PiecewiseLinearTendency via overridable _coerce_value / _resolve_time_bounds hooks, so the steps tendency only overrides what genuinely differs
Replace DerivedWaveform with an ExpressionTendency on the single Waveform
class, integrated with develop's import/static waveforms. Bare scalars are
now classified by content: a number is a constant, a string that references
another waveform or uses an operator/function is an expression, and a plain
word is a literal string constant. Explicit {value:}/{expression:} override
the heuristic. Example config uses the compact bare form.
DaanVanVugt
force-pushed
the
expressions-unification
branch
from
July 10, 2026 11:29
ffb652f to
166b751
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #176