Skip to content

Commit f24fcd3

Browse files
Fixing GitHub Actions errors
1 parent c09013d commit f24fcd3

File tree

1 file changed

+55
-55
lines changed

1 file changed

+55
-55
lines changed

docs/InvestigationDatasetBuilderApplication.md

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Investigation Dataset Builder Application
22

3-
This application is a Streamlit-based tool for interactively building investigation dataset definitions for use with the `complete_dataset_with_args` method in the `InvestigationDatasetCompletion` class. It allows users to select and configure dataset sections, fill in fields, and copy the resulting Python code (including necessary Enum imports) for use in their tests.
3+
This application is a Streamlit-based tool for interactively building investigation dataset definitions for use with the `complete_dataset_with_args` method in the `InvestigationDatasetCompletion` class. It allows users to select and configure dataset sections, fill in fields, and copy the resulting Python code (including necessary `Enum` imports) for use in their tests.
44

55
---
66

@@ -21,7 +21,7 @@ This application is a Streamlit-based tool for interactively building investigat
2121
- [Registering a Section Renderer](#registering-a-section-renderer)
2222
- [Editing or Removing Sections and Fields](#editing-or-removing-sections-and-fields)
2323
- [Purpose of "groups" and "fields"](#purpose-of-groups-and-fields)
24-
- [Adding New Enum Types](#adding-new-enum-types)
24+
- [Adding New `Enum` Types](#adding-new-enum-types)
2525
- [Available Section Renderers](#available-section-renderers)
2626
- [Troubleshooting](#troubleshooting)
2727
- [Example Section Entry in `dataset_fields.json`](#example-section-entry-in-dataset_fieldsjson)
@@ -65,7 +65,7 @@ Before running the application, ensure you have the following:
6565

6666
- As you fill in fields, the **output code block** at the bottom of each section updates in real time.
6767
- This code block includes:
68-
- The necessary Enum imports for the section.
68+
- The necessary `Enum` imports for the section.
6969
- The Python dictionary representing your filled section.
7070
- To use this output:
7171
- Select the whole code block manually and copy it, or use the copy button if available.
@@ -77,7 +77,7 @@ Before running the application, ensure you have the following:
7777

7878
### Overview of `dataset_fields.json`
7979

80-
The file `investigation_dataset_ui_app/dataset_fields.json` defines all available sections and their fields, including types, descriptions, and options.
80+
The file `investigation_dataset_ui_app/dataset_fields.json` defines all available sections and their fields, including types, descriptions, and options.<br>
8181
Each section is a JSON object with either a `"fields"` array (for normal sections) or a `"groups"` array (for drug sections).
8282

8383
---
@@ -86,12 +86,12 @@ Each section is a JSON object with either a `"fields"` array (for normal section
8686

8787
Each field in the JSON can use the following options:
8888

89-
- `"key"`:
90-
The unique identifier for the field.
89+
- `"key"`:<br>
90+
The unique identifier for the field.<br>
9191
Example: `"site"`, `"drug_typeX"`, `"drug_doseX"`
9292

93-
- `"type"`:
94-
The type of the field.
93+
- `"type"`:<br>
94+
The type of the field.<br>
9595
Allowed values:
9696
- `"string"`: Free text input.
9797
- `"integer"`: Integer input.
@@ -103,31 +103,31 @@ Each field in the JSON can use the following options:
103103
- `"therapeutic_diagnostic"`: Dropdown with "therapeutic" and "diagnostic".
104104
- `"time"`: Time input in HH:MM format.
105105
- `"multiselect"`: Multi-select dropdown (requires `"options"`).
106-
- Enum type name (e.g., `"DrugTypeOptions"`, `"YesNoOptions"`): Dropdown with enum values.
106+
- `Enum` type name (e.g., `"DrugTypeOptions"`, `"YesNoOptions"`): Dropdown with `enum` values.<br>
107107

108-
- `"description"`:
108+
- `"description"`:<br>
109109
A clear description of the field, shown in the UI.
110110

111-
- `"optional"`:
112-
`true` or `false`.
111+
- `"optional"`:<br>
112+
`true` or `false`.<br>
113113
If `true`, the field is optional and can be toggled with a checkbox.
114114

115-
- `"range"`:
116-
For numeric fields, specifies allowed values.
115+
- `"range"`:<br>
116+
For numeric fields, specifies allowed values.<br>
117117
Example: `"range": [-1, 10]`
118118

119-
- `"default"`:
119+
- `"default"`:<br>
120120
The default value for the field.
121121

122-
- `"options"`:
122+
- `"options"`:<br>
123123
For `"multiselect"` fields, a list of allowed values.
124124

125-
- `"multiple"`:
125+
- `"multiple"`:<br>
126126
For drug fields, set to `true` to allow multiple entries (used with `"key": "drug_typeX"` and `"drug_doseX"`).
127127

128-
- `"conditional_on"`:
129-
Used for conditional fields.
130-
Example:
128+
- `"conditional_on"`:<br>
129+
Used for conditional fields.<br>
130+
Example:<br>
131131

132132
```json
133133
"conditional_on": {
@@ -138,11 +138,11 @@ Each field in the JSON can use the following options:
138138

139139
The field will only be shown if the referenced field matches the value.
140140

141-
- `"list"`:
142-
If present and true, indicates the section is a list of entries (e.g., polyp_information).
141+
- `"list"`:<br>
142+
If present and true, indicates the section is a list of entries (e.g., `polyp_information`).
143143

144-
- `"nested_list"`:
145-
If present and true, indicates the section is a nested list (e.g., polyp_intervention).
144+
- `"nested_list"`:<br>
145+
If present and true, indicates the section is a nested list (e.g., `polyp_intervention`).
146146

147147
---
148148

@@ -185,10 +185,10 @@ Each field in the JSON can use the following options:
185185

186186
5. Save the file.
187187

188-
6. **Add the section to the sidebar:**
188+
6. **Add the section to the sidebar:**<br>
189189
Add the section name to the `SECTIONS` list in `investigation_dataset_ui.py`.
190190

191-
7. **Register the section renderer:**
191+
7. **Register the section renderer:**<br>
192192
Add the section to the `SECTION_RENDERERS` dictionary in `investigation_dataset_ui.py`, using `show_drug_group_section_with_imports` as the renderer:
193193

194194
```python
@@ -227,10 +227,10 @@ Each field in the JSON can use the following options:
227227

228228
5. Save the file.
229229

230-
6. **Add the section to the sidebar:**
230+
6. **Add the section to the sidebar:**<br>
231231
Add the section name to the `SECTIONS` list in `investigation_dataset_ui.py`.
232232

233-
7. **Register the section renderer:**
233+
7. **Register the section renderer:**<br>
234234
Add the section to the `SECTION_RENDERERS` dictionary in `investigation_dataset_ui.py`, using `show_section_with_imports` as the renderer:
235235

236236
```python
@@ -245,7 +245,7 @@ Each field in the JSON can use the following options:
245245

246246
### Registering a Section Renderer
247247

248-
Whenever you add a new section, you must register it in the `SECTION_RENDERERS` dictionary in `investigation_dataset_ui.py`.
248+
Whenever you add a new section, you must register it in the `SECTION_RENDERERS` dictionary in `investigation_dataset_ui.py`.<br>
249249
This dictionary maps section names to the appropriate rendering function.
250250

251251
- For normal sections, use `show_section_with_imports`.
@@ -267,35 +267,35 @@ SECTION_RENDERERS = {
267267

268268
### Editing or Removing Sections and Fields
269269

270-
- **To edit a field or section:**
271-
Find the relevant field or section and update its properties (e.g., `"description"`, `"type"`, `"optional"`, etc.).
270+
- **To edit a field or section:**<br>
271+
Find the relevant field or section and update its properties (e.g., `"description"`, `"type"`, `"optional"`, etc.).<br>
272272
Save the file and reload the app.
273273

274-
- **To remove a field or section:**
275-
Delete the field object from the `"fields"` array or the section object from the root.
276-
Save the file and reload the app.
274+
- **To remove a field or section:**<br>
275+
Delete the field object from the `"fields"` array or the section object from the root.<br>
276+
Save the file and reload the app.<br>
277277
Remove the section from `SECTIONS` and `SECTION_RENDERERS` if you want to fully remove it from the UI.
278278

279279
---
280280

281281
### Purpose of "groups" and "fields"
282282

283-
- **"fields"**:
284-
Used for normal sections and for single-entry fields in drug sections.
283+
- **"fields"**:<br>
284+
Used for normal sections and for single-entry fields in drug sections.<br>
285285
Each field in `"fields"` is rendered as a single input in the UI.
286286

287-
- **"groups"**:
288-
Used for sections that allow multiple drug entries (e.g., Drug Information, Tagging Agent Given Drug Information, Contrast Tagging and Drug).
289-
Each group contains a `"label"` and a `"fields"` array.
287+
- **"groups"**:<br>
288+
Used for sections that allow multiple drug entries (e.g., Drug Information, Tagging Agent Given Drug Information, Contrast Tagging and Drug).<br>
289+
Each group contains a `"label"` and a `"fields"` array.<br>
290290
Fields with `"key": "drug_typeX"` and `"drug_doseX"` and `"multiple": true` are rendered as repeated entries, with the user specifying how many drugs to enter.
291291

292292
---
293293

294-
### Adding New Enum Types
294+
### Adding New `Enum` Types
295295

296-
If you add new Enum types to `pages.datasets.investigation_dataset_page`, you must also:
296+
If you add new `Enum` types to `pages.datasets.investigation_dataset_page`, you must also:
297297

298-
- Add the Enum to the `ENUM_MAP` in `investigation_dataset_ui.py`:
298+
- Add the `Enum` to the `ENUM_MAP` in `investigation_dataset_ui.py`:
299299

300300
```python
301301
ENUM_MAP = {
@@ -304,29 +304,29 @@ If you add new Enum types to `pages.datasets.investigation_dataset_page`, you mu
304304
}
305305
```
306306

307-
- Use the Enum type name in the `"type"` field of any relevant field in `dataset_fields.json`.
307+
- Use the `Enum` type name in the `"type"` field of any relevant field in `dataset_fields.json`.
308308

309309
---
310310

311311
### Available Section Renderers
312312

313-
There are several renderers available for displaying sections in the UI.
313+
There are several renderers available for displaying sections in the UI.<br>
314314
Choose the appropriate renderer based on the section's structure:
315315

316-
- **show_section_with_imports**
317-
Use for standard sections that only have a `"fields"` array.
316+
- **show_section_with_imports**<br>
317+
Use for standard sections that only have a `"fields"` array.<br>
318318
Renders all fields and outputs the code block with necessary imports.
319319

320-
- **show_drug_group_section_with_imports**
321-
Use for sections that contain drug groups (i.e., have a `"groups"` array).
320+
- **show_drug_group_section_with_imports**<br>
321+
Use for sections that contain drug groups (i.e., have a `"groups"` array).<br>
322322
Renders each drug group, allows multiple entries, and outputs the code block with necessary imports.
323323

324-
- **show_polyp_information_and_intervention_and_histology**
325-
Use for the polyp section, which is a complex/nested structure.
324+
- **show_polyp_information_and_intervention_and_histology**<br>
325+
Use for the polyp section, which is a complex/nested structure.<br>
326326
Outputs code blocks for polyp information, interventions, and histology, along with necessary imports.
327327

328-
- **Custom Renderers**
329-
For any section with unique requirements, you can create a custom renderer function and register it in `SECTION_RENDERERS`.
328+
- **Custom Renderers**<br>
329+
For any section with unique requirements, you can create a custom renderer function and register it in `SECTION_RENDERERS`.<br>
330330
If your renderer does not accept a section name argument, wrap it in a lambda:
331331

332332
```python
@@ -346,11 +346,11 @@ Choose the appropriate renderer based on the section's structure:
346346
- Check for typos in the field definition.
347347
- Ensure conditional fields have correct `"conditional_on"` logic.
348348

349-
- **Enum import is missing in the output:**
349+
- **`Enum` import is missing in the output:**
350350
- Ensure the field `"type"` matches an entry in `ENUM_MAP`.
351351

352352
- **App does not reload changes:**
353-
- Save your changes and refresh the Streamlit app in your browser.
353+
- Save your changes and refresh the `Streamlit` app in your browser.
354354

355355
- **Copy to clipboard does not work:**
356356
- Some browsers may not support auto-copy. Manually select and copy the code from the code block.
@@ -392,7 +392,7 @@ Choose the appropriate renderer based on the section's structure:
392392
- **All configuration is driven by `dataset_fields.json`.**
393393
- **Descriptions, types, and options are fully customizable.**
394394
- **No code changes are needed for most updates—just edit the JSON file.**
395-
- **For new Enum types, add them to both the Python code and the JSON.**
395+
- **For new `Enum` types, add them to both the Python code and the JSON.**
396396
- **For conditional fields, use the `"conditional_on"` property.**
397397
- **Use `"groups"` for repeated drug entries, and `"fields"` for single-entry fields.**
398398
- **Register new sections in both `SECTIONS` and `SECTION_RENDERERS`.**

0 commit comments

Comments
 (0)