Skip to content
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

docs: Create simplified data model graphics from script #1260

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ venv.bak/

# mkdocs documentation
/site
_scripts/ER_DIAGRAM.md

# mypy
.mypy_cache/
Expand Down
10 changes: 9 additions & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ BUILDDIR = _build
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile
.PHONY: help Makefile html

dataorg:
@echo "Generating dataorg"
wget -O _scripts/ER_DIAGRAM.md https://raw.githubusercontent.com/chanzuckerberg/cryoet-data-portal-backend/refs/heads/main/schema/api/v2.0.0/codegen/ER_DIAGRAM.md
python _scripts/summarize_diagram.py

html: dataorg
@$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
Expand Down
52 changes: 52 additions & 0 deletions docs/_scripts/ER_DIAGRAM-parsed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
```{eval-rst}
.. md-mermaid::
erDiagram
Dataset ||--|o Deposition : "deposition"
Dataset ||--}o Run : "runs"
Run ||--}o Alignment : "alignments"
Run ||--}o Annotation : "annotations"
Run ||--|| Dataset : "dataset"
Run ||--}o Frame : "frames"
Run ||--}o Tiltseries : "tiltseries"
Run ||--}o TomogramVoxelSpacing : "tomogram_voxel_spacings"
Run ||--}o Tomogram : "tomograms"
Tomogram ||--|o Alignment : "alignment"
Tomogram ||--|o Deposition : "deposition"
Tomogram ||--|o Run : "run"
Tomogram ||--|o TomogramVoxelSpacing : "tomogram_voxel_spacing"
Tomogram ||--|o Any : "affine_transformation_matrix"
TomogramVoxelSpacing ||--}o AnnotationFile : "annotation_files"
TomogramVoxelSpacing ||--|o Run : "run"
TomogramVoxelSpacing ||--}o Tomogram : "tomograms"
AnnotationFile ||--|o Alignment : "alignment"
AnnotationFile ||--|o AnnotationShape : "annotation_shape"
AnnotationFile ||--|o TomogramVoxelSpacing : "tomogram_voxel_spacing"
AnnotationShape ||--|o Annotation : "annotation"
AnnotationShape ||--}o AnnotationFile : "annotation_files"
Annotation ||--|o Run : "run"
Annotation ||--}o AnnotationShape : "annotation_shapes"
Annotation ||--|o Deposition : "deposition"
Deposition ||--}o Alignment : "alignments"
Deposition ||--}o Annotation : "annotations"
Deposition ||--}o Dataset : "datasets"
Deposition ||--}o Frame : "frames"
Deposition ||--}o Tiltseries : "tiltseries"
Deposition ||--}o DepositionType : "deposition_types"
DepositionType ||--|o Deposition : "deposition"
Tiltseries ||--}o Alignment : "alignments"
Tiltseries ||--}o PerSectionParameters : "per_section_parameters"
Tiltseries ||--|| Run : "run"
Tiltseries ||--|o Deposition : "deposition"
PerSectionParameters ||--|| Frame : "frame"
PerSectionParameters ||--|| Tiltseries : "tiltseries"
Frame ||--|o Deposition : "deposition"
Frame ||--}o PerSectionParameters : "per_section_parameters"
Frame ||--|o Run : "run"
Alignment ||--}o AnnotationFile : "annotation_files"
Alignment ||--}o PerSectionAlignmentParameters : "per_section_alignments"
Alignment ||--|o Deposition : "deposition"
Alignment ||--|o Tiltseries : "tiltseries"
Alignment ||--}o Tomogram : "tomograms"
Alignment ||--|o Run : "run"
PerSectionAlignmentParameters ||--|| Alignment : "alignment"
```
Loading