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: Refactor-migration-guide.md
+68-82Lines changed: 68 additions & 82 deletions
Original file line number
Diff line number
Diff line change
@@ -105,45 +105,24 @@ There have also been some changes to the structure of manifest files. Some of th
105
105
method: SciEmbodied
106
106
```
107
107
108
-
- **Global config**
109
-
We have introduced the concept of global config to the plugins. This is truly global configuration data that should be kept constant regardless of where the plugin is invoked across the manifest file.
108
+
- **Config**
109
+
We have introduced the concept of config to the plugins. This is truly configuration data that should be kept constant regardless of where the plugin is invoked across the manifest file.
110
110
111
-
A good example is the `interpolation` method to use in the Teads curve plugin - this is not expected to vary from component to component and can therefore be defined inglobal config. The plugin code itself must expect the global config. Then, the config can be passed in the `Initialize` block, for example:
111
+
A good example is the `interpolation` method to use in the Teads curve plugin - this is not expected to vary from component to component and can therefore be defined in config. The plugin code itself must expect the config. Then, the config can be passed in the `Initialize` block, for example:
112
112
113
113
```yaml
114
114
initialize:
115
115
plugins:
116
116
'time-sync':
117
117
method: TimeSync
118
118
path: 'builtin'
119
-
global-config:
119
+
config:
120
120
start-time: '2023-12-12T00:00:00.000Z'
121
121
end-time: '2023-12-12T00:01:00.000Z'
122
122
interval: 5
123
123
allow-padding: true
124
124
```
125
125
126
-
- **Node level config**
127
-
128
-
We have also introduced the concept of node-level config. This is designed forpluin configuration that might vary between componentsin the tree. For example, foreach childin the tree you might wish to use the `regroup` feature to group the outputs according to a different set of keys.
129
-
130
-
```yaml
131
-
tree:
132
-
children:
133
-
child-1:
134
-
pipeline:
135
-
compute:
136
-
- teads-curve
137
-
- sci-e
138
-
- sci-embodied
139
-
- sci-o
140
-
- time-sync
141
-
- sci
142
-
regroup:
143
-
- region
144
-
- cloud/instance-type
145
-
```
146
-
147
126
- **Defaults**
148
127
149
128
We have also introduced the concept of `defaults`. This is a section in each component's definition that can be used to provide fallbacks for missing input data. For example, perhaps you have a value arriving from an external API that should be present in every observation in your inputs array, but for soem reason the API fails to deliver a value for some timestamps. In this case, IF would fallback to the value provided for that metric in the `defaults` section of the manifest for that component.
@@ -178,15 +157,15 @@ There have also been some changes to the structure of manifest files. Some of th
178
157
179
158
Technically time-sync is not a new feature as it was present in IF before the refactor, but there are some tweaks to how the plugin is configured that are worth explaining here. Time sync snaps all input arrays across an entire graph to a common time grid.
180
159
181
-
This means you have to define a global start time, end time and interval to use everywhere. There is also a boolean to toggle whether you should allow the time sync model to pad the start and end of your time series with zeroes. You should default to `true` unless you have a specific reason not to. In the refactored IF we expect this information to be provided in global config, as follows:
160
+
This means you have to define a start time, end time and interval to use everywhere. There is also a boolean to toggle whether you should allow the time sync model to pad the start and end of your time series with zeroes. You should default to `true` unless you have a specific reason not to. In the refactored IF we expect this information to be provided in config, as follows:
182
161
183
162
```yaml
184
163
initialize:
185
164
plugins:
186
165
'time-sync':
187
166
method: TimeSync
188
167
path: 'builtin'
189
-
global-config:
168
+
config:
190
169
start-time: '2023-12-12T00:00:00.000Z'
191
170
end-time: '2023-12-12T00:01:00.000Z'
192
171
interval: 5
@@ -220,68 +199,75 @@ Details tbc...
220
199
221
200
## Plugins
222
201
223
-
The plugins themselves require some changes to keep them compatible with the refactored IF.
202
+
Plugins require some modifications to remain compatible with the refactored IF interface.
224
203
225
-
Instead of the old class-based model, plugins are now functions. They conform to the following interface:
204
+
Each plugin follows the `PluginFactory` interface, which is a higher-order functionthat accepts a `params` object of type`PluginFactoryParams`. This functionreturns another function(theinner function), which handles the plugin’s `config`, `parametersMetadata`, and `mapping`.
0 commit comments