Skip to content

Commit b769d28

Browse files
authored
Merge pull request #1169 from VisLab/add_examples
Updated the docs for hed-python
2 parents 8c8b212 + 685e68d commit b769d28

File tree

18 files changed

+312
-259
lines changed

18 files changed

+312
-259
lines changed

README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ For simple validation or transformation tasks, use the online tools at [https://
2626

2727
Browser-based validation (no data upload) is available at [https://www.hedtags.org/hed-javascript](https://www.hedtags.org/hed-javascript)
2828

29-
A development version is available at: [https://hedtools.org/hed_dev](https://hedtools.org/hed_dev)
29+
A development version of the online tools is available at: [https://hedtools.org/hed_dev](https://hedtools.org/hed_dev)
3030

3131
### Python installation
3232

@@ -49,12 +49,13 @@ pip install git+https://github.com/hed-standard/hed-python/@main
4949
```python
5050
from hed import HedString, load_schema_version
5151

52+
5253
# Load the latest HED schema
5354
schema = load_schema_version("8.4.0")
5455

5556
# Create and validate a HED string
56-
hed_string = HedString("Sensory-event, Visual-presentation, (Onset, (Red, Square))")
57-
issues = hed_string.validate(schema)
57+
hed_string = HedString("Sensory-event, Visual-presentation, (Onset, (Red, Square))", schema)
58+
issues = hed_string.validate()
5859

5960
if issues:
6061
print(get_printable_issue_string(issues, title="Validation issues found"))
@@ -128,9 +129,9 @@ See [`examples/README.md`](examples/README.md) for more details.
128129

129130
📖 **Full Documentation:** [https://www.hedtags.org/hed-python](https://www.hedtags.org/hed-python)
130131

131-
- [User Guide](https://www.hedtags.org/hed-python/user_guide.html) - Usage instructions
132-
- [API Reference](https://www.hedtags.org/hed-python/api/index.html) - Detailed API documentation
133-
- [HED Specification](https://www.hedtags.org/hed-specification) - Full HED standard specification
132+
- [User guide](https://www.hedtags.org/hed-python/user_guide.html) - Usage instructions
133+
- [API reference](https://www.hedtags.org/hed-python/api/index.html) - Detailed API documentation
134+
- [HED specification](https://www.hedtags.org/hed-specification) - Full HED standard specification
134135

135136
### Building docs locally
136137

@@ -179,28 +180,28 @@ black --workers 1 .
179180

180181
**Exclusions:** Black automatically excludes `.venv/`, `__pycache__/`, auto-generated files (`hed/_version.py`), and external repos (`spec_tests/hed-examples/`, `spec_tests/hed-specification/`).
181182

182-
**CI Integration:** All code is automatically checked for Black formatting in GitHub Actions. Run `black .` before committing to ensure your code passes CI checks.
183+
**CI integration:** All code is automatically checked for Black formatting in GitHub Actions. Run `black .` before committing to ensure your code passes CI checks.
183184

184-
## Related Repositories
185+
## Related repositories
185186

186187
The HED ecosystem consists of several interconnected repositories:
187188

188-
| Repository | Description |
189-
| ---------------------------------------------------------------------- | ------------------------------------------------- |
190-
| [hed-python](https://github.com/hed-standard/hed-python) | Python validation and analysis tools (this repo) |
191-
| [hed-web](https://github.com/hed-standard/hed-web) | Web interface and deployable Docker services |
192-
| [hed-resources](https://github.com/hed-standard/hed-resources) | Example code in Python and MATLAB + HED resources |
193-
| [hed-specification](https://github.com/hed-standard/hed-specification) | Official HED specification documents |
194-
| [hed-schemas](https://github.com/hed-standard/hed-schemas) | Official HED schema repository |
195-
| [ndx-hed](https://github.com/hed-standard/ndx-hed) | HED support for NWB |
196-
| [hed-javascript](https://github.com/hed-standard/hed-javascript) | JavaScript HED validation tools |
189+
| Repository | Description |
190+
| ---------------------------------------------------------------------- | ------------------------------------------------ |
191+
| [hed-python](https://github.com/hed-standard/hed-python) | Python validation and analysis tools (this repo) |
192+
| [hed-web](https://github.com/hed-standard/hed-web) | Web interface and deployable Docker services |
193+
| [hed-resources](https://github.com/hed-standard/hed-resources) | Tutorials and other HED resources |
194+
| [hed-specification](https://github.com/hed-standard/hed-specification) | Official HED specification documents |
195+
| [hed-schemas](https://github.com/hed-standard/hed-schemas) | Official HED schema repository |
196+
| [ndx-hed](https://github.com/hed-standard/ndx-hed) | HED support for NWB |
197+
| [hed-javascript](https://github.com/hed-standard/hed-javascript) | JavaScript HED validation tools |
197198

198199
## Contributing
199200

200201
We welcome contributions! Here's how you can help:
201202

202203
1. **Report issues:** Use [GitHub Issues](https://github.com/hed-standard/hed-python/issues) for bug reports and feature requests
203-
2. **Submit pull requests (PRs):** PRs should target the `main` branch
204+
2. **Submit pull requests (PRs):** PRs should be from a non-main fork and target the `main` branch
204205
3. **Improve documentation:** Help us make HED easier to use
205206
4. **Share examples:** Contribute example code and use cases
206207

@@ -229,7 +230,7 @@ python -m unittest tests/path/to/test_file.py
229230
python -m unittest tests.test_notebooks
230231
```
231232

232-
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md) (coming soon).
233+
For detailed contribution guidelines, please see [CONTRIBUTING.md](CONTRIBUTING.md).
233234

234235
## Configuration
235236

@@ -267,6 +268,6 @@ HEDTools is licensed under the MIT License. See [LICENSE](LICENSE) for details.
267268
## Support
268269

269270
- [Documentation](https://www.hedtags.org/hed-python)
270-
- [GitHub Issues](https://github.com/hed-standard/hed-python/issues)
271+
- [GitHub issues](https://github.com/hed-standard/hed-python/issues)
271272
- [HED Homepage](https://www.hedtags.org)
272-
- Contact: hed-maintainers@gmail.com
273+
- Contact: [hed-maintainers@gmail.com](mailto:hed-maintainers@gmail.com)

docs/_static/custom.css

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ body[data-theme="dark"] .sidebar-quicklinks {
2929
border-color: #1a1a1a;
3030
}
3131

32+
/* Auto mode with dark system preference */
33+
@media (prefers-color-scheme: dark) {
34+
body:not([data-theme="light"]) .sidebar-quicklinks {
35+
background-color: #0d0d0d;
36+
border-color: #1a1a1a;
37+
}
38+
}
39+
3240
.sidebar-quicklinks h3 {
3341
margin-top: 0;
3442
margin-bottom: 0.5rem;
@@ -91,6 +99,16 @@ body[data-theme="dark"] .sidebar-search-container input {
9199
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
92100
}
93101

102+
/* Auto mode with dark system preference */
103+
@media (prefers-color-scheme: dark) {
104+
body:not([data-theme="light"]) .sidebar-search-container input {
105+
background-color: #0d0d0d !important;
106+
border: 1px solid #1a1a1a !important;
107+
color: #e8e8e8 !important;
108+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23cccccc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") !important;
109+
}
110+
}
111+
94112
/* Make search icon visible */
95113
.sidebar-search-container input::placeholder {
96114
color: var(--color-foreground-muted) !important;

docs/_templates/quicklinks.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ <h3>Quick links</h3>
66
<li><a href="https://www.hedtags.org/hed-schema-browser" target="_blank">HED schema browser</a></li>
77
<li><a href="https://www.hedtags.org/hed-specification" target="_blank">HED specification</a></li>
88
<li><a href="https://hedtools.org/hed" target="_blank">HED online tools</a></li>
9+
<li><a href="https://hedtools.org/table-remodeler" target="_blank">Table-remodeler</a></li>
910
</ul>
1011
</div>

docs/api/errors.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Errors
33

44
Error handling and reporting classes for HED validation and processing.
55

6-
Error Types and Constants
6+
Error types and constants
77
-------------------------
88

99
HedExceptions
@@ -22,7 +22,7 @@ HedFileError
2222
:undoc-members:
2323
:show-inheritance:
2424

25-
Error Reporting
25+
Error reporting
2626
---------------
2727

2828
ErrorHandler
@@ -33,7 +33,7 @@ ErrorHandler
3333
:undoc-members:
3434
:show-inheritance:
3535

36-
Error Functions
36+
Error functions
3737
~~~~~~~~~~~~~~~
3838

3939
.. autofunction:: hed.errors.error_reporter.get_printable_issue_string
@@ -42,7 +42,7 @@ Error Functions
4242

4343
.. autofunction:: hed.errors.error_reporter.replace_tag_references
4444

45-
Error Types
45+
Error types
4646
-----------
4747

4848
ValidationErrors

docs/api/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
API Reference
1+
API reference
22
=============
33

4-
This section contains the complete API reference for HED Python Tools.
4+
This section contains the complete API reference for HED Python tools.
55

66
.. toctree::
77
:maxdepth: 2
@@ -12,10 +12,10 @@ This section contains the complete API reference for HED Python Tools.
1212
tools
1313
errors
1414

15-
Core Modules Overview
15+
Core modules overview
1616
---------------------
1717

18-
The HED Python Tools package is organized into several key modules:
18+
The HED Python tools package is organized into several key modules:
1919

2020
* **Models**: Core data structures for HED annotations and tags
2121
* **Schema**: HED schema management and validation

docs/api/models.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Models
33

44
Core data models for working with HED data structures.
55

6-
Core Models
6+
Core models
77
-----------
88

99
The fundamental data structures for HED annotations and tags.
@@ -40,7 +40,7 @@ DefinitionDict
4040
:undoc-members:
4141
:show-inheritance:
4242

43-
Input Models
43+
Input models
4444
------------
4545

4646
Models for handling different types of input data.

docs/api/schema.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Schema
33

44
HED schema management and validation tools.
55

6-
Core Schema Classes
6+
Core schema classes
77
-------------------
88

99
HedSchema
@@ -62,24 +62,24 @@ HedSchemaSection
6262
:undoc-members:
6363
:show-inheritance:
6464

65-
Schema IO and Caching
65+
Schema IO and caching
6666
---------------------
6767

68-
Schema Loading Functions
68+
Schema loading functions
6969
~~~~~~~~~~~~~~~~~~~~~~~~
7070

7171
.. automodule:: hed.schema.hed_schema_io
7272
:members: load_schema, load_schema_version, from_string, get_hed_xml_version, from_dataframes
7373
:undoc-members:
7474

75-
Cache Management
75+
Cache management
7676
~~~~~~~~~~~~~~~~
7777

7878
.. automodule:: hed.schema.hed_cache
7979
:members: cache_xml_versions, get_hed_versions, set_cache_directory, get_cache_directory
8080
:undoc-members:
8181

82-
Schema Constants
82+
Schema constants
8383
----------------
8484

8585
HedKey

docs/api/tools.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Tools
33

44
Utility functions and data processing tools for HED operations.
55

6-
Analysis Tools
6+
Analysis tools
77
--------------
88

99
EventManager
@@ -54,7 +54,7 @@ FileDictionary
5454
:undoc-members:
5555
:show-inheritance:
5656

57-
BIDS Tools
57+
BIDS tools
5858
----------
5959

6060
BidsDataset
@@ -97,7 +97,7 @@ BidsTabularFile
9797
:undoc-members:
9898
:show-inheritance:
9999

100-
BIDS Utilities
100+
BIDS utilities
101101
~~~~~~~~~~~~~~
102102

103103
.. automodule:: hed.tools.bids.bids_util

docs/api/validator.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Validator
33

44
Validation tools for HED data structures and annotations.
55

6-
Core Validator Classes
6+
Core validator classes
77
----------------------
88

99
HedValidator
@@ -14,7 +14,7 @@ HedValidator
1414
:undoc-members:
1515
:show-inheritance:
1616

17-
Specialized Validators
17+
Specialized validators
1818
----------------------
1919

2020
SidecarValidator
@@ -49,7 +49,7 @@ OnsetValidator
4949
:undoc-members:
5050
:show-inheritance:
5151

52-
Validation Utilities
52+
Validation utilities
5353
--------------------
5454

5555
ReservedChecker

docs/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Welcome to the HED Python tools documentation. This package provides comprehensi
77
:maxdepth: 2
88
:caption: Contents:
99

10-
introduction
11-
user_guide
12-
api/index
10+
Introduction <introduction>
11+
User guide <user_guide>
12+
API reference <api/index>
1313

1414
Indices and tables
1515
==================

0 commit comments

Comments
 (0)