Skip to content

Commit 33c54a2

Browse files
authored
Merge pull request #115 from bonsai-rx/data-object-notes
Add technical note and caveats of data objects
2 parents 84a9724 + c0a3be3 commit 33c54a2

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

articles/scripting-expressions-overview.md

+10-1
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,13 @@ new(
118118
)
119119
```
120120

121-
The example above projects the two unnamed items of a tuple into a new data object with an `X` and a `Y` property.
121+
The example above projects the two unnamed items of a tuple into a new data object with an `X` and a `Y` property.
122+
123+
> [!Tip]
124+
> Dynamic data classes are most useful when combined with operators which leverage the named structure of input types, e.g. [`CsvWriter`](xref:Bonsai.IO.CsvWriter) maps the type properties to header names. They are also useful to increase readability by naming the members of otherwise anonymous tuples, such as those generated by [`Zip`](xref:Bonsai.Reactive.Zip) and other combinators.
125+
126+
> [!Note]
127+
> Dynamic data classes are uniquely identified by their specification. If two data object initializers use matching property names with identical types declared in the same order, then the two expressions will be resolved to the same data object type. This allows type inference to work on reactive operators which require matching types in all the input sequences, e.g. [`Merge`](xref:Bonsai.Reactive.Merge).
128+
129+
> [!Warning]
130+
> Dynamic data classes do not have a predictable type signature and therefore cannot currently be serialized in the workflow file, nor be used in custom scripting extensions.

0 commit comments

Comments
 (0)