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
@@ -105,20 +93,20 @@ class IndexMultiplierColumnGenerator(ColumnGenerator[IndexMultiplierColumnConfig
105
93
106
94
**Key points:**
107
95
108
-
- Generic type `ColumnGenerator[IndexMultiplierColumnConfig]` connects the task to its config
109
-
-`metadata()` describes your generator and its requirements
110
-
-`generation_strategy` can be `FULL_COLUMN`, `CELL_BY_CELL`
96
+
- Generic type `ColumnGeneratorFullColumn[IndexMultiplierColumnConfig]` connects the task to its config
111
97
- You have access to the configuration parameters via `self.config`
112
98
113
99
!!! info "Understanding generation_strategy"
114
100
The `generation_strategy` specifies how the column generator will generate data.
115
101
116
102
- **`FULL_COLUMN`**: Generates the full column (at the batch level) in a single call to `generate`
117
-
- `generate` must take as input a `pd.DataFrame` with all previous columns and return a `pd.DataFrame` with the generated column appended
103
+
- `generate` must take as input a `pd.DataFrame` with all previous columns and return a `pd.DataFrame` with the generated column appended.
104
+
- Inherit from `ColumnGeneratorFullColumn` for this strategy, as we do in the example above.
118
105
119
106
- **`CELL_BY_CELL`**: Generates one cell at a time
120
107
- `generate` must take as input a `dict` with key/value pairs for all previous columns and return a `dict` with an additional key/value for the generated cell
121
108
- Supports concurrent workers via a `max_parallel_requests` parameter on the configuration
109
+
- Inherit from `ColumnGeneratorCellByCell` for this strategy.
122
110
123
111
## Step 4: Create the plugin object
124
112
@@ -147,11 +135,8 @@ from typing import Literal
147
135
import pandas as pd
148
136
149
137
from data_designer.config.column_configs import SingleColumnConfig
150
-
from data_designer.engine.column_generators.generators.base import (
151
-
ColumnGenerator,
152
-
GenerationStrategy,
153
-
GeneratorMetadata,
154
-
)
138
+
from data_designer.engine.column_generators.generators.base import ColumnGeneratorFullColumn
139
+
155
140
from data_designer.plugins import Plugin, PluginType
156
141
157
142
# Data Designer uses the standard Python logging module for logging
@@ -169,15 +154,7 @@ class IndexMultiplierColumnConfig(SingleColumnConfig):
0 commit comments