zptess 6.1.2__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.
- zptess-6.1.2/.gitignore +19 -0
- zptess-6.1.2/.python-version +1 -0
- zptess-6.1.2/LICENSE +21 -0
- zptess-6.1.2/PKG-INFO +25 -0
- zptess-6.1.2/README.md +0 -0
- zptess-6.1.2/TODO +7 -0
- zptess-6.1.2/doc/image/about.png +0 -0
- zptess-6.1.2/doc/image/main.png +0 -0
- zptess-6.1.2/justfile +290 -0
- zptess-6.1.2/pyproject.toml +74 -0
- zptess-6.1.2/scripts/zp-db-fix-src +177 -0
- zptess-6.1.2/setup.cfg +4 -0
- zptess-6.1.2/src/zptess/__init__.py +12 -0
- zptess-6.1.2/src/zptess/_version.py +34 -0
- zptess-6.1.2/src/zptess/cli/__init__.py +0 -0
- zptess-6.1.2/src/zptess/cli/calibrate.py +292 -0
- zptess-6.1.2/src/zptess/cli/reader.py +182 -0
- zptess-6.1.2/src/zptess/cli/tools.py +206 -0
- zptess-6.1.2/src/zptess/cli/util/__init__.py +0 -0
- zptess-6.1.2/src/zptess/cli/util/misc.py +91 -0
- zptess-6.1.2/src/zptess/cli/util/parser.py +355 -0
- zptess-6.1.2/src/zptess/cli/util/validator.py +88 -0
- zptess-6.1.2/src/zptess/cli/writer.py +107 -0
- zptess-6.1.2/src/zptess/constants.py +27 -0
- zptess-6.1.2/src/zptess/controller/__init__.py +16 -0
- zptess-6.1.2/src/zptess/controller/batch/__init__.py +22 -0
- zptess-6.1.2/src/zptess/controller/batch/batch.py +224 -0
- zptess-6.1.2/src/zptess/controller/exporter.py +406 -0
- zptess-6.1.2/src/zptess/controller/photometer/__init__.py +19 -0
- zptess-6.1.2/src/zptess/controller/photometer/base.py +186 -0
- zptess-6.1.2/src/zptess/controller/photometer/persistent.py +302 -0
- zptess-6.1.2/src/zptess/controller/photometer/reader.py +73 -0
- zptess-6.1.2/src/zptess/controller/photometer/ring.py +111 -0
- zptess-6.1.2/src/zptess/controller/photometer/types.py +29 -0
- zptess-6.1.2/src/zptess/controller/photometer/util.py +25 -0
- zptess-6.1.2/src/zptess/controller/photometer/volatile.py +268 -0
- zptess-6.1.2/src/zptess/controller/photometer/writer.py +71 -0
- zptess-6.1.2/src/zptess/dao.py +5 -0
- zptess-6.1.2/src/zptess.egg-info/PKG-INFO +25 -0
- zptess-6.1.2/src/zptess.egg-info/SOURCES.txt +43 -0
- zptess-6.1.2/src/zptess.egg-info/dependency_links.txt +1 -0
- zptess-6.1.2/src/zptess.egg-info/entry_points.txt +5 -0
- zptess-6.1.2/src/zptess.egg-info/requires.txt +6 -0
- zptess-6.1.2/src/zptess.egg-info/top_level.txt +1 -0
- zptess-6.1.2/uv.lock +763 -0
zptess-6.1.2/.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
zptess-6.1.2/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 astrorafael@gmail.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
zptess-6.1.2/PKG-INFO
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: zptess
|
|
3
|
+
Version: 6.1.2
|
|
4
|
+
Summary: TESS-W Calibration tool
|
|
5
|
+
Author-email: Rafael González <rafael08@ucm.es>
|
|
6
|
+
Project-URL: Homepage, https://github.com/astrorafael/textual-zptess
|
|
7
|
+
Project-URL: Repository, https://github.com/astrorafael/textual-zptess.git
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Environment :: Console
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
14
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
15
|
+
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
|
|
16
|
+
Requires-Python: >=3.12
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Requires-Dist: python-decouple>=3.8
|
|
20
|
+
Requires-Dist: typing-extensions>=4.12
|
|
21
|
+
Requires-Dist: zptess-dao>=1.0
|
|
22
|
+
Requires-Dist: pypubsub>=4.0
|
|
23
|
+
Requires-Dist: lica[photometer,tabular]>=1.2
|
|
24
|
+
Requires-Dist: aiohttp>=3.11
|
|
25
|
+
Dynamic: license-file
|
zptess-6.1.2/README.md
ADDED
|
File without changes
|
zptess-6.1.2/TODO
ADDED
|
Binary file
|
|
Binary file
|
zptess-6.1.2/justfile
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# To install just on a per-project basis
|
|
2
|
+
# 1. Activate your virtual environemnt
|
|
3
|
+
# 2. uv add --dev rust-just
|
|
4
|
+
# 3. Use just within the activated environment
|
|
5
|
+
|
|
6
|
+
drive_uuid := "77688511-78c5-4de3-9108-b631ff823ef4"
|
|
7
|
+
user := file_stem(home_dir())
|
|
8
|
+
def_drive := join("/media", user, drive_uuid)
|
|
9
|
+
project := file_stem(justfile_dir())
|
|
10
|
+
local_env := join(justfile_dir(), ".env")
|
|
11
|
+
|
|
12
|
+
# list all recipes
|
|
13
|
+
default:
|
|
14
|
+
just --list
|
|
15
|
+
|
|
16
|
+
# Install tools globally
|
|
17
|
+
tools:
|
|
18
|
+
uv tool install twine
|
|
19
|
+
uv tool install ruff
|
|
20
|
+
|
|
21
|
+
# Add conveniente development dependencies
|
|
22
|
+
dev:
|
|
23
|
+
uv add --dev pytest
|
|
24
|
+
|
|
25
|
+
# Build the package
|
|
26
|
+
build:
|
|
27
|
+
rm -fr dist/*
|
|
28
|
+
uv build
|
|
29
|
+
|
|
30
|
+
# Publish the package to PyPi
|
|
31
|
+
publish pkg="zptess": build
|
|
32
|
+
twine upload -r pypi dist/*
|
|
33
|
+
uv run --no-project --with {{pkg}} --refresh-package {{pkg}} \
|
|
34
|
+
-- python -c "from {{pkg}} import __version__; print(__version__)"
|
|
35
|
+
|
|
36
|
+
# Publish to Test PyPi server
|
|
37
|
+
test-publish pkg="zptess": build
|
|
38
|
+
twine upload --verbose -r testpypi dist/*
|
|
39
|
+
uv run --no-project --with {{pkg}} --refresh-package {{pkg}} \
|
|
40
|
+
--index-url https://test.pypi.org/simple/ \
|
|
41
|
+
--extra-index-url https://pypi.org/simple/ \
|
|
42
|
+
-- python -c "from {{pkg}} import __version__; print(__version__)"
|
|
43
|
+
|
|
44
|
+
# Adds lica source library as dependency. 'version' may be a tag or branch
|
|
45
|
+
lica-dev version="main":
|
|
46
|
+
#!/usr/bin/env bash
|
|
47
|
+
set -exuo pipefail
|
|
48
|
+
echo "Removing previous LICA dependency"
|
|
49
|
+
uv add aiohttp pyserial-asyncio aioserial tabulate
|
|
50
|
+
uv remove lica || echo "Ignoring non existing LICA library";
|
|
51
|
+
if [[ "{{ version }}" =~ [0-9]+\.[0-9]+\.[0-9]+ ]]; then
|
|
52
|
+
echo "Adding LICA source library --tag {{ version }}";
|
|
53
|
+
uv add git+https://github.com/guaix-ucm/lica --tag {{ version }};
|
|
54
|
+
else
|
|
55
|
+
echo "Adding LICA source library --branch {{ version }}";
|
|
56
|
+
uv add git+https://github.com/guaix-ucm/lica --branch {{ version }};
|
|
57
|
+
fi
|
|
58
|
+
|
|
59
|
+
# Adds lica release library as dependency with a given version
|
|
60
|
+
lica-rel version:
|
|
61
|
+
#!/usr/bin/env bash
|
|
62
|
+
set -exuo pipefail
|
|
63
|
+
echo "Removing previous LICA dependency"
|
|
64
|
+
uv remove lica
|
|
65
|
+
echo "Adding release version of LICA library";
|
|
66
|
+
uv add --refresh-package lica lica[photometer,tabular];
|
|
67
|
+
uv remove aiohttp aioserial pyserial-asyncio tabulate
|
|
68
|
+
|
|
69
|
+
# Backup .env to storage unit
|
|
70
|
+
env-bak drive=def_drive: (check_mnt drive) (env-backup join(drive, "env", project))
|
|
71
|
+
|
|
72
|
+
# Restore .env from storage unit
|
|
73
|
+
env-rst drive=def_drive: (check_mnt drive) (env-restore join(drive, "env", project))
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# ========================= #
|
|
77
|
+
# QUCK COMMAND LINE TESTING #
|
|
78
|
+
# ========================= #
|
|
79
|
+
|
|
80
|
+
# Writes new zero point to photometer
|
|
81
|
+
test-write zp verbose="" trace="":
|
|
82
|
+
#!/usr/bin/env bash
|
|
83
|
+
set -euxo pipefail
|
|
84
|
+
uv run zp-write --console {{verbose}} {{trace}} test -z {{zp}}
|
|
85
|
+
|
|
86
|
+
# Reads test/ref/both photometers
|
|
87
|
+
test-read verbose="" trace="" which="test" N="10" :
|
|
88
|
+
#!/usr/bin/env bash
|
|
89
|
+
set -euxo pipefail
|
|
90
|
+
uv run zp-read --console {{verbose}} {{trace}} {{which}} -N {{N}}
|
|
91
|
+
|
|
92
|
+
# Calibrate photometer
|
|
93
|
+
test-calib verbose="" trace="" persist="":
|
|
94
|
+
#!/usr/bin/env bash
|
|
95
|
+
set -euxo pipefail
|
|
96
|
+
uv run zp-calib --console {{verbose}} {{trace}} test -b 9 -R 3 -P 5 {{persist}}
|
|
97
|
+
|
|
98
|
+
# Open a new batch
|
|
99
|
+
test-open verbose="" trace="":
|
|
100
|
+
#!/usr/bin/env bash
|
|
101
|
+
set -euxo pipefail
|
|
102
|
+
uv run zp-batch --console {{verbose}} {{trace}} begin
|
|
103
|
+
|
|
104
|
+
# Close current open batch
|
|
105
|
+
test-close verbose="" trace="":
|
|
106
|
+
#!/usr/bin/env bash
|
|
107
|
+
set -euxo pipefail
|
|
108
|
+
uv run zp-batch --console {{verbose}} {{trace}} end
|
|
109
|
+
|
|
110
|
+
# Close current open batch
|
|
111
|
+
test-purge verbose="" trace="":
|
|
112
|
+
#!/usr/bin/env bash
|
|
113
|
+
set -euxo pipefail
|
|
114
|
+
uv run zp-batch --console {{verbose}} {{trace}} purge
|
|
115
|
+
|
|
116
|
+
# See orphan calibrations not within a batch
|
|
117
|
+
test-orphan verbose="" trace="":
|
|
118
|
+
#!/usr/bin/env bash
|
|
119
|
+
set -euxo pipefail
|
|
120
|
+
uv run zp-batch --console {{verbose}} {{trace}} orphan
|
|
121
|
+
|
|
122
|
+
# Close current open batch
|
|
123
|
+
test-view verbose="" trace="":
|
|
124
|
+
#!/usr/bin/env bash
|
|
125
|
+
set -euxo pipefail
|
|
126
|
+
uv run zp-batch --console {{verbose}} {{trace}} view
|
|
127
|
+
|
|
128
|
+
# Export latest batch
|
|
129
|
+
test-export-latest verbose="" trace="":
|
|
130
|
+
#!/usr/bin/env bash
|
|
131
|
+
set -euxo pipefail
|
|
132
|
+
uv run zp-batch --console {{verbose}} {{trace}} export --latest
|
|
133
|
+
|
|
134
|
+
# Export latest batch and send email
|
|
135
|
+
test-export-email verbose="" trace="":
|
|
136
|
+
#!/usr/bin/env bash
|
|
137
|
+
set -euxo pipefail
|
|
138
|
+
uv run zp-batch --console {{verbose}} {{trace}} export --latest --email
|
|
139
|
+
|
|
140
|
+
# Export all summaries
|
|
141
|
+
test-export-all verbose="" trace="":
|
|
142
|
+
#!/usr/bin/env bash
|
|
143
|
+
set -euxo pipefail
|
|
144
|
+
uv run zp-batch --console {{verbose}} {{trace}} export --all
|
|
145
|
+
|
|
146
|
+
# =======================================================================
|
|
147
|
+
# DAY TO DAY CALIBRATION MANAGEMENT RECIPES
|
|
148
|
+
#
|
|
149
|
+
# Copy these recipes into a separate justfile and run all
|
|
150
|
+
# calibration-related task from there
|
|
151
|
+
# =======================================================================
|
|
152
|
+
|
|
153
|
+
# Open a new batch
|
|
154
|
+
open:
|
|
155
|
+
#!/usr/bin/env bash
|
|
156
|
+
set -euxo pipefail
|
|
157
|
+
uv run zp-batch --console --log-file zptool.log --trace begin
|
|
158
|
+
|
|
159
|
+
# Close current open batch
|
|
160
|
+
close verbose="" trace="":
|
|
161
|
+
#!/usr/bin/env bash
|
|
162
|
+
set -euxo pipefail
|
|
163
|
+
uv run zp-batch --console --log-file zptool.log --trace end
|
|
164
|
+
|
|
165
|
+
# Reads [test|ref|both] photometers N times
|
|
166
|
+
read which="both" N="10" :
|
|
167
|
+
#!/usr/bin/env bash
|
|
168
|
+
set -euxo pipefail
|
|
169
|
+
uv run zp-read --console --log-file zptess.log --trace {{which}} -N {{N}}
|
|
170
|
+
|
|
171
|
+
# manually write a new zero point to a photometer
|
|
172
|
+
write zp dry_run="":
|
|
173
|
+
#!/usr/bin/env bash
|
|
174
|
+
set -euxo pipefail
|
|
175
|
+
uv run zp-write --console --log-file zptess.log --trace test -z {{zp}} {{dry_run}}
|
|
176
|
+
|
|
177
|
+
# Display photometer info and quit
|
|
178
|
+
info:
|
|
179
|
+
#!/usr/bin/env bash
|
|
180
|
+
set -euxo pipefail
|
|
181
|
+
uv run zp-calib --console --log-file zptess.log --trace test --info
|
|
182
|
+
|
|
183
|
+
# Calibrate a new photometer, but don't write new ZP nor update database
|
|
184
|
+
dry-run:
|
|
185
|
+
#!/usr/bin/env bash
|
|
186
|
+
set -euxo pipefail
|
|
187
|
+
uv run zp-calib --console --log-file zptess.log --trace test
|
|
188
|
+
|
|
189
|
+
# Calibrate a new photometer and stores results in database
|
|
190
|
+
calib:
|
|
191
|
+
#!/usr/bin/env bash
|
|
192
|
+
set -euxo pipefail
|
|
193
|
+
uv run zp-calib --console --log-file zptess.log --trace test --update --persist
|
|
194
|
+
|
|
195
|
+
# Export all summaries
|
|
196
|
+
summary:
|
|
197
|
+
#!/usr/bin/env bash
|
|
198
|
+
set -euxo pipefail
|
|
199
|
+
uv run zp-batch --console --log-file zptool.log --trace export --all
|
|
200
|
+
|
|
201
|
+
# Export latest batch and send email
|
|
202
|
+
export:
|
|
203
|
+
#!/usr/bin/env bash
|
|
204
|
+
set -euxo pipefail
|
|
205
|
+
uv run zp-batch --console --log-file zptool.log --trace export --latest --email
|
|
206
|
+
|
|
207
|
+
# See orphan calibrations not within a batch
|
|
208
|
+
orphan verbose="" trace="":
|
|
209
|
+
#!/usr/bin/env bash
|
|
210
|
+
set -euxo pipefail
|
|
211
|
+
uv run zp-batch --console --trace orphan
|
|
212
|
+
|
|
213
|
+
# Close current open batch
|
|
214
|
+
view verbose="" trace="":
|
|
215
|
+
#!/usr/bin/env bash
|
|
216
|
+
set -euxo pipefail
|
|
217
|
+
uv run zp-batch --console --trace view
|
|
218
|
+
|
|
219
|
+
# Close current open batch
|
|
220
|
+
purge:
|
|
221
|
+
#!/usr/bin/env bash
|
|
222
|
+
set -euxo pipefail
|
|
223
|
+
uv run zp-batch --console --log-file zptool.log --trace purge
|
|
224
|
+
|
|
225
|
+
# Backup zptess database and log file
|
|
226
|
+
backup drive=def_drive: (check_mnt drive)
|
|
227
|
+
#!/usr/bin/env bash
|
|
228
|
+
set -exuo pipefail
|
|
229
|
+
bak_dir={{ join(drive, "zptess") }}
|
|
230
|
+
[ ! -d "${bak_dir}" ] && mkdir -p ${bak_dir}
|
|
231
|
+
cp .env ${bak_dir}
|
|
232
|
+
cp zptess.db ${bak_dir}
|
|
233
|
+
cp zptess.log ${bak_dir}
|
|
234
|
+
cp zptool.log ${bak_dir}
|
|
235
|
+
cp zpdbase.log ${bak_dir}
|
|
236
|
+
cp justfile ${bak_dir}
|
|
237
|
+
|
|
238
|
+
# Restore zptess database and log file
|
|
239
|
+
restore drive=def_drive: (check_mnt drive)
|
|
240
|
+
#!/usr/bin/env bash
|
|
241
|
+
set -exuo pipefail
|
|
242
|
+
bak_dir={{ join(drive, "zptess") }}
|
|
243
|
+
cp .env ${bak_dir}/.env .
|
|
244
|
+
cp ${bak_dir}/zptess.db .
|
|
245
|
+
cp ${bak_dir}/zptool.log .
|
|
246
|
+
cp ${bak_dir}/zpdbase.log .
|
|
247
|
+
cp ${bak_dir}/justfile .
|
|
248
|
+
|
|
249
|
+
# =======================================================================
|
|
250
|
+
|
|
251
|
+
[private]
|
|
252
|
+
db-restore date:
|
|
253
|
+
#!/usr/bin/env bash
|
|
254
|
+
set -exuo pipefail
|
|
255
|
+
cp {{ def_drive }}/zptess/zptess-{{date}}.db zptess.prod.db
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
[private]
|
|
259
|
+
check_mnt mnt:
|
|
260
|
+
#!/usr/bin/env bash
|
|
261
|
+
set -euo pipefail
|
|
262
|
+
if [[ ! -d {{ mnt }} ]]; then
|
|
263
|
+
echo "Drive not mounted: {{ mnt }}"
|
|
264
|
+
exit 1
|
|
265
|
+
fi
|
|
266
|
+
|
|
267
|
+
[private]
|
|
268
|
+
env-backup bak_dir:
|
|
269
|
+
#!/usr/bin/env bash
|
|
270
|
+
set -exuo pipefail
|
|
271
|
+
if [[ ! -f {{ local_env }} ]]; then
|
|
272
|
+
echo "Can't backup: {{ local_env }} doesn't exists"
|
|
273
|
+
exit 1
|
|
274
|
+
fi
|
|
275
|
+
mkdir -p {{ bak_dir }}
|
|
276
|
+
cp {{ local_env }} {{ bak_dir }}
|
|
277
|
+
cp zptess.prod.db {{ bak_dir }}
|
|
278
|
+
cp zptess.db {{ bak_dir }}
|
|
279
|
+
|
|
280
|
+
[private]
|
|
281
|
+
env-restore bak_dir:
|
|
282
|
+
#!/usr/bin/env bash
|
|
283
|
+
set -euxo pipefail
|
|
284
|
+
if [[ ! -f {{ bak_dir }}/.env ]]; then
|
|
285
|
+
echo "Can't restore: {{ bak_dir }}/.env doesn't exists"
|
|
286
|
+
exit 1
|
|
287
|
+
fi
|
|
288
|
+
cp {{ bak_dir }}/.env {{ local_env }}
|
|
289
|
+
cp {{ bak_dir }}/zptess.prod.db .
|
|
290
|
+
cp {{ bak_dir }}/zptess.db .
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "zptess"
|
|
3
|
+
dynamic = ["version"]
|
|
4
|
+
description = "TESS-W Calibration tool"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
license-files = ["LICENSE"]
|
|
8
|
+
authors = [
|
|
9
|
+
{name = "Rafael González", email = "rafael08@ucm.es"},
|
|
10
|
+
]
|
|
11
|
+
classifiers = [
|
|
12
|
+
"Programming Language :: Python :: 3.12",
|
|
13
|
+
"Programming Language :: Python :: 3.13",
|
|
14
|
+
"Development Status :: 3 - Alpha",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Science/Research",
|
|
17
|
+
"Operating System :: POSIX :: Linux",
|
|
18
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
19
|
+
"Topic :: Scientific/Engineering :: Atmospheric Science",
|
|
20
|
+
]
|
|
21
|
+
dependencies = [
|
|
22
|
+
"python-decouple >= 3.8", # Get info from enviromental variables
|
|
23
|
+
"typing-extensions >= 4.12", # Self for Python < 3.11
|
|
24
|
+
"zptess-dao >= 1.0", # Own database model
|
|
25
|
+
#'exceptiongroups', # For Python < 3.11 when using TaskGroups
|
|
26
|
+
#'asyncstdlib', # async counterparts such as aenumerate()
|
|
27
|
+
# synchronous style publish/subscribe mechanism
|
|
28
|
+
"pypubsub >= 4.0",
|
|
29
|
+
"lica[photometer,tabular]>=1.2",
|
|
30
|
+
"aiohttp >= 3.11",
|
|
31
|
+
]
|
|
32
|
+
|
|
33
|
+
[project.urls]
|
|
34
|
+
Homepage = "https://github.com/astrorafael/textual-zptess"
|
|
35
|
+
Repository = "https://github.com/astrorafael/textual-zptess.git"
|
|
36
|
+
|
|
37
|
+
[project.scripts]
|
|
38
|
+
# These are photometer related commands
|
|
39
|
+
zp-read = "zptess.cli.reader:main"
|
|
40
|
+
zp-calib = "zptess.cli.calibrate:main"
|
|
41
|
+
zp-write = "zptess.cli.writer:main"
|
|
42
|
+
# Additional tools
|
|
43
|
+
zp-batch = "zptess.cli.tools:main"
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
[build-system]
|
|
47
|
+
requires = ["setuptools >= 78.1", "wheel", "setuptools_scm[toml]>=8.2"]
|
|
48
|
+
build-backend = "setuptools.build_meta"
|
|
49
|
+
|
|
50
|
+
# pyproject.toml
|
|
51
|
+
# Automatically generates a _version-py file from with Git information
|
|
52
|
+
# This file shold be placed in .gitignore
|
|
53
|
+
[tool.setuptools_scm]
|
|
54
|
+
write_to = "src/zptess/_version.py"
|
|
55
|
+
|
|
56
|
+
[tool.setuptools.packages.find]
|
|
57
|
+
# scanning for namespace packages is true by default in pyproject.toml, so
|
|
58
|
+
# you do NOT need to include the following line.
|
|
59
|
+
namespaces = true
|
|
60
|
+
where = ["src"]
|
|
61
|
+
|
|
62
|
+
[tool.setuptools]
|
|
63
|
+
script-files = [
|
|
64
|
+
"scripts/zp-db-fix-src"
|
|
65
|
+
]
|
|
66
|
+
|
|
67
|
+
[tool.ruff]
|
|
68
|
+
line-length = 100
|
|
69
|
+
|
|
70
|
+
[tool.uv]
|
|
71
|
+
dev-dependencies = [
|
|
72
|
+
"pytest>=8.3.3",
|
|
73
|
+
"mypy>=1.15.0",
|
|
74
|
+
]
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
# Fixes all little inconsistent data
|
|
5
|
+
# This script is meant to be executed once, with all the inconsistencies.
|
|
6
|
+
# and changes to be made in the source production database before the migration process.
|
|
7
|
+
#
|
|
8
|
+
# We monitor the changes with SELECT name,session,comment FROM summary_t WHERE comment IS NOT NULL ORDER BY session, name;
|
|
9
|
+
|
|
10
|
+
if test -f .env; then
|
|
11
|
+
source .env
|
|
12
|
+
else
|
|
13
|
+
echo "No environemnt variables file found. Exiting"
|
|
14
|
+
exit 255
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
DATABASE=${1:-${SOURCE_DATABASE}}
|
|
18
|
+
|
|
19
|
+
echo "Applying database fixes before migration."
|
|
20
|
+
sqlite3 ${DATABASE} <<EOF
|
|
21
|
+
.echo on
|
|
22
|
+
BEGIN;
|
|
23
|
+
|
|
24
|
+
----------------------
|
|
25
|
+
-- Purge empty batches
|
|
26
|
+
----------------------
|
|
27
|
+
|
|
28
|
+
DELETE FROM batch_t WHERE calibrations = 0;
|
|
29
|
+
|
|
30
|
+
--------------------------------------------------------------
|
|
31
|
+
-- Fix zptess bug: 20.44 => 20.50 as ficticious ZP in rounds_t
|
|
32
|
+
--------------------------------------------------------------
|
|
33
|
+
|
|
34
|
+
UPDATE summary_t SET mag = mag + 0.06
|
|
35
|
+
WHERE session IN (SELECT DISTINCT session from rounds_t WHERE zp_fict = 20.44);
|
|
36
|
+
|
|
37
|
+
UPDATE rounds_t SET zp_fict = 20.50 WHERE zp_fict = 20.44;
|
|
38
|
+
|
|
39
|
+
-------------------------------
|
|
40
|
+
-- Fix collector info weirdness
|
|
41
|
+
-------------------------------
|
|
42
|
+
|
|
43
|
+
UPDATE summary_t SET collector = 'standard'
|
|
44
|
+
WHERE collector LIKE 'Sí%' OR collector LIKE 'Si%';
|
|
45
|
+
|
|
46
|
+
-------------------------------------------------------
|
|
47
|
+
-- Fix a bunch of comment updates with the same pattern
|
|
48
|
+
-------------------------------------------------------
|
|
49
|
+
|
|
50
|
+
UPDATE summary_t SET collector = 'standard'
|
|
51
|
+
WHERE collector LIKE 'Sí%' OR collector LIKE 'Si%';
|
|
52
|
+
|
|
53
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
54
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
55
|
+
AND comment LIKE 'Updated with tessdb MAC%';
|
|
56
|
+
|
|
57
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
58
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
59
|
+
AND comment LIKE 'MAC de tessdb%';
|
|
60
|
+
|
|
61
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
62
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
63
|
+
AND comment LIKE 'calibrado por Cristobal%';
|
|
64
|
+
|
|
65
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
66
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
67
|
+
AND comment LIKE 'reparado por Cristobal y recalibrado%';
|
|
68
|
+
|
|
69
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
70
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
71
|
+
AND comment LIKE 'recalibrado';
|
|
72
|
+
|
|
73
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
74
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
75
|
+
AND comment LIKE 'recalibrado, calibracion anterior manual%';
|
|
76
|
+
|
|
77
|
+
UPDATE summary_t SET comment = 'PhotSumm: ' || comment
|
|
78
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'PhotSumm:%' -- makes it retryable
|
|
79
|
+
AND comment LIKE 'reparado y recalibrado (nueva MAC)%';
|
|
80
|
+
|
|
81
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
82
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
83
|
+
AND comment LIKE 'recalibrado, no se tienen datos de calibracion anterior%';
|
|
84
|
+
|
|
85
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
86
|
+
WHERE comment IS NOT NULL AND comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
87
|
+
AND comment LIKE 'Entrada%';
|
|
88
|
+
|
|
89
|
+
--------------------------------------------------------------
|
|
90
|
+
-- Fix individual photometers to add Photometer level comments
|
|
91
|
+
--------------------------------------------------------------
|
|
92
|
+
|
|
93
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
94
|
+
WHERE comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
95
|
+
AND name = 'stars3' AND session = '1000-01-01T00:00:00';
|
|
96
|
+
|
|
97
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
98
|
+
WHERE comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
99
|
+
AND name = 'stars8' AND session = '1000-01-01T00:07:00';
|
|
100
|
+
|
|
101
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
102
|
+
WHERE comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
103
|
+
AND name = 'stars15' AND session = '1000-01-01T00:14:00';
|
|
104
|
+
|
|
105
|
+
UPDATE summary_t SET comment = 'Phot: ' || comment
|
|
106
|
+
WHERE comment NOT LIKE 'Phot:%' -- makes it retryable
|
|
107
|
+
AND name = 'stars17' AND session = '1000-01-01T00:16:00';
|
|
108
|
+
|
|
109
|
+
-----------------------------------------------------------
|
|
110
|
+
-- Fix individual photometers to add Summary level comments
|
|
111
|
+
-----------------------------------------------------------
|
|
112
|
+
|
|
113
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
114
|
+
WHERE comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
115
|
+
AND name = 'stars315' AND session = '1000-01-01T03:28:00';
|
|
116
|
+
|
|
117
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
118
|
+
WHERE comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
119
|
+
AND name = 'stars737' AND session = '1000-01-01T04:14:00';
|
|
120
|
+
|
|
121
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
122
|
+
WHERE comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
123
|
+
AND name = 'stars1261' AND session = '2024-01-10T12:14:56';
|
|
124
|
+
|
|
125
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
126
|
+
WHERE comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
127
|
+
AND name = 'stars1293' AND session = '2024-05-07T10:10:40';
|
|
128
|
+
|
|
129
|
+
UPDATE summary_t SET comment = 'Summ: ' || comment
|
|
130
|
+
WHERE comment NOT LIKE 'Summ:%' -- makes it retryable
|
|
131
|
+
AND name = 'stars1277' AND session = '2024-05-08T08:20:12';
|
|
132
|
+
|
|
133
|
+
UPDATE summary_t SET comment = NULL
|
|
134
|
+
WHERE comment IS NOT NULL
|
|
135
|
+
AND comment NOT IN
|
|
136
|
+
(SELECT comment FROM summary_t
|
|
137
|
+
WHERE comment LIKE 'Phot:%'
|
|
138
|
+
OR comment LIKE 'Summ:%' OR comment LIKE 'PhotSumm:%');
|
|
139
|
+
|
|
140
|
+
--------------------------------------
|
|
141
|
+
-- Fix photometer duplicate rows error
|
|
142
|
+
--------------------------------------
|
|
143
|
+
|
|
144
|
+
UPDATE summary_t
|
|
145
|
+
SET firmware = 'May 19 2016' , filter = 'UV/IR-740', plug = 'USB-A+serial', box = 'Caja plastico antigua', collector = 'standard', comment = 'PhotSumm: Fotometro de referencia. 20.44 es el ZP para que sus lecturas coincidan con un Unihedron SQM'
|
|
146
|
+
WHERE name = 'stars3';
|
|
147
|
+
|
|
148
|
+
UPDATE summary_t
|
|
149
|
+
SET comment = (SELECT comment from summary_t WHERE name = 'stars222' AND COMMENT IS NOT NULL)
|
|
150
|
+
WHERE name = 'stars222' AND comment IS NULL;
|
|
151
|
+
|
|
152
|
+
UPDATE summary_t
|
|
153
|
+
SET comment = (SELECT comment from summary_t WHERE name = 'stars300' AND COMMENT IS NOT NULL)
|
|
154
|
+
WHERE name = 'stars300' AND comment IS NULL;
|
|
155
|
+
|
|
156
|
+
UPDATE summary_t
|
|
157
|
+
SET comment = 'PhotSumm: MAC de tessdb (Rafa, 2023-09-21). Originalmente tenia esa pero ha sido renombrado 3 veces mas. Reparado y recalibrado (nueva MAC)'
|
|
158
|
+
WHERE name = 'stars292'
|
|
159
|
+
AND (comment LIKE 'Phot: %' OR COMMENT LIKE 'PhotSumm: %');
|
|
160
|
+
|
|
161
|
+
UPDATE summary_t
|
|
162
|
+
SET comment = 'PhotSumm: MAC de tessdb (Rafa, 2023-09-21). Reparado y recalibrado (nueva MAC)'
|
|
163
|
+
WHERE name = 'stars293'
|
|
164
|
+
AND (comment LIKE 'Phot: %' OR COMMENT LIKE 'PhotSumm: %');
|
|
165
|
+
|
|
166
|
+
UPDATE summary_t
|
|
167
|
+
SET comment = 'PhotSumm: MAC de tessdb (Rafa, 2023-09-21). Reparado y recalibrado por Cristobal'
|
|
168
|
+
WHERE name = 'stars241'
|
|
169
|
+
AND (comment LIKE 'Phot: %' OR COMMENT LIKE 'Summ: %');
|
|
170
|
+
|
|
171
|
+
UPDATE summary_t
|
|
172
|
+
SET comment = 'PhotSumm: MAC de tessdb (Rafa, 2023-09-21). Originalmente tenia esa pero ha sido renombrado 1 veces mas.'
|
|
173
|
+
WHERE name = 'stars246';
|
|
174
|
+
|
|
175
|
+
COMMIT;
|
|
176
|
+
|
|
177
|
+
EOF
|
zptess-6.1.2/setup.cfg
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# ----------------------------------------------------------------------
|
|
2
|
+
# Copyright (c) 2022
|
|
3
|
+
#
|
|
4
|
+
# See the LICENSE file for details
|
|
5
|
+
# see the AUTHORS file for authors
|
|
6
|
+
# ----------------------------------------------------------------------
|
|
7
|
+
|
|
8
|
+
#--------------
|
|
9
|
+
# local imports
|
|
10
|
+
# -------------
|
|
11
|
+
|
|
12
|
+
from ._version import __version__ as __version__
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# file generated by setuptools-scm
|
|
2
|
+
# don't change, don't track in version control
|
|
3
|
+
|
|
4
|
+
__all__ = [
|
|
5
|
+
"__version__",
|
|
6
|
+
"__version_tuple__",
|
|
7
|
+
"version",
|
|
8
|
+
"version_tuple",
|
|
9
|
+
"__commit_id__",
|
|
10
|
+
"commit_id",
|
|
11
|
+
]
|
|
12
|
+
|
|
13
|
+
TYPE_CHECKING = False
|
|
14
|
+
if TYPE_CHECKING:
|
|
15
|
+
from typing import Tuple
|
|
16
|
+
from typing import Union
|
|
17
|
+
|
|
18
|
+
VERSION_TUPLE = Tuple[Union[int, str], ...]
|
|
19
|
+
COMMIT_ID = Union[str, None]
|
|
20
|
+
else:
|
|
21
|
+
VERSION_TUPLE = object
|
|
22
|
+
COMMIT_ID = object
|
|
23
|
+
|
|
24
|
+
version: str
|
|
25
|
+
__version__: str
|
|
26
|
+
__version_tuple__: VERSION_TUPLE
|
|
27
|
+
version_tuple: VERSION_TUPLE
|
|
28
|
+
commit_id: COMMIT_ID
|
|
29
|
+
__commit_id__: COMMIT_ID
|
|
30
|
+
|
|
31
|
+
__version__ = version = '6.1.2'
|
|
32
|
+
__version_tuple__ = version_tuple = (6, 1, 2)
|
|
33
|
+
|
|
34
|
+
__commit_id__ = commit_id = 'g2a922d271'
|
|
File without changes
|