micat 0.1.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.
- micat-0.1.0/.codespellrc +17 -0
- micat-0.1.0/.gitignore +23 -0
- micat-0.1.0/.gitlab-ci.yml +153 -0
- micat-0.1.0/LICENSE +674 -0
- micat-0.1.0/PKG-INFO +80 -0
- micat-0.1.0/README.md +47 -0
- micat-0.1.0/micat/__init__.py +13 -0
- micat-0.1.0/micat/__main__.py +186 -0
- micat-0.1.0/micat/report_assets/OpenSans-Bold.ttf +0 -0
- micat-0.1.0/micat/report_assets/OpenSans-Regular.ttf +0 -0
- micat-0.1.0/micat/report_assets/OpenSans-SemiBold.ttf +0 -0
- micat-0.1.0/micat/report_assets/emblem_pink.svg +7 -0
- micat-0.1.0/micat/report_assets/main.typ +154 -0
- micat-0.1.0/micat/usafcal.py +670 -0
- micat-0.1.0/micat/usafcal_report.py +131 -0
- micat-0.1.0/micat/utils.py +91 -0
- micat-0.1.0/outputs/result/USAF_calibration.pdf +8474 -13
- micat-0.1.0/outputs/result/USAF_calibration.yaml +108 -0
- micat-0.1.0/pyproject.toml +145 -0
- micat-0.1.0/tests/assets/angled.jpeg +0 -0
- micat-0.1.0/tests/assets/bright.jpeg +0 -0
- micat-0.1.0/tests/assets/current_angled_USAF_calibration.yaml +108 -0
- micat-0.1.0/tests/assets/current_bright_USAF_calibration.yaml +108 -0
- micat-0.1.0/tests/assets/current_low_mag_USAF_calibration.yaml +178 -0
- micat-0.1.0/tests/assets/current_square_USAF_calibration.yaml +108 -0
- micat-0.1.0/tests/assets/low_mag.jpeg +0 -0
- micat-0.1.0/tests/assets/square.jpeg +0 -0
- micat-0.1.0/tests/end_to_end/README.md +82 -0
- micat-0.1.0/tests/end_to_end/e2e.py +110 -0
micat-0.1.0/.codespellrc
ADDED
micat-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
*.egg-info
|
|
2
|
+
*.pyc
|
|
3
|
+
*.directory
|
|
4
|
+
|
|
5
|
+
dist/
|
|
6
|
+
build/
|
|
7
|
+
bundle.js
|
|
8
|
+
|
|
9
|
+
# Exclude results of testing the bundled images, but include
|
|
10
|
+
# the yaml's beginning with "current", as they are test assets
|
|
11
|
+
tests/assets/*.pdf
|
|
12
|
+
tests/assets/*.yaml
|
|
13
|
+
!tests/assets/current_*.yaml
|
|
14
|
+
|
|
15
|
+
public/
|
|
16
|
+
|
|
17
|
+
#KDE files
|
|
18
|
+
*.kate-swp
|
|
19
|
+
*.backup
|
|
20
|
+
|
|
21
|
+
# VSC files
|
|
22
|
+
.vscode/
|
|
23
|
+
.venv/*
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
stages:
|
|
2
|
+
- test
|
|
3
|
+
- expose
|
|
4
|
+
- build
|
|
5
|
+
- deploy
|
|
6
|
+
|
|
7
|
+
variables:
|
|
8
|
+
USAFCAL_TEST_IMAGE: "bright"
|
|
9
|
+
|
|
10
|
+
.base_job:
|
|
11
|
+
before_script:
|
|
12
|
+
- pip install -e .[dev]
|
|
13
|
+
|
|
14
|
+
rules:
|
|
15
|
+
- if: $CI_COMMIT_TAG
|
|
16
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
17
|
+
- if: $CI_PIPELINE_SOURCE == "web"
|
|
18
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
19
|
+
- when: never
|
|
20
|
+
|
|
21
|
+
ruff:
|
|
22
|
+
extends: .base_job
|
|
23
|
+
stage: test
|
|
24
|
+
image: "python:3.11"
|
|
25
|
+
script:
|
|
26
|
+
- ruff format --diff
|
|
27
|
+
- ruff check
|
|
28
|
+
|
|
29
|
+
mypy:
|
|
30
|
+
extends: .base_job
|
|
31
|
+
stage: test
|
|
32
|
+
image: "python:3.11"
|
|
33
|
+
script:
|
|
34
|
+
- mypy micat
|
|
35
|
+
|
|
36
|
+
spelling:
|
|
37
|
+
extends: .base_job
|
|
38
|
+
stage: test
|
|
39
|
+
image: "python:3.11"
|
|
40
|
+
script:
|
|
41
|
+
- codespell .
|
|
42
|
+
|
|
43
|
+
build-docs:
|
|
44
|
+
extends: .base_job
|
|
45
|
+
image: "python:3.11"
|
|
46
|
+
stage: build
|
|
47
|
+
script:
|
|
48
|
+
- pdoc --math micat -o public
|
|
49
|
+
- echo "JOB_ID=$CI_JOB_ID" > build-docs.env
|
|
50
|
+
artifacts:
|
|
51
|
+
expire_in: 1 week
|
|
52
|
+
name: "${CI_PROJECT_NAME}-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHORT_SHA}-docs"
|
|
53
|
+
paths:
|
|
54
|
+
- public
|
|
55
|
+
reports:
|
|
56
|
+
dotenv: build-docs.env
|
|
57
|
+
|
|
58
|
+
# This exposes a link to the built docs. For example in merge requests.
|
|
59
|
+
environment:
|
|
60
|
+
name: review/$CI_COMMIT_REF_SLUG
|
|
61
|
+
url: https://openflexure.gitlab.io/-/micat/-/jobs/$JOB_ID/artifacts/public/index.html
|
|
62
|
+
|
|
63
|
+
usafcal-run:
|
|
64
|
+
extends: .base_job
|
|
65
|
+
stage: test
|
|
66
|
+
image: "python:3.11"
|
|
67
|
+
|
|
68
|
+
script:
|
|
69
|
+
- mkdir -p outputs/result
|
|
70
|
+
- micat usafcal tests/assets/${USAFCAL_TEST_IMAGE}.jpeg --outdir outputs/result
|
|
71
|
+
- mv outputs/result/${USAFCAL_TEST_IMAGE}_USAF_calibration.pdf outputs/result/USAF_calibration.pdf
|
|
72
|
+
- mv outputs/result/${USAFCAL_TEST_IMAGE}_USAF_calibration.yaml outputs/result/USAF_calibration.yaml
|
|
73
|
+
|
|
74
|
+
artifacts:
|
|
75
|
+
when: always
|
|
76
|
+
expire_in: 1 week
|
|
77
|
+
paths:
|
|
78
|
+
- outputs/result/*.pdf
|
|
79
|
+
- outputs/result/*.yaml
|
|
80
|
+
|
|
81
|
+
# Create small image for artifact exposing
|
|
82
|
+
.expose_base:
|
|
83
|
+
stage: expose
|
|
84
|
+
image: alpine:latest
|
|
85
|
+
before_script: []
|
|
86
|
+
script:
|
|
87
|
+
- echo "Exposing artifacts for MR visibility"
|
|
88
|
+
needs:
|
|
89
|
+
- job: usafcal-run
|
|
90
|
+
artifacts: true
|
|
91
|
+
rules:
|
|
92
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
93
|
+
- when: never
|
|
94
|
+
|
|
95
|
+
usafcal-pdf:
|
|
96
|
+
extends: .expose_base
|
|
97
|
+
artifacts:
|
|
98
|
+
expose_as: "Calibration PDF"
|
|
99
|
+
paths:
|
|
100
|
+
- outputs/result/USAF_calibration.pdf
|
|
101
|
+
|
|
102
|
+
usafcal-yaml:
|
|
103
|
+
extends: .expose_base
|
|
104
|
+
artifacts:
|
|
105
|
+
expose_as: "Calibration YAML"
|
|
106
|
+
paths:
|
|
107
|
+
- outputs/result/USAF_calibration.yaml
|
|
108
|
+
|
|
109
|
+
usafcal-e2e:
|
|
110
|
+
extends: .base_job
|
|
111
|
+
stage: test
|
|
112
|
+
image: "python:3.11"
|
|
113
|
+
|
|
114
|
+
script:
|
|
115
|
+
- echo "Running Micat E2E calibration test"
|
|
116
|
+
- python tests/end_to_end/e2e.py
|
|
117
|
+
|
|
118
|
+
# Deploy jobs don't inherit from .base_job as they run at different times.
|
|
119
|
+
pages:
|
|
120
|
+
dependencies:
|
|
121
|
+
- build-docs
|
|
122
|
+
needs:
|
|
123
|
+
- build-docs
|
|
124
|
+
stage: deploy
|
|
125
|
+
image: "python:3.11"
|
|
126
|
+
script:
|
|
127
|
+
# Not much to do as the files are already built and in public.
|
|
128
|
+
- echo "Deploying"
|
|
129
|
+
artifacts:
|
|
130
|
+
paths:
|
|
131
|
+
- public
|
|
132
|
+
rules:
|
|
133
|
+
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
|
|
134
|
+
- when: never
|
|
135
|
+
|
|
136
|
+
pypi-publish:
|
|
137
|
+
image: "python:3.11"
|
|
138
|
+
stage: deploy
|
|
139
|
+
id_tokens:
|
|
140
|
+
PYPI_ID_TOKEN:
|
|
141
|
+
aud: pypi
|
|
142
|
+
rules:
|
|
143
|
+
- if: $CI_COMMIT_TAG =~ /^v\d+\.\d+\.\d+$/
|
|
144
|
+
- when: never
|
|
145
|
+
before_script:
|
|
146
|
+
- pip install -e .[dev]
|
|
147
|
+
script:
|
|
148
|
+
- python -m build
|
|
149
|
+
- twine upload dist/*
|
|
150
|
+
artifacts:
|
|
151
|
+
paths:
|
|
152
|
+
- dist/*.whl
|
|
153
|
+
- dist/*.tar.gz
|