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
Copy file name to clipboardExpand all lines: articles/editor.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ The most useful action to learn your way around the `Workflow` panel is right-cl
48
48
If only one node is selected, the `Output` menu item will display the type of the elements emitted by that operator sequence.
49
49
50
50
> [!Tip]
51
-
> If the output of an operator is a complex type, you can inspect its public data members. Clicking on any of the sub-items will automatically place a new [`MemberSelector`](xref:Bonsai.Expressions.MemberSelectorBuilder) operator to pick the specified data member from the output of the node.
51
+
> If the output of an operator is a complex type, you can inspect its public data members. Clicking on any of the sub-items will automatically place a new [`MemberSelector`] operator to pick the specified data member from the output of the node.
52
52
53
53
The context menu also allows you to externalize public properties of the operator as explicit nodes in the workflow using the `Externalize Property` drop-down menu. Once a property is externalized, you can connect other nodes in the workflow to it so you can change the value of the property dynamically (see the [Property Mapping](xref:property-mapping) section for more information).
54
54
@@ -137,7 +137,7 @@ The `Explorer` panel also supports workflow navigation by providing a hierarchic
Each operator exposes a set of configuration properties that parameterize the operator's behaviour (e.g., the [`Timer`](xref:Bonsai.Reactive.Timer) operator exposes the period between generated values, whereas an image [`Threshold`](xref:Bonsai.Vision.Threshold) exposes the brightness cutoff value applied to individual pixels).
140
+
Each operator exposes a set of configuration properties that parameterize the operator's behaviour (e.g., the [`Timer`] operator exposes the period between generated values, whereas an image [`Threshold`] exposes the brightness cutoff value applied to individual pixels).
141
141
142
142
The `Properties` panel will display all the configuration properties which are available for the currently selected operator. A summary description of the currently selected property can be found in the textbox at the bottom of the panel. Similarly, a description of the behaviour of the currently selected operator itself is shown at the top of the panel.
143
143
@@ -215,3 +215,10 @@ Below is a summary of the most used actions and shortcuts in the workflow editor
215
215
| Open context menu | <kbd>Shift</kbd>+<kbd>F10</kbd> |
Copy file name to clipboardExpand all lines: articles/observables.md
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ In reactive programming, we compose operations on sequences (generation, filteri
26
26
27
27
Arrows entering the box indicate that the operator is receiving notifications from the observable sequence that it is subscribed to. Arrows leaving the box show items that are emitted by the operator itself. If no `subscribe` arrow is explicitly indicated in the diagram, it is assumed to be placed at the start of the source sequence.
28
28
29
-
In this case we can see from the diagram that the [`Condition`](xref:Bonsai.Reactive.Condition) operator is filtering the input notifications from the source sequence: only notifications with a specific shape are sent out in the result sequence.
29
+
In this case we can see from the diagram that the [`Condition`] operator is filtering the input notifications from the source sequence: only notifications with a specific shape are sent out in the result sequence.
30
30
31
31
## Bonsai Workflows
32
32
@@ -67,7 +67,7 @@ A video file also generates a sequence of images, but in contrast to the camera,
67
67
68
68
Understanding the *temperature* of an observable sequence is particularly important when that sequence is shared between multiple operators. It can help to understand whether those operators will see the same data items, and what the effect of subscribing to the shared sequence at different times is going to be.
69
69
70
-
It is also possible to change the temperature of observable sequences using reactive operators. The [`Replay`](xref:Bonsai.Reactive.Replay) operator can be used to subscribe to the camera and start recording all incoming images. Every time a downstream observer subscribes to the result sequence, it will then replay all images on-demand, even if they subscribe late. The originally *hot* sequence has been turned into a *cold* observable by the replay behaviour.
70
+
It is also possible to change the temperature of observable sequences using reactive operators. The [`Replay`] operator can be used to subscribe to the camera and start recording all incoming images. Every time a downstream observer subscribes to the result sequence, it will then replay all images on-demand, even if they subscribe late. The originally *hot* sequence has been turned into a *cold* observable by the replay behaviour.
@@ -78,6 +78,8 @@ Conversely, the [`Publish`](xref:Bonsai.Reactive.Publish) operator can be used t
78
78
In the Bonsai visual language, whenever two operators receive data from the same source, i.e. whenever there are branches in the workflow, subscriptions use the `Publish` behaviour. This means that the default sharing behaviour of Bonsai sequences is *hot*. It is possible to change this by using specialized sharing operators, called [Subjects](xref:subjects).
Copy file name to clipboardExpand all lines: articles/property-mapping.md
+7-4Lines changed: 7 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,15 +34,15 @@ Property mapping operators allow you to do exactly this. They are operators that
34
34
35
35
## Externalized properties
36
36
37
-
The [`ExternalizedMapping`](xref:Bonsai.Expressions.ExternalizedMappingBuilder) operator allows you to create externalized properties. The easiest way to initialize the mapping is from the right-click context menu when a single node is selected. Selecting a property from this menu will create or update the externalized mapping node. Multiple properties can be externalized from the same node.
37
+
The [`ExternalizedMapping`] operator allows you to create externalized properties. The easiest way to initialize the mapping is from the right-click context menu when a single node is selected. Selecting a property from this menu will create or update the externalized mapping node. Multiple properties can be externalized from the same node.
After an operator property has been externalized, you can connect any sequence which is compatible with the data type of the property to the mapping node. When a connection to a source sequence is established, the externalized property will be promoted to a [`PropertyMapping`](xref:Bonsai.Expressions.PropertyMappingBuilder) operator.
45
+
After an operator property has been externalized, you can connect any sequence which is compatible with the data type of the property to the mapping node. When a connection to a source sequence is established, the externalized property will be promoted to a [`PropertyMapping`] operator.
46
46
47
47
Now every time the source sequence emits a new notification, the mapping operator will react by changing the target property to the incoming value.
48
48
@@ -60,9 +60,12 @@ Now every time the source sequence emits a new notification, the mapping operato
60
60
61
61
Sometimes you need to synchronize property updates with the data flow, i.e. you do not want the property mapping operator to change the property values outside of notifications emitted by the source sequence.
62
62
63
-
For example, imagine a transform operator which is converting a source sequence from one format to another, where the format specification is given by a set of operator properties. You may need the target format to change dynamically from time to time, but you may also need to guarantee that parts of the format specification do not change while the operator was converting some other input. The [`InputMapping`](xref:Bonsai.Expressions.InputMappingBuilder) operator allows you to do this by synchronizing property updates with input notifications.
63
+
For example, imagine a transform operator which is converting a source sequence from one format to another, where the format specification is given by a set of operator properties. You may need the target format to change dynamically from time to time, but you may also need to guarantee that parts of the format specification do not change while the operator was converting some other input. The [`InputMapping`] operator allows you to do this by synchronizing property updates with input notifications.
Copy file name to clipboardExpand all lines: articles/subject-async.md
+3-2Lines changed: 3 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,10 @@ title: "AsyncSubject"
8
8
[`AsyncSubject`] stores and passes the last value (and only the last value) emitted by the source sequence to each subscribed observer. The value is also only sent out after the source sequence terminates. If the source sequence does not emit any value, [`AsyncSubject`] will also terminate without emitting any values.
9
9
10
10
> [!Tip]
11
-
> You can use the [`Take`](xref:Bonsai.Reactive.Take) operator before [`AsyncSubject`] to store the first value from an infinite sequence.
11
+
> You can use the [`Take`] operator before [`AsyncSubject`] to store the first value from an infinite sequence.
12
12
13
13
Any observers which subscribe after the source sequence terminates will immediately receive the stored value. If the source sequence terminates with an error, [`AsyncSubject`] will not emit any values but will pass along the error notification to all observers.
Copy file name to clipboardExpand all lines: articles/subject-publish.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,11 @@ title: "PublishSubject"
7
7
8
8
[`PublishSubject`] passes to each subscribed observer only the values from the source sequence which were emitted after the time of subscription.
9
9
10
-
This fire-and-forget behavior means that any observers which subscribe late might lose one or more items emitted between the time that [`PublishSubject`] was created and the time that the observer subscribed to it. If you require guaranteed delivery of all values from the source sequence, you need to ensure that all observers subscribe immediately upon workflow initialization. If this is not possible, you should consider switching to an [`AsyncSubject`](xref:Bonsai.Reactive.AsyncSubject) if the sequence contains a single value, or a [`ReplaySubject`](xref:Bonsai.Reactive.ReplaySubject) if the sequence contains multiple values.
10
+
This fire-and-forget behavior means that any observers which subscribe late might lose one or more items emitted between the time that [`PublishSubject`] was created and the time that the observer subscribed to it. If you require guaranteed delivery of all values from the source sequence, you need to ensure that all observers subscribe immediately upon workflow initialization. If this is not possible, you should consider switching to an [`AsyncSubject`] if the sequence contains a single value, or a [`ReplaySubject`] if the sequence contains multiple values.
11
11
12
12
If the source sequence terminates with an error, [`PublishSubject`] will not emit any items to subsequent observers, but will pass along the terminating error.
Copy file name to clipboardExpand all lines: articles/workflow-guidelines.md
+10-5Lines changed: 10 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ This section offers guidelines and design patterns to consider when developing w
9
9
## Workflow Organization
10
10
11
11
:::do
12
-
use [`GroupWorkflow`](xref:Bonsai.Expressions.GroupWorkflowBuilder) nodes to separate independent functionality (e.g. acquisition, visualization and processing).
12
+
use [`GroupWorkflow`] nodes to separate independent functionality (e.g. acquisition, visualization and processing).
13
13
:::
14
14
15
15
:::avoid
@@ -29,7 +29,7 @@ use a [`BehaviorSubject`] to share global state which can be accessed by multipl
29
29
:::
30
30
31
31
:::avoid
32
-
using [`MulticastSubject`](xref:Bonsai.Expressions.MulticastSubject) on variables which are not declared as [`BehaviorSubject`]. This will prevent accidental termination of the subject sequence if a producer terminates prematurely.
32
+
using [`MulticastSubject`] on variables which are not declared as [`BehaviorSubject`]. This will prevent accidental termination of the subject sequence if a producer terminates prematurely.
33
33
:::
34
34
35
35
:::consider
@@ -42,10 +42,10 @@ moving all subject declarations to the top of the workflow. This will make sure
42
42
43
43
## Nested Operators
44
44
45
-
Several reactive operators require specification of a nested workflow, e.g. [`SelectMany`](xref:Bonsai.Reactive.SelectMany) or [`CreateObservable`](xref:Bonsai.Reactive.CreateObservable). The operator itself will control when the nested workflow is initialized and subscribed to. If it is possible for a nested workflow to be executed multiple times, potentially in parallel, we call the operator *reentrant*. Some care is necessary to understand how to manage shared state and properties inside a reentrant nested operator.
45
+
Several reactive operators require specification of a nested workflow, e.g. [`SelectMany`] or [`CreateObservable`]. The operator itself will control when the nested workflow is initialized and subscribed to. If it is possible for a nested workflow to be executed multiple times, potentially in parallel, we call the operator *reentrant*. Some care is necessary to understand how to manage shared state and properties inside a reentrant nested operator.
46
46
47
47
:::do
48
-
use an [`AsyncSubject`](xref:Bonsai.Reactive.AsyncSubject) to share workflow input data inside a nested operator.
48
+
use an [`AsyncSubject`] to share workflow input data inside a nested operator.
49
49
:::
50
50
51
51
:::avoid
@@ -61,5 +61,10 @@ branch a source sequence to share the same value across different [`PropertyMapp
61
61
Alternatively, you can either share the value using a subject, or branch after the [`PropertyMapping`] node (if both the value to share and the name of the property in each node are identical).
Copy file name to clipboardExpand all lines: tutorials/vision-psychophysics.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,7 @@ To implement the `TestGrating` state, we want to reuse our previous `RandomOrien
109
109

110
110
:::
111
111
112
-
- Insert a new `RandomOrientationGrating` operator from the toolbox and combine it with the input by using the `Zip` combinator. This will generate a pair where the first value is the random angle from the first reference grating, and the second value is the random angle for this test grating.
112
+
- Insert a new `RandomOrientationGrating` operator from the toolbox and combine it with the input by using the [`Zip`] combinator. This will generate a pair where the first value is the random angle from the first reference grating, and the second value is the random angle for this test grating.
113
113
114
114
_Run the workflow and validate the random angle pairs are distinct and valid from trial to trial._
0 commit comments