labmon 0.3.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 (54) hide show
  1. labmon-0.3.0/.gitignore +36 -0
  2. labmon-0.3.0/CHANGELOG.md +148 -0
  3. labmon-0.3.0/LICENSE +674 -0
  4. labmon-0.3.0/PKG-INFO +113 -0
  5. labmon-0.3.0/README.pypi.md +74 -0
  6. labmon-0.3.0/pyproject.toml +241 -0
  7. labmon-0.3.0/src/labmon/__init__.py +0 -0
  8. labmon-0.3.0/src/labmon/adc.py +17 -0
  9. labmon-0.3.0/src/labmon/admin.py +244 -0
  10. labmon-0.3.0/src/labmon/calibration.py +997 -0
  11. labmon-0.3.0/src/labmon/cli/__init__.py +1 -0
  12. labmon-0.3.0/src/labmon/cli/age.py +60 -0
  13. labmon-0.3.0/src/labmon/cli/commands/__init__.py +6 -0
  14. labmon-0.3.0/src/labmon/cli/commands/export.py +256 -0
  15. labmon-0.3.0/src/labmon/cli/commands/init.py +117 -0
  16. labmon-0.3.0/src/labmon/cli/commands/mock_sensor.py +143 -0
  17. labmon-0.3.0/src/labmon/cli/commands/monitor.py +160 -0
  18. labmon-0.3.0/src/labmon/cli/commands/query.py +114 -0
  19. labmon-0.3.0/src/labmon/cli/commands/reset_database.py +125 -0
  20. labmon-0.3.0/src/labmon/cli/commands/sensors.py +177 -0
  21. labmon-0.3.0/src/labmon/cli/commands/serial_sensor.py +88 -0
  22. labmon-0.3.0/src/labmon/cli/deprecated.py +42 -0
  23. labmon-0.3.0/src/labmon/cli/main.py +124 -0
  24. labmon-0.3.0/src/labmon/cli/monitor.py +292 -0
  25. labmon-0.3.0/src/labmon/cli/options.py +101 -0
  26. labmon-0.3.0/src/labmon/cli/quantity.py +245 -0
  27. labmon-0.3.0/src/labmon/cli/render.py +516 -0
  28. labmon-0.3.0/src/labmon/cli/roster.py +188 -0
  29. labmon-0.3.0/src/labmon/cli/runtime.py +127 -0
  30. labmon-0.3.0/src/labmon/cli/screenshot.py +76 -0
  31. labmon-0.3.0/src/labmon/cli/selection.py +213 -0
  32. labmon-0.3.0/src/labmon/cli/tui.py +832 -0
  33. labmon-0.3.0/src/labmon/config.py +543 -0
  34. labmon-0.3.0/src/labmon/env.py +124 -0
  35. labmon-0.3.0/src/labmon/export/__init__.py +16 -0
  36. labmon-0.3.0/src/labmon/export/formats.py +27 -0
  37. labmon-0.3.0/src/labmon/export/query.py +450 -0
  38. labmon-0.3.0/src/labmon/export/table.py +245 -0
  39. labmon-0.3.0/src/labmon/export/window.py +124 -0
  40. labmon-0.3.0/src/labmon/export/writers.py +286 -0
  41. labmon-0.3.0/src/labmon/gate.py +239 -0
  42. labmon-0.3.0/src/labmon/influx.py +115 -0
  43. labmon-0.3.0/src/labmon/logs.py +155 -0
  44. labmon-0.3.0/src/labmon/py.typed +0 -0
  45. labmon-0.3.0/src/labmon/quantise.py +89 -0
  46. labmon-0.3.0/src/labmon/sensors/__init__.py +0 -0
  47. labmon-0.3.0/src/labmon/sensors/constants.py +21 -0
  48. labmon-0.3.0/src/labmon/sensors/loop.py +183 -0
  49. labmon-0.3.0/src/labmon/sensors/mock_sensor.py +120 -0
  50. labmon-0.3.0/src/labmon/sensors/polling.py +226 -0
  51. labmon-0.3.0/src/labmon/sensors/serial_sensor.py +224 -0
  52. labmon-0.3.0/src/labmon/sensors/serial_source.py +187 -0
  53. labmon-0.3.0/src/labmon/version.py +28 -0
  54. labmon-0.3.0/src/labmon/writer.py +170 -0
@@ -0,0 +1,36 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Test coverage artifacts
10
+ .coverage
11
+ coverage.xml
12
+
13
+ # Environment variables
14
+ .env
15
+ .env.*
16
+ !.env.example
17
+ !.env.client.example
18
+
19
+ # Virtual environments
20
+ .venv
21
+
22
+ # InfluxDB local data
23
+ .influxdb3/
24
+
25
+ # Grafana local data
26
+ .grafana/data/
27
+
28
+ # Loki local data
29
+ .loki/
30
+
31
+ .bateau_ivre/
32
+
33
+ # The CA certificate `scripts/export-ca.sh` copies out of the stack. It
34
+ # is public, not secret, but it is per-deployment, so it does not belong
35
+ # in the repository.
36
+ labmon-ca.crt
@@ -0,0 +1,148 @@
1
+ # Changelog
2
+
3
+ All notable changes to labmon are recorded here.
4
+
5
+ The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+ Commits follow [Conventional Commits](https://www.conventionalcommits.org/),
8
+ so the sections below map onto commit types.
9
+
10
+ ## [Unreleased]
11
+
12
+ Nothing yet.
13
+
14
+ ## [0.3.0] — 2026-09-02
15
+
16
+ ### Added
17
+
18
+ #### The command line
19
+
20
+ - **`labmon query` and `labmon export`** — print readings as a table,
21
+ or write them to CSV, Parquet, Feather or netCDF (netCDF is opt-in as
22
+ `labmon[netcdf]`). Both take the same selection flags, and the unit
23
+ travels with the readings in every format.
24
+ [`docs/export.md`](docs/export.md),
25
+ [`docs/loading-exports.md`](docs/loading-exports.md) —
26
+ [#154](https://github.com/quentinmarolleau/labmon/pull/154)
27
+ - `--split-per-sensor` writes one file per sensor; `--no-raw-input`
28
+ leaves the provenance columns out.
29
+ - **`labmon query latest`** — one row per sensor, with how long ago it
30
+ reported. `--stats` adds the window's average, deviation and count,
31
+ the average rounded against the deviation.
32
+ [#164](https://github.com/quentinmarolleau/labmon/pull/164),
33
+ [#171](https://github.com/quentinmarolleau/labmon/pull/171)
34
+ - **`labmon sensors`** — the roster of every sensor labmon has seen,
35
+ cached between runs, so one that stops reporting is still listed.
36
+ [#165](https://github.com/quentinmarolleau/labmon/pull/165)
37
+ - **`labmon monitor`** — a panel that redraws in place, for the
38
+ terminal beside the experiment. A tile per sensor from
39
+ `[[monitor.panels]]`, with thresholds and per-sensor digits, or a
40
+ table of everything when no layout is configured. Needs the `tui`
41
+ extra.
42
+ [`docs/monitor.md`](docs/monitor.md) —
43
+ [#172](https://github.com/quentinmarolleau/labmon/pull/172),
44
+ [#177](https://github.com/quentinmarolleau/labmon/pull/177)
45
+ - **Tab completion** for bash, zsh, fish and powershell, through
46
+ `labmon --install-completion`.
47
+ [#154](https://github.com/quentinmarolleau/labmon/pull/154)
48
+ - **`labmon init`** — issues the instance's admin token, writes it into
49
+ `.env`, and creates the database. Replaces exec'ing into the container
50
+ and copying the token out of the terminal, and works from a machine
51
+ that has no container to exec into. `--retention` sets how long
52
+ readings are kept, which can only be decided when a database is
53
+ created.
54
+ [`docs/deployment.md`](docs/deployment.md#setting-up-and-starting-over)
55
+ - **`labmon reset-database`** — empties the database and creates it
56
+ again, keeping its retention. The admin token is untouched, so clients
57
+ keep writing. `docker compose down -v` does not do this: InfluxDB's
58
+ data is a bind mount rather than a named volume.
59
+ [`docs/deployment.md`](docs/deployment.md#setting-up-and-starting-over)
60
+
61
+ #### Elsewhere
62
+
63
+ - **A per-user configuration file**, read from
64
+ `$XDG_CONFIG_HOME/labmon/labmon.toml`: the display timezone, and the
65
+ `[monitor]` section the panel reads.
66
+ [`docs/configuration.md`](docs/configuration.md) —
67
+ [#170](https://github.com/quentinmarolleau/labmon/pull/170)
68
+ - Simulated readings are rounded to a plausible instrument resolution,
69
+ through `--resolution` or `--significant-digits`.
70
+ [#153](https://github.com/quentinmarolleau/labmon/pull/153)
71
+ - **labmon is on PyPI.** `uv tool install labmon` (or
72
+ `pip install labmon`) puts the command line on a machine with no
73
+ checkout, which is all a sensor host or an analysis laptop ever
74
+ needed. The stack still comes from the repository — a compose file is
75
+ not something an installer can usefully deliver.
76
+ [`docs/client-setup.md`](docs/client-setup.md) —
77
+ [#169](https://github.com/quentinmarolleau/labmon/issues/169)
78
+ - **`labmon --version`**, and a `py.typed` marker so an installed
79
+ labmon's annotations reach a downstream type checker.
80
+ [#169](https://github.com/quentinmarolleau/labmon/issues/169)
81
+
82
+ ### Changed
83
+
84
+ - `mock-sensor` and `serial-sensor` are now `labmon mock-sensor` and
85
+ `labmon serial-sensor`. The old spellings still work and warn.
86
+ - A calibrated reading is stored at the resolution of its input rather
87
+ than at full float64 precision.
88
+ [#175](https://github.com/quentinmarolleau/labmon/pull/175)
89
+ - Startup imports pyarrow, pint, numpy and the InfluxDB client only
90
+ when the command needs them: `labmon query --help` goes from 0.79 s
91
+ to 0.19 s.
92
+ - The demo's beam channels wander rather than tracing a Lissajous
93
+ figure.
94
+ [#176](https://github.com/quentinmarolleau/labmon/pull/176)
95
+ - Commands read `.env` from the directory they run in, so a token set
96
+ for Compose also reaches a `labmon` typed at a prompt. The process
97
+ environment still wins.
98
+ [#185](https://github.com/quentinmarolleau/labmon/issues/185)
99
+ - `INFLUXDB_NODE_ID` defaults to `node0`, leaving the token as the only
100
+ value the quickstart has to fill in.
101
+ - `query latest` asks `information_schema` once for every table rather
102
+ than once per table. A `labmon monitor` tick goes from 83 ms to
103
+ 60 ms against the demo stack, and the saving grows with the number of
104
+ measurements a deployment writes.
105
+ [#179](https://github.com/quentinmarolleau/labmon/pull/179)
106
+ - Grafana 13.2.0, Loki 3.7.7, Alloy 1.19.2, Caddy 2.11.
107
+
108
+ ### Fixed
109
+
110
+ - `labmon mock-sensor` given neither `--measurement` nor `--unit` wrote
111
+ to `temperature` with no unit; both are now required.
112
+ [#158](https://github.com/quentinmarolleau/labmon/issues/158)
113
+ - Simulated sensors reported full float64 precision, filling the
114
+ database with readings no thermometer could produce.
115
+ [#152](https://github.com/quentinmarolleau/labmon/issues/152)
116
+ - A Grafana panel plugin that could not be fetched stopped the whole
117
+ stack starting, crash-looping the container behind an `unhealthy`
118
+ status that named no cause. The install is now asynchronous: the
119
+ failure is logged, Grafana serves, and the panel reads "plugin not
120
+ found".
121
+ [#186](https://github.com/quentinmarolleau/labmon/issues/186)
122
+
123
+ ### Security
124
+
125
+ - Containers built from the labmon image run as an unprivileged system
126
+ user rather than as root. Serial access comes from `dialout`
127
+ membership; a host that numbers that group differently passes its own
128
+ gid with `group_add`.
129
+ [`docs/serial-sensor.md`](docs/serial-sensor.md) —
130
+ [#116](https://github.com/quentinmarolleau/labmon/issues/116)
131
+ - The server's Alloy UI binds loopback, as the client's has since
132
+ [#63](https://github.com/quentinmarolleau/labmon/pull/63).
133
+ It has no authentication and describes the deployment, so reaching it
134
+ from a workstation now needs
135
+ `ssh -L 12345:127.0.0.1:12345 <host>` — the instruction
136
+ [`docs/client-setup.md`](docs/client-setup.md) already gave for the
137
+ client's.
138
+ [#136](https://github.com/quentinmarolleau/labmon/issues/136)
139
+
140
+ ## [0.2.0-beta.1] — 2026-08-23
141
+
142
+ The first beta. `RELEASE_NOTE.md` carries whichever release is current,
143
+ so the beta's announcement is on
144
+ [its release page](https://github.com/quentinmarolleau/labmon/releases/tag/v0.2.0-beta.1).
145
+
146
+ [Unreleased]: https://github.com/quentinmarolleau/labmon/compare/v0.3.0...HEAD
147
+ [0.3.0]: https://github.com/quentinmarolleau/labmon/releases/tag/v0.3.0
148
+ [0.2.0-beta.1]: https://github.com/quentinmarolleau/labmon/releases/tag/v0.2.0-beta.1