-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[MNT] Add example scripts for creating data dictionary + graph data JSON schema #427
Conversation
Reviewer's Guide by SourceryThis pull request introduces two new scripts that generate JSON schemas for the Neurobagel data dictionary and graph data models. These scripts use the Pydantic models to create the schemas and output them to JSON files. Sequence diagram for JSON schema generationsequenceDiagram
participant Script
participant PydanticModel
participant FileSystem
Script->>PydanticModel: model_json_schema()
PydanticModel-->>Script: JSON schema
Script->>FileSystem: Write schema to file
Note over Script,FileSystem: Writes formatted JSON with indent=2
Flow diagram for JSON schema generation processgraph TD
A[Pydantic Models] --> B[generate_dictionary_jsonschema.py]
A --> C[generate_graphdata_jsonschema.py]
B --> D[neurobagel_datadictionary.schema.json]
C --> E[neurobagel_graphdata.schema.json]
subgraph Models
F[DataDictionary Model] -.-> A
G[Dataset Model] -.-> A
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #427 +/- ##
=======================================
Coverage 98.55% 98.55%
=======================================
Files 18 18
Lines 1109 1109
=======================================
Hits 1093 1093
Misses 16 16 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good @alyssadai. I'm wondering though: should we group these scripts up a bit? Either in a /helperscript
or similar directory, or even in a single script with basic argparse to switch between the modes (or even generate all schemata every time the single script is run)?
🧑🍳
Hey @alyssadai, while you're at it with grouping the scripts, take a look at #412 and see if that would be an easy fix. I'm assuming that no, but wanted to point out |
- will address in #412
Changes proposed in this pull request:
Checklist
This section is for the PR reviewer
[ENH]
,[FIX]
,[REF]
,[TST]
,[CI]
,[MNT]
,[INF]
,[MODEL]
,[DOC]
) (see our Contributing Guidelines for more info)skip-release
(to be applied by maintainers only)Closes #XXXX
For new features:
For bug fixes:
Summary by Sourcery
New Features: