|
| 1 | +# DataJoint Python Documentation Update Plan |
| 2 | + |
| 3 | +This plan outlines the comprehensive update to the DataJoint Python documentation, aligning it with the [DataJoint Book](https://datajoint.github.io/datajoint-book) structure while adding Python-specific API details. |
| 4 | + |
| 5 | +## Goals |
| 6 | + |
| 7 | +1. **Align with DataJoint Book** - Follow the same conceptual structure and terminology |
| 8 | +2. **Add API Details** - Include Python-specific implementation details, method signatures, and code examples |
| 9 | +3. **Document New Features** - Cover new features like `object` type, pydantic-settings configuration, staged inserts |
| 10 | +4. **Improve Navigation** - Create a clearer, more logical navigation structure |
| 11 | + |
| 12 | +--- |
| 13 | + |
| 14 | +## Proposed Navigation Structure |
| 15 | + |
| 16 | +### 1. Introduction (NEW/ENHANCED) |
| 17 | +Aligns with Book: Introduction section |
| 18 | + |
| 19 | +| Current | Proposed | Changes | |
| 20 | +|---------|----------|---------| |
| 21 | +| `index.md` | `index.md` | Add purpose statement, executive summary | |
| 22 | +| `quick-start.md` | `quick-start.md` | Expand with prerequisites, environment setup | |
| 23 | +| — | `intro/prerequisites.md` | NEW: Python version, dependencies, database requirements | |
| 24 | +| — | `intro/environment.md` | NEW: Development environment setup (IDE, Jupyter, Docker) | |
| 25 | +| `client/install.md` | `intro/install.md` | Move and expand installation guide | |
| 26 | +| `client/credentials.md` | `intro/connection.md` | Merge credentials into connection setup | |
| 27 | + |
| 28 | +### 2. Concepts (ENHANCED) |
| 29 | +Aligns with Book: Concepts section |
| 30 | + |
| 31 | +| Current | Proposed | Changes | |
| 32 | +|---------|----------|---------| |
| 33 | +| `concepts/principles.md` | `concepts/principles.md` | Expand with complete theory | |
| 34 | +| `concepts/data-model.md` | `concepts/relational-model.md` | Rename, align with Book terminology | |
| 35 | +| — | `concepts/databases.md` | NEW: What databases are, why use them | |
| 36 | +| — | `concepts/data-integrity.md` | NEW: Entity, referential, group integrity | |
| 37 | +| `concepts/data-pipelines.md` | `concepts/pipelines.md` | Expand pipeline concepts | |
| 38 | +| `concepts/teamwork.md` | `concepts/teamwork.md` | Keep, enhance collaboration aspects | |
| 39 | +| `concepts/terminology.md` | `concepts/terminology.md` | Update with Book terminology | |
| 40 | + |
| 41 | +### 3. Configuration (REORGANIZED) |
| 42 | +Combines: Client Configuration + System Administration |
| 43 | + |
| 44 | +| Current | Proposed | Changes | |
| 45 | +|---------|----------|---------| |
| 46 | +| `client/settings.md` | `config/settings.md` | Keep new pydantic-settings docs | |
| 47 | +| `client/stores.md` | `config/stores.md` | External store configuration | |
| 48 | +| `sysadmin/database-admin.md` | `config/database-admin.md` | Move to config section | |
| 49 | +| `sysadmin/bulk-storage.md` | `config/storage-backends.md` | Rename, enhance with fsspec | |
| 50 | +| `sysadmin/external-store.md` | `config/external-store.md` | Keep, enhance | |
| 51 | +| — | `config/object-storage.md` | NEW: Object storage configuration | |
| 52 | + |
| 53 | +### 4. Design (ENHANCED) |
| 54 | +Aligns with Book: Design section |
| 55 | + |
| 56 | +| Current | Proposed | Changes | |
| 57 | +|---------|----------|---------| |
| 58 | +| `design/schema.md` | `design/schema.md` | Keep, add API details | |
| 59 | +| **Tables subsection** | | | |
| 60 | +| `design/tables/tiers.md` | `design/tables/tiers.md` | Expand tier explanations | |
| 61 | +| `design/tables/declare.md` | `design/tables/declare.md` | Add more syntax examples | |
| 62 | +| `design/tables/primary.md` | `design/tables/primary-key.md` | Rename for consistency | |
| 63 | +| `design/tables/attributes.md` | `design/tables/attributes.md` | Expand data types, defaults | |
| 64 | +| `design/tables/lookup.md` | `design/tables/lookup.md` | Add use cases | |
| 65 | +| `design/tables/manual.md` | `design/tables/manual.md` | Keep | |
| 66 | +| — | `design/tables/imported.md` | NEW: Document Imported tables | |
| 67 | +| — | `design/tables/computed.md` | NEW: Document Computed tables | |
| 68 | +| `design/tables/dependencies.md` | `design/tables/foreign-keys.md` | Rename to match Book | |
| 69 | +| `design/tables/indexes.md` | `design/tables/indexes.md` | Keep | |
| 70 | +| `design/tables/master-part.md` | `design/tables/master-part.md` | Keep | |
| 71 | +| **Data Types subsection** | | | |
| 72 | +| `design/tables/blobs.md` | `design/datatypes/blob.md` | Move to datatypes | |
| 73 | +| `design/tables/attach.md` | `design/datatypes/attach.md` | Move to datatypes | |
| 74 | +| `design/tables/filepath.md` | `design/datatypes/filepath.md` | Move to datatypes | |
| 75 | +| `design/tables/object.md` | `design/datatypes/object.md` | Move to datatypes (NEW feature) | |
| 76 | +| `design/tables/customtype.md` | `design/datatypes/adapters.md` | Move, rename to match Book | |
| 77 | +| **Other Design** | | | |
| 78 | +| `design/diagrams.md` | `design/diagrams.md` | Keep, add API details | |
| 79 | +| `design/normalization.md` | `design/normalization.md` | Expand with examples | |
| 80 | +| `design/integrity.md` | `design/integrity.md` | Expand integrity concepts | |
| 81 | +| `design/alter.md` | `design/alter.md` | Keep | |
| 82 | +| `design/recall.md` | `design/recall.md` | Keep | |
| 83 | +| `design/drop.md` | `design/drop.md` | Keep | |
| 84 | + |
| 85 | +### 5. Operations (ENHANCED) |
| 86 | +Aligns with Book: Operations section |
| 87 | + |
| 88 | +| Current | Proposed | Changes | |
| 89 | +|---------|----------|---------| |
| 90 | +| `manipulation/index.md` | `operations/index.md` | Rename section | |
| 91 | +| `manipulation/insert.md` | `operations/insert.md` | Expand with staged insert | |
| 92 | +| `manipulation/delete.md` | `operations/delete.md` | Add cascade examples | |
| 93 | +| `manipulation/update.md` | `operations/update.md` | Keep | |
| 94 | +| `manipulation/transactions.md` | `operations/transactions.md` | Keep | |
| 95 | +| **Computations** | | | |
| 96 | +| `compute/make.md` | `operations/make.md` | Move to operations | |
| 97 | +| `compute/populate.md` | `operations/populate.md` | Move to operations | |
| 98 | +| `compute/key-source.md` | `operations/key-source.md` | Move to operations | |
| 99 | +| `compute/distributed.md` | `operations/distributed.md` | Move to operations | |
| 100 | +| — | `operations/jobs.md` | NEW: Job management and reservations | |
| 101 | + |
| 102 | +### 6. Queries (ENHANCED) |
| 103 | +Aligns with Book: Queries section |
| 104 | + |
| 105 | +| Current | Proposed | Changes | |
| 106 | +|---------|----------|---------| |
| 107 | +| `query/principles.md` | `queries/index.md` | Rename to index | |
| 108 | +| `query/fetch.md` | `queries/fetch.md` | Expand fetch options | |
| 109 | +| `query/operators.md` | `queries/operators.md` | Overview of all operators | |
| 110 | +| `query/restrict.md` | `queries/restriction.md` | Rename to match Book | |
| 111 | +| `query/project.md` | `queries/projection.md` | Rename to match Book | |
| 112 | +| `query/join.md` | `queries/join.md` | Keep | |
| 113 | +| `query/union.md` | `queries/union.md` | Keep | |
| 114 | +| `query/aggregation.md` | `queries/aggregation.md` | Keep | |
| 115 | +| `query/universals.md` | `queries/universal-sets.md` | Keep | |
| 116 | +| `query/iteration.md` | `queries/iteration.md` | Keep | |
| 117 | +| `query/query-caching.md` | `queries/caching.md` | Keep | |
| 118 | +| `query/example-schema.md` | `examples/query-examples.md` | Move to examples | |
| 119 | + |
| 120 | +### 7. Examples (NEW SECTION) |
| 121 | +Aligns with Book: Examples section |
| 122 | + |
| 123 | +| Proposed | Description | |
| 124 | +|----------|-------------| |
| 125 | +| `examples/index.md` | Examples overview | |
| 126 | +| `examples/university.md` | University schema example (adapt from Book) | |
| 127 | +| `examples/query-examples.md` | Query examples (moved from query section) | |
| 128 | +| `tutorials/json.ipynb` | Keep existing tutorial | |
| 129 | +| `tutorials/dj-top.ipynb` | Keep existing tutorial | |
| 130 | + |
| 131 | +### 8. Special Topics (NEW SECTION) |
| 132 | +Aligns with Book: Special Topics section |
| 133 | + |
| 134 | +| Proposed | Description | |
| 135 | +|----------|-------------| |
| 136 | +| `topics/uuid.md` | UUID primary keys | |
| 137 | +| `topics/caching.md` | Query and result caching | |
| 138 | +| `topics/adapters.md` | Adapted attribute types (moved) | |
| 139 | +| `topics/migrations.md` | Schema migrations | |
| 140 | + |
| 141 | +### 9. Reference (ENHANCED) |
| 142 | + |
| 143 | +| Current | Proposed | Changes | |
| 144 | +|---------|----------|---------| |
| 145 | +| `internal/transpilation.md` | `reference/transpilation.md` | Move to reference | |
| 146 | +| `api/` | `api/` | Keep auto-generated API docs | |
| 147 | +| `faq.md` | `reference/faq.md` | Move to reference | |
| 148 | +| `develop.md` | `reference/develop.md` | Move to reference | |
| 149 | +| `citation.md` | `reference/citation.md` | Move to reference | |
| 150 | +| `changelog.md` | `reference/changelog.md` | Move to reference | |
| 151 | + |
| 152 | +--- |
| 153 | + |
| 154 | +## Content Updates by Section |
| 155 | + |
| 156 | +### 1. Introduction Updates |
| 157 | + |
| 158 | +**index.md** |
| 159 | +- [ ] Add DataJoint purpose statement (from Book) |
| 160 | +- [ ] Add executive summary of capabilities |
| 161 | +- [ ] Update "Getting Started" links to new structure |
| 162 | +- [ ] Keep pipeline example image |
| 163 | + |
| 164 | +**quick-start.md** |
| 165 | +- [ ] Add prerequisites section |
| 166 | +- [ ] Expand connection setup with all methods |
| 167 | +- [ ] Add troubleshooting tips |
| 168 | +- [ ] Add links to full documentation sections |
| 169 | + |
| 170 | +**NEW: intro/prerequisites.md** |
| 171 | +- [ ] Python version requirements (3.10+) |
| 172 | +- [ ] Required packages (automatically installed) |
| 173 | +- [ ] Optional packages (graphviz, pandas) |
| 174 | +- [ ] Database requirements (MySQL 8.0+, MariaDB) |
| 175 | + |
| 176 | +**NEW: intro/environment.md** |
| 177 | +- [ ] Development environment options |
| 178 | +- [ ] Docker Compose setup |
| 179 | +- [ ] GitHub Codespaces |
| 180 | +- [ ] Local development setup |
| 181 | + |
| 182 | +### 2. Concepts Updates |
| 183 | + |
| 184 | +**concepts/principles.md** |
| 185 | +- [ ] Complete the incomplete sections (Object Serialization, Diagramming, etc.) |
| 186 | +- [ ] Add examples for each principle |
| 187 | +- [ ] Link to implementation details |
| 188 | + |
| 189 | +**concepts/relational-model.md** (renamed from data-model.md) |
| 190 | +- [ ] Align terminology with Book |
| 191 | +- [ ] Add relational algebra basics |
| 192 | +- [ ] Explain entity-relationship model |
| 193 | + |
| 194 | +**NEW: concepts/data-integrity.md** |
| 195 | +- [ ] Entity integrity explanation |
| 196 | +- [ ] Referential integrity (foreign keys) |
| 197 | +- [ ] Group integrity (master-part) |
| 198 | +- [ ] How DataJoint enforces each |
| 199 | + |
| 200 | +### 3. Configuration Updates |
| 201 | + |
| 202 | +**config/settings.md** |
| 203 | +- [ ] Already updated with pydantic-settings - verify completeness |
| 204 | +- [ ] Add migration guide from old config system |
| 205 | + |
| 206 | +**NEW: config/object-storage.md** |
| 207 | +- [ ] Object storage setup for `object` type |
| 208 | +- [ ] S3, GCS, Azure, local backends |
| 209 | +- [ ] fsspec configuration |
| 210 | +- [ ] Credential management |
| 211 | + |
| 212 | +### 4. Design Updates |
| 213 | + |
| 214 | +**design/tables/tiers.md** |
| 215 | +- [ ] Add tier selection decision tree |
| 216 | +- [ ] Include practical examples for each tier |
| 217 | +- [ ] Document tier-specific behaviors |
| 218 | + |
| 219 | +**NEW: design/tables/imported.md** |
| 220 | +- [ ] Document Imported table class |
| 221 | +- [ ] External data source integration |
| 222 | +- [ ] Make method requirements |
| 223 | + |
| 224 | +**NEW: design/tables/computed.md** |
| 225 | +- [ ] Document Computed table class |
| 226 | +- [ ] Make method requirements |
| 227 | +- [ ] Key source configuration |
| 228 | + |
| 229 | +**design/datatypes/object.md** |
| 230 | +- [ ] Already documented - verify completeness |
| 231 | +- [ ] Add migration guide from attach/filepath |
| 232 | + |
| 233 | +### 5. Operations Updates |
| 234 | + |
| 235 | +**operations/insert.md** |
| 236 | +- [ ] Document staged insert feature |
| 237 | +- [ ] Add batch insert best practices |
| 238 | +- [ ] Error handling examples |
| 239 | + |
| 240 | +**NEW: operations/jobs.md** |
| 241 | +- [ ] Job table functionality |
| 242 | +- [ ] Job reservation system |
| 243 | +- [ ] Error tracking |
| 244 | +- [ ] Distributed computing coordination |
| 245 | + |
| 246 | +### 6. Queries Updates |
| 247 | + |
| 248 | +**queries/fetch.md** |
| 249 | +- [ ] Document all fetch parameters |
| 250 | +- [ ] Add format options (array, frame, dict) |
| 251 | +- [ ] Performance considerations |
| 252 | + |
| 253 | +**queries/restriction.md** |
| 254 | +- [ ] Complete operator syntax |
| 255 | +- [ ] Add AND/OR combinations |
| 256 | +- [ ] NOT operator usage |
| 257 | + |
| 258 | +### 7. Examples Section |
| 259 | + |
| 260 | +**examples/university.md** |
| 261 | +- [ ] Adapt University example from Book |
| 262 | +- [ ] Include complete working code |
| 263 | +- [ ] Show all CRUD operations |
| 264 | +- [ ] Demonstrate queries |
| 265 | + |
| 266 | +--- |
| 267 | + |
| 268 | +## Implementation Order |
| 269 | + |
| 270 | +### Phase 1: Structure and Navigation |
| 271 | +1. Update `mkdocs.yaml` with new navigation structure |
| 272 | +2. Create new directories and placeholder files |
| 273 | +3. Move existing files to new locations |
| 274 | +4. Update internal links |
| 275 | + |
| 276 | +### Phase 2: Core Content |
| 277 | +1. Update Introduction section |
| 278 | +2. Enhance Concepts section |
| 279 | +3. Update Configuration section |
| 280 | +4. Complete Design section |
| 281 | + |
| 282 | +### Phase 3: Operations and Queries |
| 283 | +1. Enhance Operations section |
| 284 | +2. Improve Queries section |
| 285 | +3. Add Examples section |
| 286 | + |
| 287 | +### Phase 4: Polish |
| 288 | +1. Add Special Topics |
| 289 | +2. Update Reference section |
| 290 | +3. Verify all links work |
| 291 | +4. Review for consistency |
| 292 | + |
| 293 | +--- |
| 294 | + |
| 295 | +## Files to Create |
| 296 | + |
| 297 | +New files needed: |
| 298 | +- `docs/src/intro/prerequisites.md` |
| 299 | +- `docs/src/intro/environment.md` |
| 300 | +- `docs/src/concepts/databases.md` |
| 301 | +- `docs/src/concepts/data-integrity.md` |
| 302 | +- `docs/src/design/tables/imported.md` |
| 303 | +- `docs/src/design/tables/computed.md` |
| 304 | +- `docs/src/config/object-storage.md` |
| 305 | +- `docs/src/operations/jobs.md` |
| 306 | +- `docs/src/examples/index.md` |
| 307 | +- `docs/src/examples/university.md` |
| 308 | +- `docs/src/topics/uuid.md` |
| 309 | +- `docs/src/topics/migrations.md` |
| 310 | + |
| 311 | +--- |
| 312 | + |
| 313 | +## Notes |
| 314 | + |
| 315 | +- Keep Python-specific API details that differ from the generic Book |
| 316 | +- Maintain existing good content, enhance where needed |
| 317 | +- All code examples should be tested and working |
| 318 | +- Use admonitions for tips, warnings, and notes |
| 319 | +- Include cross-references between related topics |
0 commit comments