|
5 | 5 | [](https://codecov.io/gh/ANCPLabOldenburg/ancp-bids) |
6 | 6 | [](https://opensource.org/licenses/MIT) |
7 | 7 |
|
8 | | -# ancpBIDS Technical Overview |
| 8 | +**ancpBIDS** is a modular Python library for reading, querying, validating, and writing BIDS datasets. Its architecture is designed for extensibility and maintainability. |
9 | 9 |
|
10 | 10 | ## Key Features |
11 | 11 |
|
|
41 | 41 |
|
42 | 42 | ## Architecture |
43 | 43 |
|
44 | | -**ancpBIDS** is a modular Python library for reading, querying, validating, and writing BIDS datasets. Its architecture is designed for extensibility and maintainability, with the following key components: |
45 | | - |
46 | 44 | - **Core Models:** |
47 | 45 | The core BIDS data model is implemented in `ancpbids/model_base.py` and versioned model files (e.g., `model_v1_8_0.py`). These define the schema and object graph for BIDS datasets. |
48 | 46 |
|
@@ -112,6 +110,29 @@ The plugin system is a core feature for extensibility: |
112 | 110 |
|
113 | 111 | - The codebase uses type hints and docstrings for clarity. |
114 | 112 | - Contributions should follow PEP8 and include tests and documentation. |
| 113 | +## Model Generation Utility |
| 114 | + |
| 115 | +The script `tools/generatemodel.py` is provided to automate the generation of Python model classes from BIDS schema files. This utility ensures that the codebase can easily stay up-to-date with the latest BIDS schema versions. |
| 116 | + |
| 117 | +**Features:** |
| 118 | +- Fetches the latest or a specified BIDS schema version directly from the official BIDS GitHub repository. |
| 119 | +- Downloads the schema and generates Python model files in the `ancpbids/` directory (e.g., `model_base.py`, `model_v<version>.py`). |
| 120 | +- Supports custom ordering and enum generation for BIDS datatypes, modalities, suffixes, and entities. |
| 121 | + |
| 122 | +**Usage:** |
| 123 | + |
| 124 | +```bash |
| 125 | +cd tools |
| 126 | +python generatemodel.py [--schema-version <version>] |
| 127 | +``` |
| 128 | + |
| 129 | +- If `--schema-version` is omitted, the latest available schema version will be used. |
| 130 | +- The generated files will be saved in the `ancpbids/` directory and the corresponding schema in the `schema/` directory. |
| 131 | + |
| 132 | +**When to use:** |
| 133 | +- When a new BIDS schema version is released and you want to update the models. |
| 134 | +- When making changes to the schema or model structure for development or testing. |
| 135 | + |
115 | 136 |
|
116 | 137 | ## Further Reading |
117 | 138 |
|
|
0 commit comments