ctao-datamodel 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. ctao_datamodel-1.0.0/.gitignore +136 -0
  2. ctao_datamodel-1.0.0/.gitlab-ci.yml +188 -0
  3. ctao_datamodel-1.0.0/.pre-commit-config.yaml +49 -0
  4. ctao_datamodel-1.0.0/CHANGES.rst +4 -0
  5. ctao_datamodel-1.0.0/Dockerfile +33 -0
  6. ctao_datamodel-1.0.0/LICENSE +29 -0
  7. ctao_datamodel-1.0.0/MANIFEST.in +2 -0
  8. ctao_datamodel-1.0.0/PKG-INFO +48 -0
  9. ctao_datamodel-1.0.0/README.md +14 -0
  10. ctao_datamodel-1.0.0/docs/Makefile +24 -0
  11. ctao_datamodel-1.0.0/docs/changelog.rst +7 -0
  12. ctao_datamodel-1.0.0/docs/changes/README.md +22 -0
  13. ctao_datamodel-1.0.0/docs/changes/template.rst +43 -0
  14. ctao_datamodel-1.0.0/docs/common.rst +6 -0
  15. ctao_datamodel-1.0.0/docs/conf.py +160 -0
  16. ctao_datamodel-1.0.0/docs/dataproducts.rst +8 -0
  17. ctao_datamodel-1.0.0/docs/development.ipynb +284 -0
  18. ctao_datamodel-1.0.0/docs/index.rst +28 -0
  19. ctao_datamodel-1.0.0/docs/installation.rst +35 -0
  20. ctao_datamodel-1.0.0/docs/models.rst +11 -0
  21. ctao_datamodel-1.0.0/docs/r1.rst +6 -0
  22. ctao_datamodel-1.0.0/docs/reference.rst +7 -0
  23. ctao_datamodel-1.0.0/docs/sciops.rst +6 -0
  24. ctao_datamodel-1.0.0/docs/usage/DL0-metadata.ipynb +386 -0
  25. ctao_datamodel-1.0.0/docs/usage/DL3-metadata.ipynb +459 -0
  26. ctao_datamodel-1.0.0/docs/usage/index.rst +12 -0
  27. ctao_datamodel-1.0.0/docs/usage/quickstart.ipynb +466 -0
  28. ctao_datamodel-1.0.0/environment.yml +20 -0
  29. ctao_datamodel-1.0.0/pyproject.toml +185 -0
  30. ctao_datamodel-1.0.0/setup.cfg +4 -0
  31. ctao_datamodel-1.0.0/sonar-project.properties +12 -0
  32. ctao_datamodel-1.0.0/src/ctao_datamodel/__init__.py +66 -0
  33. ctao_datamodel-1.0.0/src/ctao_datamodel/_core.py +165 -0
  34. ctao_datamodel-1.0.0/src/ctao_datamodel/_fits.py +182 -0
  35. ctao_datamodel-1.0.0/src/ctao_datamodel/_latex.py +278 -0
  36. ctao_datamodel-1.0.0/src/ctao_datamodel/_plantuml.py +369 -0
  37. ctao_datamodel-1.0.0/src/ctao_datamodel/_version.py +24 -0
  38. ctao_datamodel-1.0.0/src/ctao_datamodel/_visitor.py +573 -0
  39. ctao_datamodel-1.0.0/src/ctao_datamodel/models/__init__.py +5 -0
  40. ctao_datamodel-1.0.0/src/ctao_datamodel/models/common.py +20 -0
  41. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/__init__.py +107 -0
  42. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/acquisition.py +26 -0
  43. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/ident.py +546 -0
  44. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/observation.py +344 -0
  45. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/reference.py +397 -0
  46. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/sdc.py +26 -0
  47. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/tests/test_dataproducts.py +190 -0
  48. ctao_datamodel-1.0.0/src/ctao_datamodel/models/dataproducts/utils.py +67 -0
  49. ctao_datamodel-1.0.0/src/ctao_datamodel/models/r1.py +37 -0
  50. ctao_datamodel-1.0.0/src/ctao_datamodel/models/sciops.py +96 -0
  51. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/__init__.py +0 -0
  52. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/conftest.py +90 -0
  53. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_core.py +69 -0
  54. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_fits.py +48 -0
  55. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_latex.py +48 -0
  56. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_plantuml.py +76 -0
  57. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_version.py +4 -0
  58. ctao_datamodel-1.0.0/src/ctao_datamodel/tests/test_visitor.py +259 -0
  59. ctao_datamodel-1.0.0/src/ctao_datamodel/version.py +24 -0
  60. ctao_datamodel-1.0.0/src/ctao_datamodel.egg-info/PKG-INFO +48 -0
  61. ctao_datamodel-1.0.0/src/ctao_datamodel.egg-info/SOURCES.txt +62 -0
  62. ctao_datamodel-1.0.0/src/ctao_datamodel.egg-info/dependency_links.txt +1 -0
  63. ctao_datamodel-1.0.0/src/ctao_datamodel.egg-info/requires.txt +25 -0
  64. ctao_datamodel-1.0.0/src/ctao_datamodel.egg-info/top_level.txt +1 -0
@@ -0,0 +1,136 @@
1
+ # setuptools_scm generated version file
2
+ _version.py
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ *.py[cod]
7
+ *$py.class
8
+
9
+ # C extensions
10
+ *.so
11
+
12
+ # Distribution / packaging
13
+ .Python
14
+ build/
15
+ develop-eggs/
16
+ dist/
17
+ downloads/
18
+ eggs/
19
+ .eggs/
20
+ lib/
21
+ lib64/
22
+ parts/
23
+ sdist/
24
+ var/
25
+ wheels/
26
+ pip-wheel-metadata/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+
57
+ # Translations
58
+ *.mo
59
+ *.pot
60
+
61
+ # Django stuff:
62
+ *.log
63
+ local_settings.py
64
+ db.sqlite3
65
+ db.sqlite3-journal
66
+
67
+ # Flask stuff:
68
+ instance/
69
+ .webassets-cache
70
+
71
+ # Scrapy stuff:
72
+ .scrapy
73
+
74
+ # Sphinx documentation
75
+ docs/_build/
76
+ docs/api
77
+
78
+ # PyBuilder
79
+ target/
80
+
81
+ # Jupyter Notebook
82
+ .ipynb_checkpoints
83
+ .virtual_documents
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ .python-version
91
+
92
+ # pipenv
93
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
94
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
95
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
96
+ # install all needed dependencies.
97
+ #Pipfile.lock
98
+
99
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
100
+ __pypackages__/
101
+
102
+ # Celery stuff
103
+ celerybeat-schedule
104
+ celerybeat.pid
105
+
106
+ # SageMath parsed files
107
+ *.sage.py
108
+
109
+ # Environments
110
+ .env
111
+ .venv
112
+ env/
113
+ venv/
114
+ ENV/
115
+ env.bak/
116
+ venv.bak/
117
+
118
+ # Spyder project settings
119
+ .spyderproject
120
+ .spyproject
121
+
122
+ # Rope project settings
123
+ .ropeproject
124
+
125
+ # mkdocs documentation
126
+ /site
127
+
128
+ # mypy
129
+ .mypy_cache/
130
+ .dmypy.json
131
+ dmypy.json
132
+
133
+ # Pyre type checker
134
+ .pyre/
135
+ /src/ctao_datamodel/_dev_version/
136
+ /docs/generated/
@@ -0,0 +1,188 @@
1
+ include:
2
+ - project: cta-computing/common/aiv-toolkit
3
+ ref: 4e2e12fe5bb637aa9a01c8dd3bd7680b36c70599
4
+ file: ci-publish-pypi.yml
5
+
6
+ variables:
7
+ PYTHON_IMAGE: harbor.cta-observatory.org/proxy_cache/python:3.13
8
+
9
+ workflow:
10
+ rules:
11
+ # build on merge request updates
12
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
13
+ # on merge-requests, don't upload the docker image, just test we can build it
14
+ variables:
15
+ DOCKER_EXTRA_ARGS: "--no-push"
16
+ DOCKER_TAG: "${CI_COMMIT_SHA}"
17
+
18
+ # pushes to main
19
+ - if: $CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
20
+ variables:
21
+ # on main, update the "latest" version
22
+ DOCKER_TAG: "latest"
23
+
24
+ # and tags
25
+ - if: $CI_COMMIT_TAG
26
+ variables:
27
+ # on tags, create image tag using the same name
28
+ DOCKER_TAG: "${CI_COMMIT_TAG}"
29
+
30
+ # jobs in the same stage run in parallel
31
+ # later stages run after all jobs of previous stage were successful
32
+ stages:
33
+ - static-checks
34
+ - test
35
+ - sonarqube
36
+ - build
37
+ - deploy
38
+ - publish
39
+
40
+ static:
41
+ stage: static-checks
42
+ image: "harbor.cta-observatory.org/proxy_cache/python:3.12"
43
+
44
+ before_script:
45
+ - apt update && apt install -y --no-install-recommends git
46
+ - python --version
47
+ - pip install pre-commit
48
+
49
+ script:
50
+ - pre-commit run --all-files
51
+
52
+ tests:
53
+ stage: test
54
+ parallel:
55
+ matrix:
56
+ - PYTHON_VERSION:
57
+ - "3.12"
58
+ - "3.13"
59
+ - "3.14"
60
+
61
+ image: "harbor.cta-observatory.org/proxy_cache/python:$PYTHON_VERSION"
62
+
63
+ before_script:
64
+ - python --version
65
+ - pip install -e .[test]
66
+ - apt update --yes && apt install --yes plantuml
67
+
68
+ script:
69
+ - pytest -v --color=yes --doctest-glob='docs/**/*.rst' --ignore-glob='src/ctao_datamodel/_dev_version/*'
70
+
71
+ # Run the coverage on the oldest supported python version
72
+ # no special reason, just to have no "gap" in the versions in the matrix above
73
+ tests-with-cov:
74
+ stage: test
75
+ image: "harbor.cta-observatory.org/proxy_cache/python:3.13"
76
+
77
+ before_script:
78
+ - python --version
79
+ - pip install -e .[test]
80
+ - apt update --yes && apt install --yes plantuml
81
+
82
+ script:
83
+ - pytest -v --color=yes --doctest-glob='docs/**/*.rst' --ignore-glob='src/TEMPLATE_MODULE/_dev_version/*' --cov --cov-report=xml
84
+
85
+ artifacts:
86
+ paths:
87
+ - coverage.xml
88
+
89
+ sonarqube:
90
+ stage: sonarqube
91
+ allow_failure: true
92
+ needs:
93
+ - job: tests-with-cov
94
+ artifacts: true
95
+ image:
96
+ name: "harbor.cta-observatory.org/proxy_cache/sonarsource/sonar-scanner-cli:11"
97
+ entrypoint: [""]
98
+
99
+ variables:
100
+ SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
101
+ GIT_DEPTH: "0"
102
+
103
+ before_script:
104
+ - python3 -m ensurepip
105
+ - python3 -m pip install setuptools_scm
106
+ - PROJECT_VERSION=$(python3 -m setuptools_scm)
107
+
108
+ script:
109
+ - sonar-scanner -Dsonar.projectVersion=${PROJECT_VERSION}
110
+
111
+ build-docs:
112
+ stage: test
113
+ image: "harbor.cta-observatory.org/proxy_cache/python:3.13"
114
+
115
+ variables:
116
+ INDEX_PATH: "docs/build/html/index.html"
117
+
118
+ before_script:
119
+ - python --version
120
+ - pip install .[doc]
121
+ - apt update --yes && apt install --yes plantuml tree
122
+
123
+ script:
124
+ - make -C docs html
125
+
126
+ after_script:
127
+ - export BASE_GROUP=$(echo ${CI_PROJECT_PATH} | cut -d/ -f1)
128
+ - export PROJECT_PATH=$(echo ${CI_PROJECT_PATH} | cut -d/ -f2-)
129
+ - "export URL_SCHEME=$(echo ${CI_PAGES_URL} | cut -d: -f1)"
130
+ - echo "ENVIRONMENT_URL=${URL_SCHEME}://${BASE_GROUP}.${CI_PAGES_DOMAIN}/-/${PROJECT_PATH}/-/jobs/${CI_JOB_ID}/artifacts/${INDEX_PATH}" >> deploy.env
131
+ - cat deploy.env
132
+
133
+ artifacts:
134
+ paths:
135
+ - docs/build/html/
136
+ expose_as: "Rendered Documentation"
137
+ reports:
138
+ dotenv: deploy.env
139
+
140
+ deploy_docs_env:
141
+ stage: deploy
142
+ rules:
143
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
144
+ needs:
145
+ - job: build-docs
146
+ artifacts: true
147
+
148
+ script:
149
+ - echo "Using ${ENVIRONMENT_URL:?} to host documentation"
150
+
151
+ environment:
152
+ name: "review-docs/mr-${CI_MERGE_REQUEST_IID}"
153
+ url: ${ENVIRONMENT_URL}
154
+
155
+ # actual deployment to gitlab pages, only on main
156
+ pages:
157
+ stage: deploy
158
+ rules:
159
+ - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
160
+ - if: $CI_COMMIT_TAG
161
+ image: "harbor.cta-observatory.org/proxy_cache/python:3.13"
162
+ needs:
163
+ - job: build-docs
164
+ artifacts: true
165
+ before_script:
166
+ - pip install git+https://gitlab.cta-observatory.org/cta-computing/common/gitlab-multi-version-sphinx/
167
+ script:
168
+ - gitlab_multi_version_sphinx -v
169
+ - find public -maxdepth 1
170
+ artifacts:
171
+ paths:
172
+ - public
173
+ environment: production
174
+
175
+
176
+ # build-docker-image:
177
+ # stage: deploy
178
+ # image:
179
+ # name: gcr.io/kaniko-project/executor:debug
180
+ # entrypoint: [""]
181
+
182
+ # script:
183
+ # - >-
184
+ # /kaniko/executor
185
+ # --context "${CI_PROJECT_DIR}"
186
+ # --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
187
+ # --destination "${CI_REGISTRY_IMAGE}:${DOCKER_TAG}"
188
+ # ${DOCKER_EXTRA_ARGS}
@@ -0,0 +1,49 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0 # Use the ref you want to point at
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ exclude: ".*\\.fits(\\.fz)?"
7
+ - id: check-added-large-files
8
+ - id: check-case-conflict
9
+ - id: check-merge-conflict
10
+ exclude: ".*\\.fits(\\.fz)?"
11
+ - id: end-of-file-fixer
12
+ exclude: ".*\\.fits(\\.fz)?"
13
+
14
+ - repo: https://github.com/codespell-project/codespell
15
+ rev: v2.2.4
16
+ hooks:
17
+ - id: codespell
18
+ additional_dependencies:
19
+ - tomli
20
+
21
+ # temporary until ruff-format supports long-string reformatting, we run this
22
+ # first and then ruff.
23
+ - repo: https://github.com/psf/black-pre-commit-mirror
24
+ rev: 26.1.0
25
+ hooks:
26
+ - id: black
27
+ language_version: python3.12
28
+
29
+ - repo: https://github.com/astral-sh/ruff-pre-commit
30
+ rev: v0.2.1
31
+ hooks:
32
+ - id: ruff
33
+ args: [ --fix, --show-fixes ]
34
+ - id: ruff-format
35
+
36
+ - repo: https://github.com/scientific-python/cookie
37
+ rev: "2024.01.24"
38
+ hooks:
39
+ - id: sp-repo-review
40
+
41
+ - repo: https://github.com/srstevenson/nb-clean
42
+ rev: 4.0.1
43
+ hooks:
44
+ - id: nb-clean
45
+ args:
46
+ - --remove-empty-cells
47
+ - --remove-all-notebook-metadata
48
+ - --preserve-cell-metadata
49
+ - --
@@ -0,0 +1,4 @@
1
+ ctao_datamodel 1.0.0
2
+ --------------------
3
+
4
+ First release, covering DataProducts data model document version A001
@@ -0,0 +1,33 @@
1
+ # See https://testdriven.io/blog/docker-best-practices/ for recommendations
2
+ # on writing dockerfiles for python projects.
3
+
4
+ # We use a build stage to build a wheel which we then copy and install
5
+ # in the second stage to minimize image size. This is mostly needed
6
+ # because setuptools_scm needs the full version info from git and git
7
+ # itself but including that in the final image would bloat its size.
8
+
9
+ # we are using the official python image with just a version tag here
10
+ # it comes with many tools needed to build and compile python packages
11
+ # which increases it's size but is helpful for building
12
+ FROM harbor.cta-observatory.org/proxy_cache/python:3.12 AS builder
13
+
14
+ # Add full repository, needed for setuptools_scm to assign proper version
15
+ COPY . /repo/
16
+
17
+ # build the wheel
18
+ RUN python -m pip install --no-cache-dir build \
19
+ && cd repo \
20
+ && python -m build --wheel
21
+
22
+
23
+ # second stage, copy and install wheel
24
+ # We are using the official python 3.11 image
25
+ # as base image in the slim variant to reduce image size.
26
+ FROM harbor.cta-observatory.org/proxy_cache/python:3.12-slim
27
+ COPY --from=builder /repo/dist /tmp/dist
28
+
29
+ RUN python -m pip install --no-cache-dir /tmp/dist/* \
30
+ && rm -r /tmp/dist \
31
+ && addgroup --system ctao && adduser --system --group ctao
32
+
33
+ USER ctao
@@ -0,0 +1,29 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2022, Cherenkov Telescope Array Observatory
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without
7
+ modification, are permitted provided that the following conditions are met:
8
+
9
+ 1. Redistributions of source code must retain the above copyright notice, this
10
+ list of conditions and the following disclaimer.
11
+
12
+ 2. Redistributions in binary form must reproduce the above copyright notice,
13
+ this list of conditions and the following disclaimer in the documentation
14
+ and/or other materials provided with the distribution.
15
+
16
+ 3. Neither the name of the copyright holder nor the names of its
17
+ contributors may be used to endorse or promote products derived from
18
+ this software without specific prior written permission.
19
+
20
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,2 @@
1
+ prune src/ctao_datamodel/_dev_version
2
+ prune .github
@@ -0,0 +1,48 @@
1
+ Metadata-Version: 2.4
2
+ Name: ctao-datamodel
3
+ Version: 1.0.0
4
+ Summary: CTAO Data Model in pydantic and utilities for exporting it to latex and plantuml.
5
+ Author-email: Karl Kosack <karl.kosack@cta-observatory.org>
6
+ License-Expression: BSD-3-Clause
7
+ Project-URL: repository, https://gitlab.cta-observatory.org/cta-computing/documentation/ctao-datamodel
8
+ Project-URL: documentation, http://cta-computing.gitlab-pages.cta-observatory.org/documentation/ctao-datamodel
9
+ Requires-Python: >=3.12
10
+ Description-Content-Type: text/markdown
11
+ License-File: LICENSE
12
+ Requires-Dist: numpy
13
+ Requires-Dist: pydantic
14
+ Requires-Dist: email-validator
15
+ Requires-Dist: pyyaml
16
+ Requires-Dist: astropy>=7.1
17
+ Requires-Dist: astropydantic
18
+ Provides-Extra: test
19
+ Requires-Dist: pytest; extra == "test"
20
+ Requires-Dist: pytest-cov; extra == "test"
21
+ Provides-Extra: doc
22
+ Requires-Dist: sphinx~=8.2; extra == "doc"
23
+ Requires-Dist: numpydoc; extra == "doc"
24
+ Requires-Dist: ctao-sphinx-theme~=0.1.2; extra == "doc"
25
+ Requires-Dist: sphinx-changelog; extra == "doc"
26
+ Requires-Dist: myst-nb; extra == "doc"
27
+ Requires-Dist: autodoc_pydantic; extra == "doc"
28
+ Provides-Extra: dev
29
+ Requires-Dist: setuptools_scm; extra == "dev"
30
+ Requires-Dist: towncrier; extra == "dev"
31
+ Provides-Extra: all
32
+ Requires-Dist: ctao-datamodel[dev,doc,test]; extra == "all"
33
+ Dynamic: license-file
34
+
35
+ # ctao-datamodel
36
+
37
+ Implementations of a subset of the CTAO data model as [pydantic](https://docs.pydantic.dev/latest/) schemas.
38
+
39
+ * [Documentation](http://cta-computing.gitlab-pages.cta-observatory.org/common/ctao-datamodel/latest/)
40
+ * [Repository](https://gitlab.cta-observatory.org/cta-computing/common/ctao-datamodel)
41
+
42
+ ## Scope
43
+
44
+ The intention is to cover at least the metadata-aspects of the CTAO data model, i.e. the DataProducts model, and other models that will be serialized as JSON-like documents. It does not cover the Science data models (DL3, etc), which are more complex.
45
+
46
+ ## Purpose
47
+
48
+ This module can be used in other projects to help with validation of data against a machine-readable schema. The intention is to also auto-generate [JSONSchema](https://json-schema.org/) from the pydantic models in the CI, and export that as a separate package, to be used with projects that do not want to depend on pydantic, or python in general.
@@ -0,0 +1,14 @@
1
+ # ctao-datamodel
2
+
3
+ Implementations of a subset of the CTAO data model as [pydantic](https://docs.pydantic.dev/latest/) schemas.
4
+
5
+ * [Documentation](http://cta-computing.gitlab-pages.cta-observatory.org/common/ctao-datamodel/latest/)
6
+ * [Repository](https://gitlab.cta-observatory.org/cta-computing/common/ctao-datamodel)
7
+
8
+ ## Scope
9
+
10
+ The intention is to cover at least the metadata-aspects of the CTAO data model, i.e. the DataProducts model, and other models that will be serialized as JSON-like documents. It does not cover the Science data models (DL3, etc), which are more complex.
11
+
12
+ ## Purpose
13
+
14
+ This module can be used in other projects to help with validation of data against a machine-readable schema. The intention is to also auto-generate [JSONSchema](https://json-schema.org/) from the pydantic models in the CI, and export that as a separate package, to be used with projects that do not want to depend on pydantic, or python in general.
@@ -0,0 +1,24 @@
1
+ # Minimal makefile for Sphinx documentation
2
+
3
+ # You can set these variables from the command line, and also
4
+ # from the environment for the first two.
5
+ SPHINXOPTS ?= -W --keep-going -n --color
6
+ SPHINXBUILD ?= sphinx-build
7
+ SOURCEDIR = .
8
+ BUILDDIR = build
9
+
10
+ # Put it first so that "make" without argument is like "make help".
11
+ help:
12
+ @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
+
14
+ .PHONY: help Makefile clean
15
+
16
+ # Catch-all target: route all unknown targets to Sphinx using the new
17
+ # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18
+ %: Makefile
19
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20
+
21
+ clean:
22
+ $(RM) -rf ./api
23
+ $(RM) -rf ./generated
24
+ @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@@ -0,0 +1,7 @@
1
+ Changes
2
+ =======
3
+
4
+ .. changelog::
5
+ :towncrier: ../
6
+ :towncrier-skip-if-empty:
7
+ :changelog_file: ../CHANGES.rst
@@ -0,0 +1,22 @@
1
+ # How to use towncrier
2
+
3
+ An overview can be found [here](https://towncrier.readthedocs.io/en/stable/quickstart.html#).
4
+
5
+ 1. Create a new file for your changes `<MERGE REQUEST NUMBER>.<TYPE>.rst` in the corresponding folder.
6
+ The following types are available:
7
+ - feature: `New feature`
8
+ - bugfix: `Bugfix`
9
+ - api: `API Changes`
10
+ - optimization: `Refactoring and Optimization`
11
+ - maintenance: `Maintenance`
12
+
13
+ 2. Write a suitable message for the change:
14
+ ```
15
+ Fixed ``crazy_function`` to be consistent with ``not_so_crazy_function``
16
+ ```
17
+
18
+ 3. (For maintainers) How to generate a change log:
19
+ Execute the following command in the base directory of the project
20
+ ```
21
+ towncrier build --version=<VERSION NUMBER>
22
+ ```
@@ -0,0 +1,43 @@
1
+ {% if render_title %}
2
+ {% if versiondata.name %}
3
+ {{ versiondata.name | lower }} {{ versiondata.version }} ({{ versiondata.date }})
4
+ {{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}}
5
+ {% else %}
6
+ {{ versiondata.version }} ({{ versiondata.date }})
7
+ {{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}}
8
+ {% endif %}
9
+ {% endif %}
10
+
11
+ {% for category, val in definitions.items() %}
12
+
13
+ {% set underline = underlines[0] %}
14
+ {{ definitions[category]['name'] }}
15
+ {{ underline * definitions[category]['name']|length }}
16
+ {% set underline = underlines[1] %}
17
+
18
+ {% for section, _ in sections.items() %}
19
+ {% if section and category in sections[section] %}
20
+ {{section}}
21
+ {{ underline * section|length }}
22
+
23
+ {% endif %}
24
+ {% if sections[section] and category in sections[section] %}
25
+ {% if definitions[category]['showcontent'] %}
26
+ {% for text, values in sections[section][category].items() %}
27
+ - {{ text }} [{{ values|join(', ') }}]
28
+
29
+ {% endfor %}
30
+ {% else %}
31
+ - {{ sections[section][category]['']|join(', ') }}
32
+
33
+ {% endif %}
34
+ {% if sections[section][category]|length == 0 %}
35
+ No significant changes.
36
+
37
+ {% else %}
38
+ {% endif %}
39
+ {% else %}
40
+ {# No significant changes. #}
41
+ {% endif %}
42
+ {% endfor %}
43
+ {% endfor %}
@@ -0,0 +1,6 @@
1
+ Common
2
+ ======
3
+
4
+ .. currentmodule:: ctao_datamodel.models.common
5
+ .. automodule:: ctao_datamodel.models.common
6
+ :members: