Skip to content

Commit 083fc24

Browse files
committed
Fixed co-pilot suggestions
1 parent 50dee3c commit 083fc24

2 files changed

Lines changed: 29 additions & 27 deletions

File tree

docs/user_guide.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ This guide provides step-by-step instructions for using the HED Python tools for
77
- 📚 [API Reference](api/index.html)
88
- 📓 [Jupyter notebooks](https://github.com/hed-standard/hed-python/tree/main/examples)
99
- 🐛 [GitHub issues](https://github.com/hed-standard/hed-python/issues)
10-
- [HED resources](https://www.hedtags.org/hed-resources)
11-
- 📖 [HED specification](https://www.hedtags.org/hed-specification)
10+
- 🎓 [HED resources](https://www.hedtags.org/hed-resources)
11+
- 📖 [HED specification](https://www.hedtags.org/hed-specification)
1212
- 🌐 [Online tools](https://hedtools.org/hed)
1313

1414
## Table of contents
@@ -132,7 +132,7 @@ for i, hed_str in enumerate(hed_strings, 1):
132132
hed_string = HedString(hed_str, schema)
133133
issues += hed_string.validate()
134134
if issues:
135-
print(get_printable_issues_string(issues))
135+
print(get_printable_issue_string(issues))
136136
```
137137

138138
## Working with BIDS datasets
@@ -157,7 +157,8 @@ else:
157157
# Include warnings in validation
158158
issues = dataset.validate(check_for_warnings=True)
159159
```
160-
Since a BIDS dataset includes the HED version in its `dataset_description.json`, a HED version is not necessary for validation. The `BidsDataset` only holds information about the relevant `.tsv` and `.json` files, not the imaging data. The constructor has a number of parameters that restrict which of these files are considered. The relevant JSON files are all read in, but the `.tsv` contents is only loaded when needed.
160+
161+
Since a BIDS dataset includes the HED version in its `dataset_description.json`, a HED version is not necessary for validation. The `BidsDataset` only holds information about the relevant `.tsv` and `.json` files, not the imaging data. The constructor has a number of parameters that restrict which of these files are considered. The relevant JSON files are all read in, but the `.tsv` content is only loaded when needed.
161162

162163
### Working with individual event files
163164

@@ -227,20 +228,20 @@ json_string = sidecar.get_as_json_string()
227228

228229
## Jupyter notebooks
229230

230-
The [**examples**](https://github.com/hed-standard/hed-python/tree/main/examples) directory[**hed-python**](https://github.com/hed-standard/hed-python) GitHub repository contains Jupyter notebooks for BIDS annotation workflows. These notebooks are **not included in the PyPI package**.
231+
The [**examples**](https://github.com/hed-standard/hed-python/tree/main/examples) directory in the GitHub [**hed-python**](https://github.com/hed-standard/hed-python) repository contains Jupyter notebooks for BIDS annotation workflows. These notebooks are **not included in the PyPI package**.
231232

232233
### Available notebooks
233234

234-
| Notebook | Purpose |
235-
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------- |
236-
| [extract_json_template.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/extract_json_template.ipynb) | Create JSON sidecar template from all event files |
237-
| [find_event_combinations.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/find_event_combinations.ipynb) | Extract unique combinations of column values |
238-
| [merge_spreadsheet_into_sidecar.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/merge_spreadsheet_into_sidecar.ipynb) | Merge edited spreadsheet of HED annotations back into JSON sidecar |
239-
| [sidecar_to_spreadsheet.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/sidecar_to_spreadsheet.ipynb) | Convert JSON sidecar to spreadsheet for editing |
240-
| [summarize_events.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/summarize_events.ipynb) | Summarize event file contents and value distributions |
241-
| [validate_bids_dataset.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_dataset.ipynb) | Validate HED annotations in a BIDS dataset |
242-
| [validate_bids_dataset_with_libraries.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_dataset_with_libraries.ipynb) | Validate with HED library schemas |
243-
| [validate_bids_datasets.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_datasets.ipynb) | Batch validate multiple BIDS datasets |
235+
| Notebook | Purpose |
236+
| ------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ |
237+
| [extract_json_template.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/extract_json_template.ipynb) | Create JSON sidecar template from all event files |
238+
| [find_event_combinations.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/find_event_combinations.ipynb) | Extract unique combinations of column values |
239+
| [merge_spreadsheet_into_sidecar.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/merge_spreadsheet_into_sidecar.ipynb) | Merge edited spreadsheet of HED annotations back into JSON sidecar |
240+
| [sidecar_to_spreadsheet.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/sidecar_to_spreadsheet.ipynb) | Convert JSON sidecar to spreadsheet for editing |
241+
| [summarize_events.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/summarize_events.ipynb) | Summarize event file contents and value distributions |
242+
| [validate_bids_dataset.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_dataset.ipynb) | Validate HED annotations in a BIDS dataset |
243+
| [validate_bids_dataset_with_libraries.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_dataset_with_libraries.ipynb) | Validate with HED library schemas |
244+
| [validate_bids_datasets.ipynb](https://github.com/hed-standard/hed-python/blob/main/examples/validate_bids_datasets.ipynb) | Batch validate multiple BIDS datasets |
244245

245246
### Getting the notebooks
246247

@@ -282,7 +283,7 @@ HEDTools provides a unified command-line interface (CLI) using a **git-style com
282283
| ------------------------------ | ----------------------------------------------------------- |
283284
| **Annotation management** | |
284285
| `hedpy validate-bids` | Validate HED annotations in BIDS datasets |
285-
| `hedpy extract-sidecar` | Extract JSON sidecar template from tabular (`.tsv`) files |
286+
| `hedpy extract-sidecar` | Extract JSON sidecar template from tabular (`.tsv`) files |
286287
| **Schema management** | |
287288
| `hedpy schema validate` | Validate HED schema files |
288289
| `hedpy schema convert` | Convert schemas between formats (XML, MEDIAWIKI, TSV, JSON) |
@@ -316,7 +317,7 @@ Get version information:
316317
hedpy --version
317318
```
318319

319-
---
320+
______________________________________________________________________
320321

321322
### BIDS validation
322323

@@ -352,6 +353,7 @@ hedpy validate-bids /path/to/bids/dataset -o results.txt -p
352353
```
353354

354355
**Output format differences:**
356+
355357
- `text`: Human-readable format with issue counts and descriptions (default)
356358
- `json`: Compact JSON array of issues only, suitable for piping or programmatic processing
357359
- `json_pp`: Pretty-printed JSON object with `issues` array and `hedtools_version` metadata, with proper indentation for readability
@@ -400,7 +402,7 @@ hedpy validate-bids /path/to/bids/dataset \
400402
-lf validation.log
401403
```
402404

403-
---
405+
______________________________________________________________________
404406

405407
### Sidecar template extraction
406408

@@ -445,7 +447,7 @@ hedpy extract-sidecar /path/to/bids/dataset \
445447
-v
446448
```
447449

448-
---
450+
______________________________________________________________________
449451

450452
### Schema development
451453

@@ -489,7 +491,7 @@ hedpy schema convert schema1.xml schema2.xml
489491
- `.tsv` - TSV (tab-separated value) format
490492
- `.json` - JSON format
491493

492-
---
494+
______________________________________________________________________
493495

494496
### Schema release
495497

@@ -541,7 +543,7 @@ hedpy schema create-ontology /path/to/hed-schemas lang 1.1.0 \
541543
5. Verify that the created ontology is valid using [**Protégé**](https://protege.stanford.edu/)
542544
6. Commit changes to version control before moving to stable release
543545

544-
---
546+
______________________________________________________________________
545547

546548
### Legacy script access
547549

@@ -560,7 +562,7 @@ python -m hed.scripts.validate_schemas schema.xml
560562

561563
**However, the `hedpy` CLI is the recommended interface** as it provides a more consistent and discoverable command structure.
562564

563-
---
565+
______________________________________________________________________
564566

565567
### Common workflows
566568

@@ -619,7 +621,7 @@ hedpy schema add-ids /path/to/hed-schemas my_library 1.0.0
619621
hedpy schema create-ontology /path/to/hed-schemas my_library 1.0.0
620622
```
621623

622-
---
624+
______________________________________________________________________
623625

624626
### Debugging tips
625627

@@ -638,8 +640,8 @@ hedpy schema create-ontology /path/to/hed-schemas my_library 1.0.0
638640
### Schema management
639641

640642
1. **Don't modify released schemas** - they're immutable and shared
641-
2. **Check and recheck schema validity** - once released its permanent
642-
3. **Compare with schema with previous version** - make sure not its not a breaking change (major semantic version change)
643+
2. **Check and recheck prerelease schema validity** - once released it's permanent
644+
3. **Compare the schema with previous version** - make sure that changes are not breaking (major semantic version change)
643645

644646
### Validation workflow
645647

@@ -654,7 +656,7 @@ hedpy schema create-ontology /path/to/hed-schemas my_library 1.0.0
654656
2. **Use `#` placeholders** for value columns with continuous data
655657
3. **Skip BIDS-predefined columns** like `onset`, `duration`, `sample`
656658
4. **Use the latest versions of the schemas** later versions have improved linkage
657-
4. **Document your annotations** using descriptions in the sidecar
659+
5. **Document your annotations** using descriptions in the sidecar
658660

659661
If you are annotated an NWB dataset, the instructions are somewhat similar but haven't been finalized.
660662

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,5 @@ Convenience notebook for batch validation across multiple BIDS datasets.
124124
- **BIDS structure required**: These notebooks expect standard BIDS directory structure
125125
- **Inheritance handling**: Automatically processes BIDS sidecar inheritance
126126
- **Exclude directories**: Always exclude `derivatives`, `code`, `stimuli`, `sourcedata`
127-
- **Skip solumns**: Typically skip `onset`, `duration`, `sample` (BIDS-predefined)
127+
- **Skip columns**: Typically skip `onset`, `duration`, `sample` (BIDS-predefined)
128128
- **Value columns**: Columns with continuous data (annotated with `#` placeholder)

0 commit comments

Comments
 (0)