|
| 1 | +# Make Method |
| 2 | + |
| 3 | +For auto-populated *Imported* and *Computed* tables[^1], a `make` method gives exact |
| 4 | +instructions for generating the content. By making these steps explicit, we keep a |
| 5 | +careful record of data provenance and ensure reproducibility. Data should never be |
| 6 | +entered using the `insert` method directly. |
| 7 | + |
| 8 | +[^1]: For information on differentiating these data tiers, see the Table Tier section on |
| 9 | +[Automation](../tabletiers#automation-imported-and-computed). |
| 10 | + |
| 11 | +The `make` method receives one argument: the *key*, which represents the upstream table |
| 12 | +entries that need populating. The `key` is a `dict` or `struct` in Python and Matlab, |
| 13 | +respectively. |
| 14 | + |
| 15 | +A `make` function should do three things: |
| 16 | + |
| 17 | +1. [Fetch](../../query-lang/common-commands#fetch) data from tables upstream in the |
| 18 | +pipeline using the key for restriction. |
| 19 | + |
| 20 | +2. Compute and add any missing attributes to the fields already in the key. |
| 21 | + |
| 22 | +3. [Inserts](../../query-lang/common-commands#insert) the entire entity into the |
| 23 | +triggering table. |
| 24 | + |
| 25 | +## Populate |
| 26 | + |
| 27 | +The `make` method is sometimes referred to as the `populate` function because this is |
| 28 | +the class method called to run the `make` method on all relevant keys[^2]. |
| 29 | + |
| 30 | +[^2]: For information on reprocessing keys that resulted in an error, see information |
| 31 | +on the [Jobs table](../../ref-integrity/distributed-computing). |
| 32 | + |
| 33 | +=== "Python" |
| 34 | + |
| 35 | + ``` python |
| 36 | + Segmentation.populate() |
| 37 | + ``` |
| 38 | + |
| 39 | +=== "Matlab" |
| 40 | + |
| 41 | + In Matlab, the `key` is a `struct`. |
| 42 | + ``` matlab |
| 43 | + populate(Segmentation) |
| 44 | + ``` |
| 45 | + |
| 46 | +For more information on the `populate` options in each language, please visit the |
| 47 | +[Python and Matlab](../../../) documentation pages. |
| 48 | + |
| 49 | +<!-- TODO: Replace above with respective links when live --> |
0 commit comments