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
```{index} user guide, tutorial, getting started, HED, Hierarchical Event Descriptors
14
14
```
15
15
16
-
HED (Hierarchical Event Descriptors) is a framework for systematically describing events and experimental metadata in machine-actionable form. This guide provides comprehensive documentation for using the HED Python tools for validation, BIDS integration, and analysis:
16
+
HED (Hierarchical Event Descriptors) is a framework for systematically describing events and experimental metadata in machine-actionable form. This guide provides comprehensive documentation for using the HED Python tools for validation, BIDS integration, and analysis.
17
17
18
-
01.[What is HED?](#what-is-hed)
19
-
02.[Getting started](#getting-started)
20
-
03.[Working with HED schemas](#working-with-hed-schemas)
05.[Working with BIDS datasets](#working-with-bids-datasets)
23
-
06.[Working with sidecars](#working-with-sidecars)
24
-
07.[Jupyter notebooks](#jupyter-notebooks)
25
-
08.[Command-line tools](#command-line-tools)
26
-
09.[Best practices](#best-practices)
27
-
10.[Troubleshooting](#troubleshooting)
28
-
29
-
## Getting started
18
+
## Installation
30
19
31
20
```{index} installation, pip, PyPI
32
21
```
33
22
34
-
### Installation
35
-
36
-
#### From PyPI (recommended)
23
+
### From PyPI (recommended)
37
24
38
25
Install the latest stable release:
39
26
@@ -43,7 +30,7 @@ pip install hedtools
43
30
44
31
**Note**: The PyPI package includes the core hedtools library but **not the example Jupyter notebooks**. To access the notebooks, see the options below.
45
32
46
-
####For Jupyter notebook examples
33
+
### For Jupyter notebook examples
47
34
48
35
The example notebooks are only available in the GitHub repository. Choose one of these options:
A HED schema specifies an allowed HED vocabulary. The official HED schemas are hosted in the [hed-standard/hed-schemas](https://github.com/hed-standard/hed-schemas) GitHub repository. Most HEDTools operations require that you specify which versions of the HED schemas that you are using. You may also specify a file with your own schema for testing and development. The HEDTools assume that the HED schema that you are using has been validated.
Note: It is now standard for a library schema to be partnered with a standard schema. In general, you should not use an earlier, non-partnered versions of a library schema.
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.
HED schemas can be validated for compliance — checking that attribute domains, ranges, and semantic rules are all satisfied. There are three levels of access depending on how much control you need.
271
+
272
+
#### Quick check via HedSchema
273
+
274
+
The simplest approach calls `check_compliance()` directly on a loaded schema. It returns a list of issue dictionaries in the standard HED issue format, so you can use `get_printable_issue_string` just like any other HED validation result:
The returned list carries a `compliance_summary` attribute (`ComplianceSummary`) that provides a human-readable report of what was checked:
297
+
298
+
```python
299
+
issues = schema.check_compliance()
300
+
print(issues.compliance_summary.get_summary())
301
+
```
302
+
303
+
The summary shows each of the five checks (prerelease version, prologue/epilogue, invalid characters, attributes, and duplicate names) with pass/fail status, entry counts, and sub-check details.
304
+
305
+
#### Using SchemaValidator directly
306
+
307
+
For fine-grained control you can instantiate `SchemaValidator` and run individual checks:
308
+
309
+
```python
310
+
from hed.errors.error_reporter import ErrorHandler
311
+
from hed.schema.schema_validation.compliance import SchemaValidator
0 commit comments