arrayprobe 0.1.0__py3-none-any.whl
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.
- arrayprobe/__init__.py +219 -0
- arrayprobe/__main__.py +19 -0
- arrayprobe/_v314_lazy.py +48 -0
- arrayprobe/ai_ready.py +212 -0
- arrayprobe/attributed_export.py +1333 -0
- arrayprobe/authordefaults.py +267 -0
- arrayprobe/cli.py +3510 -0
- arrayprobe/combine.py +12 -0
- arrayprobe/compare.py +950 -0
- arrayprobe/config.py +1239 -0
- arrayprobe/constants.py +12 -0
- arrayprobe/count_closure.py +204 -0
- arrayprobe/diagnostic_views.py +769 -0
- arrayprobe/diode_report.py +265 -0
- arrayprobe/driver/__init__.py +5 -0
- arrayprobe/driver/_load_record.py +331 -0
- arrayprobe/driver/preflight_inputs.py +250 -0
- arrayprobe/driver/reprocess.py +553 -0
- arrayprobe/driver/run_flight.py +8166 -0
- arrayprobe/driver/tas_from_probe_housekeeping.py +124 -0
- arrayprobe/dropsize.py +519 -0
- arrayprobe/friendly.py +206 -0
- arrayprobe/geometry/__init__.py +77 -0
- arrayprobe/geometry/min_rectangle.py +92 -0
- arrayprobe/intarr.py +12 -0
- arrayprobe/intarr_analysis.py +16 -0
- arrayprobe/intarr_plots.py +12 -0
- arrayprobe/inventory.py +129 -0
- arrayprobe/jit_kernels.py +344 -0
- arrayprobe/lwc.py +44 -0
- arrayprobe/masks.py +349 -0
- arrayprobe/matio.py +410 -0
- arrayprobe/matlab_compat.py +13 -0
- arrayprobe/ncio.py +26 -0
- arrayprobe/particle.py +55 -0
- arrayprobe/particle_perimeter.py +12 -0
- arrayprobe/products.py +78 -0
- arrayprobe/profiles.py +179 -0
- arrayprobe/provenance.py +21 -0
- arrayprobe/py.typed +11 -0
- arrayprobe/readers/__init__.py +9 -0
- arrayprobe/readers/dmt.py +603 -0
- arrayprobe/readers/mask_csv.py +12 -0
- arrayprobe/readers/pms.py +12 -0
- arrayprobe/readers/sea.py +433 -0
- arrayprobe/readers/tasinfo.py +12 -0
- arrayprobe/regimes.py +507 -0
- arrayprobe/render.py +728 -0
- arrayprobe/reproduce_report.py +149 -0
- arrayprobe/review_agreement.py +135 -0
- arrayprobe/review_sampling.py +327 -0
- arrayprobe/run_page.py +624 -0
- arrayprobe/sample_area.py +12 -0
- arrayprobe/selector.py +206 -0
- arrayprobe/sizing.py +151 -0
- arrayprobe/time_convert.py +12 -0
- arrayprobe/timing_closure.py +141 -0
- arrayprobe/tools/__init__.py +27 -0
- arrayprobe/tools/make_demo_flight.py +1089 -0
- arrayprobe/tools/make_tas_file.py +760 -0
- arrayprobe/tools/probe_comparison.py +569 -0
- arrayprobe/tools/synthetic_truth.py +698 -0
- arrayprobe/tools/tas_sources.py +705 -0
- arrayprobe/triage_context.py +488 -0
- arrayprobe/triage_server.py +5215 -0
- arrayprobe/tune/__init__.py +15 -0
- arrayprobe/tune/diodes.py +400 -0
- arrayprobe/tune/distributions.py +300 -0
- arrayprobe/tune/sample.py +243 -0
- arrayprobe/tune/score.py +230 -0
- arrayprobe/tune/settings.py +354 -0
- arrayprobe/validate_by_condition.py +208 -0
- arrayprobe/validation_report.py +166 -0
- arrayprobe-0.1.0.dist-info/METADATA +260 -0
- arrayprobe-0.1.0.dist-info/RECORD +189 -0
- arrayprobe-0.1.0.dist-info/WHEEL +5 -0
- arrayprobe-0.1.0.dist-info/entry_points.txt +2 -0
- arrayprobe-0.1.0.dist-info/licenses/LICENSE +31 -0
- arrayprobe-0.1.0.dist-info/licenses/LICENSES/BSD-3-Clause.txt +47 -0
- arrayprobe-0.1.0.dist-info/licenses/NOTICE.md +369 -0
- arrayprobe-0.1.0.dist-info/top_level.txt +4 -0
- arrayprobe_soda2/__init__.py +131 -0
- arrayprobe_soda2/angles.py +143 -0
- arrayprobe_soda2/aspect_ratio.py +541 -0
- arrayprobe_soda2/backfill.py +100 -0
- arrayprobe_soda2/binary_dof.py +181 -0
- arrayprobe_soda2/buildindex.py +113 -0
- arrayprobe_soda2/decompress_dmt.py +285 -0
- arrayprobe_soda2/enhancement_hooks.py +275 -0
- arrayprobe_soda2/export_ascii.py +732 -0
- arrayprobe_soda2/export_ncdf.py +683 -0
- arrayprobe_soda2/export_ncdf_raf.py +396 -0
- arrayprobe_soda2/fillholes.py +161 -0
- arrayprobe_soda2/find_radius.py +105 -0
- arrayprobe_soda2/findsize.py +407 -0
- arrayprobe_soda2/fit_poisson.py +170 -0
- arrayprobe_soda2/fix2dimage.py +63 -0
- arrayprobe_soda2/fixraking.py +162 -0
- arrayprobe_soda2/fixstuckbits.py +146 -0
- arrayprobe_soda2/hvps4_read_frame.py +121 -0
- arrayprobe_soda2/jit_kernels.py +152 -0
- arrayprobe_soda2/label_blobs.py +177 -0
- arrayprobe_soda2/min_circle_fast.py +320 -0
- arrayprobe_soda2/particlesort.py +703 -0
- arrayprobe_soda2/pbp_writer.py +558 -0
- arrayprobe_soda2/poisson_spot_correct.py +183 -0
- arrayprobe_soda2/princomp.py +107 -0
- arrayprobe_soda2/probespecs.py +361 -0
- arrayprobe_soda2/process_2d.py +1364 -0
- arrayprobe_soda2/process_2d_parallel.py +626 -0
- arrayprobe_soda2/process_hk.py +512 -0
- arrayprobe_soda2/processbuffer_2dc.py +155 -0
- arrayprobe_soda2/processbuffer_cip.py +213 -0
- arrayprobe_soda2/processbuffer_f2dc.py +139 -0
- arrayprobe_soda2/processbuffer_spec.py +441 -0
- arrayprobe_soda2/processbuffer_tail.py +350 -0
- arrayprobe_soda2/pth_readers.py +245 -0
- arrayprobe_soda2/py.typed +11 -0
- arrayprobe_soda2/read2dbuffer.py +371 -0
- arrayprobe_soda2/reject.py +246 -0
- arrayprobe_soda2/reprocess_pbp.py +156 -0
- arrayprobe_soda2/sample_area.py +264 -0
- arrayprobe_soda2/save_writer.py +480 -0
- arrayprobe_soda2/sea.py +324 -0
- arrayprobe_soda2/spec_absolutepointers.py +109 -0
- arrayprobe_soda2/spec_decompress.py +203 -0
- arrayprobe_soda2/spec_index.py +476 -0
- arrayprobe_soda2/spec_read_frame.py +286 -0
- arrayprobe_soda2/spec_read_hk.py +301 -0
- arrayprobe_soda2/spec_readint.py +127 -0
- arrayprobe_soda2/timeconv.py +77 -0
- arrayprobe_soda2/update_op.py +101 -0
- arrayprobe_uiops/__init__.py +45 -0
- arrayprobe_uiops/combine.py +192 -0
- arrayprobe_uiops/combine_fork.py +359 -0
- arrayprobe_uiops/constants.py +830 -0
- arrayprobe_uiops/decode_naming.py +113 -0
- arrayprobe_uiops/diode_mask.py +250 -0
- arrayprobe_uiops/engine_absence.py +41 -0
- arrayprobe_uiops/export_oap.py +325 -0
- arrayprobe_uiops/geometry_core.py +366 -0
- arrayprobe_uiops/habit.py +749 -0
- arrayprobe_uiops/habit_core.py +248 -0
- arrayprobe_uiops/hollow_size_rule.py +376 -0
- arrayprobe_uiops/imgproc.py +2081 -0
- arrayprobe_uiops/imgproc_core.py +275 -0
- arrayprobe_uiops/intarr.py +167 -0
- arrayprobe_uiops/intarr_analysis.py +569 -0
- arrayprobe_uiops/intarr_plots.py +119 -0
- arrayprobe_uiops/jit_kernels.py +430 -0
- arrayprobe_uiops/lwc.py +70 -0
- arrayprobe_uiops/matlab_compat.py +860 -0
- arrayprobe_uiops/measure.py +346 -0
- arrayprobe_uiops/min_circle.py +204 -0
- arrayprobe_uiops/min_ellipse.py +161 -0
- arrayprobe_uiops/min_rectangle.py +200 -0
- arrayprobe_uiops/ncar_2dc_timing.py +100 -0
- arrayprobe_uiops/ncio.py +810 -0
- arrayprobe_uiops/oap_read.py +228 -0
- arrayprobe_uiops/particle.py +51 -0
- arrayprobe_uiops/particle_perimeter.py +94 -0
- arrayprobe_uiops/particle_physics.py +199 -0
- arrayprobe_uiops/pecan_params.py +134 -0
- arrayprobe_uiops/probe_cases.py +298 -0
- arrayprobe_uiops/product_sanity.py +337 -0
- arrayprobe_uiops/profile.py +71 -0
- arrayprobe_uiops/profiles.py +756 -0
- arrayprobe_uiops/provenance.py +804 -0
- arrayprobe_uiops/py.typed +11 -0
- arrayprobe_uiops/qc.py +169 -0
- arrayprobe_uiops/readers/__init__.py +8 -0
- arrayprobe_uiops/readers/mask_csv.py +74 -0
- arrayprobe_uiops/readers/pms.py +239 -0
- arrayprobe_uiops/readers/tasinfo.py +57 -0
- arrayprobe_uiops/rect_ellipse.py +129 -0
- arrayprobe_uiops/register_image_assisted.py +25 -0
- arrayprobe_uiops/reject.py +501 -0
- arrayprobe_uiops/reject_core.py +220 -0
- arrayprobe_uiops/sample_area.py +93 -0
- arrayprobe_uiops/sizedist.py +1923 -0
- arrayprobe_uiops/sizedist_core.py +814 -0
- arrayprobe_uiops/sizedist_tables.py +642 -0
- arrayprobe_uiops/spec.py +1094 -0
- arrayprobe_uiops/spec_core.py +703 -0
- arrayprobe_uiops/stray_pixel.py +103 -0
- arrayprobe_uiops/tas.py +191 -0
- arrayprobe_uiops/time_convert.py +41 -0
- uiops/__init__.py +402 -0
- uiops/py.typed +11 -0
uiops/__init__.py
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
# SPDX-License-Identifier: BSD-3-Clause
|
|
2
|
+
"""Choose which UIOOPS translation processes your data.
|
|
3
|
+
|
|
4
|
+
This is a selector, not the UIOOPS MATLAB code. ``engine()`` returns the
|
|
5
|
+
translation of UIOOPS v3.5, the engine this package offers; ``versions()``
|
|
6
|
+
lists the versions installed. An earlier translation of UIOOPS v3.1.4
|
|
7
|
+
reproduced archived products and is not part of this package; its entries in
|
|
8
|
+
``CATALOGUE`` record which v3.5 module replaced each of its modules. SODA-2 is
|
|
9
|
+
a separate engine, reached through ``arrayprobe.engine("soda2")``.
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
from __future__ import annotations
|
|
13
|
+
|
|
14
|
+
import importlib
|
|
15
|
+
import logging
|
|
16
|
+
from dataclasses import dataclass
|
|
17
|
+
from types import ModuleType
|
|
18
|
+
from typing import Any
|
|
19
|
+
|
|
20
|
+
# NullHandler by default, matching the engine packages' loggers: importing
|
|
21
|
+
# this selector prints nothing. ``arrayprobe.cli`` attaches the real handler
|
|
22
|
+
# for the console script.
|
|
23
|
+
logging.getLogger(__name__).addHandler(logging.NullHandler())
|
|
24
|
+
|
|
25
|
+
__all__ = [
|
|
26
|
+
"VERSIONS",
|
|
27
|
+
"DEFAULT_VERSION",
|
|
28
|
+
"Engine",
|
|
29
|
+
"engine",
|
|
30
|
+
"UnknownVersion",
|
|
31
|
+
"UnknownModule",
|
|
32
|
+
"CATALOGUE",
|
|
33
|
+
"Entry",
|
|
34
|
+
"OVERRIDDEN",
|
|
35
|
+
"SHARED",
|
|
36
|
+
"TOOLING",
|
|
37
|
+
"FORK_ONLY",
|
|
38
|
+
"READ_SHARED",
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def versions() -> tuple[str, ...]:
|
|
44
|
+
"""The UIOOPS versions installed: v3.5 always, v3.1.4 only where its engine is."""
|
|
45
|
+
from arrayprobe_uiops.engine_absence import engine_present
|
|
46
|
+
return ("3.1.4", "3.5") if engine_present() else ("3.5",)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
#: The UIOOPS versions installed, computed at import (see :func:`versions`).
|
|
50
|
+
VERSIONS = versions()
|
|
51
|
+
|
|
52
|
+
#: What :func:`engine` returns when the caller names nothing.
|
|
53
|
+
DEFAULT_VERSION = "3.5"
|
|
54
|
+
|
|
55
|
+
OVERRIDDEN = "overridden"
|
|
56
|
+
SHARED = "shared"
|
|
57
|
+
TOOLING = "tooling"
|
|
58
|
+
FORK_ONLY = "fork-only"
|
|
59
|
+
READ_SHARED = "read-shared"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class UnknownVersion(ValueError):
|
|
63
|
+
"""A version string that is not one of :data:`VERSIONS`."""
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class UnknownModule(KeyError):
|
|
67
|
+
"""A module name that is not in :data:`CATALOGUE`."""
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
@dataclass(frozen=True)
|
|
71
|
+
class Entry:
|
|
72
|
+
"""One module of the UIOOPS v3.1.4 translation, and how v3.5 covers it.
|
|
73
|
+
|
|
74
|
+
``sources`` names the MATLAB/C++ file(s) the module translates, so the
|
|
75
|
+
classification can be checked against the UIOOPS v3.1.4 and v3.5 sources.
|
|
76
|
+
``v35`` is the v3.5 module that replaces it, if there is one.
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
state: str
|
|
80
|
+
sources: tuple[str, ...] = ()
|
|
81
|
+
v35: str | None = None
|
|
82
|
+
note: str = ""
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _t(note: str = "") -> Entry:
|
|
86
|
+
return Entry(TOOLING, note=note)
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
def _shared(*sources: str) -> Entry:
|
|
90
|
+
return Entry(SHARED, sources=sources)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _over(v35: str, *sources: str, note: str = "") -> Entry:
|
|
94
|
+
return Entry(OVERRIDDEN, sources=sources, v35=v35, note=note)
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
def _fork(*sources: str, v35: str | None = None, note: str = "") -> Entry:
|
|
98
|
+
return Entry(FORK_ONLY, sources=sources, v35=v35, note=note)
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
#: Every module of the v3.1.4 port, keyed by its dotted name below
|
|
102
|
+
#: ``arrayprobe``. Complete by test: a module on disk that is missing here, or
|
|
103
|
+
#: an entry naming a module that no longer exists, fails the suite.
|
|
104
|
+
CATALOGUE: dict[str, Entry] = {
|
|
105
|
+
# --- v3.5 has its own translation, because the source changed ----------
|
|
106
|
+
"reject": _over("arrayprobe_uiops.reject", "calculate_reject_unified.m"),
|
|
107
|
+
"habit": _over("arrayprobe_uiops.habit", "holroyd.m",
|
|
108
|
+
note="v3.5 also adds holroyd_new.m and "
|
|
109
|
+
"holroyd_new_HVPS.m, both ported into the same module"),
|
|
110
|
+
"imgproc": _over("arrayprobe_uiops.imgproc", "imgProc_sm.m",
|
|
111
|
+
note="the per-particle measurement block lives in "
|
|
112
|
+
"arrayprobe_uiops.measure"),
|
|
113
|
+
"sizedist": _over("arrayprobe_uiops.sizedist", "sizeDist.m",
|
|
114
|
+
note="the bin tables live in "
|
|
115
|
+
"arrayprobe_uiops.sizedist_tables"),
|
|
116
|
+
"particle_physics": _over("arrayprobe_uiops.particle_physics",
|
|
117
|
+
"single_area.m", "single_mass.m",
|
|
118
|
+
note="single_vt.m is byte-identical; the "
|
|
119
|
+
"override exists for the other two, which "
|
|
120
|
+
"gained the iNewHabit argument"),
|
|
121
|
+
"readers.spec": _over("arrayprobe_uiops.spec", "read_binary_SPEC.m",
|
|
122
|
+
note="the TAS machinery is "
|
|
123
|
+
"arrayprobe_uiops.tas"),
|
|
124
|
+
"geometry.min_circle": _over("arrayprobe_uiops.min_circle", "CGAL_minR.cpp"),
|
|
125
|
+
"geometry.min_ellipse": _over("arrayprobe_uiops.min_ellipse",
|
|
126
|
+
"CGAL_EllipseSize.cpp",
|
|
127
|
+
note="layer 3 for both engines: the real "
|
|
128
|
+
"CGAL headers are unavailable here, so "
|
|
129
|
+
"this is documented semantics and "
|
|
130
|
+
"pinned tests, not an oracle"),
|
|
131
|
+
|
|
132
|
+
# --- the MATLAB source is byte-identical, so one translation serves ----
|
|
133
|
+
"dropsize": _shared("dropsize.m"),
|
|
134
|
+
"geometry.min_rectangle": _shared("CGAL_RectSize.cpp"),
|
|
135
|
+
"lwc": _shared("lwc_calc.m"),
|
|
136
|
+
"particle_perimeter": _shared("ParticlePerimeter.m"),
|
|
137
|
+
"readers.dmt": _shared("read_binary_DMT.m"),
|
|
138
|
+
"readers.pms": _shared("read_binary_PMS.m"),
|
|
139
|
+
"readers.sea": _shared("read_binary_SEA.m"),
|
|
140
|
+
"sample_area": _shared("calc_sa_randombins.m"),
|
|
141
|
+
"time_convert": _shared("hhmmss2insec.m", "insec2hhmmss.m"),
|
|
142
|
+
|
|
143
|
+
# --- the file changed; the region this module ports did not ------------
|
|
144
|
+
"readers.mask_csv": Entry(
|
|
145
|
+
READ_SHARED, sources=("read_binary_SPEC.m",),
|
|
146
|
+
note="the .MK.csv and .NV.csv sidecars are untouched by the v3.5 "
|
|
147
|
+
"diff and are inherited -- established by reading, at "
|
|
148
|
+
"arrayprobe_uiops/spec.py:219, while porting v3.5's reader. The enclosing "
|
|
149
|
+
"file changed, so this cannot be settled by hashing"),
|
|
150
|
+
|
|
151
|
+
# --- the ORACLES production fork: in no stock UIOOPS release ------------
|
|
152
|
+
"combine": _fork("combine_sizedist.m", v35="arrayprobe_uiops.combine",
|
|
153
|
+
note="held in uioops_testing/delivered_2026-08-20/ and "
|
|
154
|
+
"recovered from the dissertation; stock UIOPS ships "
|
|
155
|
+
"no such file in either release. For v3.5 it is "
|
|
156
|
+
"BORROWED from the fork and opt-in "
|
|
157
|
+
"(borrowed_combine=True), 2026-09-13"),
|
|
158
|
+
"intarr": _fork("IntArrAnalysis_time.m",
|
|
159
|
+
note="stock ships IntArrAnalysis.m, which is a different "
|
|
160
|
+
"file and is byte-identical between the releases"),
|
|
161
|
+
"intarr_analysis": _fork("IntArrAnalysis_time.m"),
|
|
162
|
+
"intarr_plots": _fork("IntArrAnalysis_time.m",
|
|
163
|
+
note="the interarrival-time diagnostic contour plot, opt-in; the "
|
|
164
|
+
"faithful mode keeps the upstream NaN axis "
|
|
165
|
+
"(2026-09-13)"),
|
|
166
|
+
"readers.tasinfo": _fork("loadTASinfo_2DS.m",
|
|
167
|
+
note="stock ships loadTASinfo.m, byte-identical "
|
|
168
|
+
"between the releases; the _2DS variant is "
|
|
169
|
+
"the fork's"),
|
|
170
|
+
"masks": _fork("find_shadow_diodes.m",
|
|
171
|
+
note="the nine-argument imgProc_sm that made the ORACLES "
|
|
172
|
+
"products, and find_shadow_diodes.m that wrote its "
|
|
173
|
+
"masks (find_shadow_diodes()); both survive "
|
|
174
|
+
"only as dissertation Appendix-B extractions "
|
|
175
|
+
"(archive/staging_variant_raw/)"),
|
|
176
|
+
|
|
177
|
+
# --- shim and tooling: one implementation, both engines ----------------
|
|
178
|
+
"": _t("the package root"),
|
|
179
|
+
"cli": _t("the command-line front door"),
|
|
180
|
+
"__main__": _t("`python -m arrayprobe`, delegating to cli.main"),
|
|
181
|
+
# 2026-10-01: the batch flight driver moved here from scripts/ (scripts/<name>.py are now
|
|
182
|
+
# shims that exec these files). It sequences the engines' stages and stamps their
|
|
183
|
+
# configuration; it reproduces no MATLAB file -- UIOOPS ships no driver.
|
|
184
|
+
"driver": _t("the batch flight driver's package root"),
|
|
185
|
+
"driver.run_flight": _t("the batch flight driver: runs a flight's stages and stamps them"),
|
|
186
|
+
"driver.reprocess": _t("re-runs one product's stage under the configuration its stamp "
|
|
187
|
+
"records"),
|
|
188
|
+
"driver.preflight_inputs": _t("opens every input a long run needs before the run starts"),
|
|
189
|
+
"driver.tas_from_probe_housekeeping": _t(
|
|
190
|
+
"builds an aircraft TAS sidecar from another probe's housekeeping airspeed"),
|
|
191
|
+
"driver._load_record": _t("records the machine's other load while a timing runs"),
|
|
192
|
+
"compare": _t("diff-triage between two output files"),
|
|
193
|
+
"config": _t("run-configuration loading; selection only"),
|
|
194
|
+
"constants": _t("probe and project tables"),
|
|
195
|
+
"diagnostic_views": _t("the record strip and one-second comparison views"),
|
|
196
|
+
"diode_report": _t("per-diode occupancy reporting"),
|
|
197
|
+
"friendly": _t("a boundary layer re-viewing four raw contracts; off the reproduction path"),
|
|
198
|
+
"geometry": _t("the geometry package root"),
|
|
199
|
+
"jit_kernels": _t("opt-in numba kernels for S3's hot loops; speed only, byte-identical"),
|
|
200
|
+
"matio": _t("reading MATLAB .mat sidecars"),
|
|
201
|
+
"matlab_compat": _t("MATLAB language semantics NumPy does not reproduce"),
|
|
202
|
+
"ncio": _t("MATLAB netcdf.* semantics; an alias of arrayprobe_uiops.ncio since "
|
|
203
|
+
"2026-10-03, where the code both engines share lives"),
|
|
204
|
+
"particle": _t("the in-memory particle image"),
|
|
205
|
+
"profiles": _t("which MATLAB variant a run reproduces"),
|
|
206
|
+
"provenance": _t("the one parser for every .call sidecar; absence is None, never an "
|
|
207
|
+
"engine; an alias of arrayprobe_uiops.provenance since 2026-09-30, "
|
|
208
|
+
"where the code both engines share lives"),
|
|
209
|
+
"count_closure": _t("checks that an S4 product's binned counts sum to the particles its "
|
|
210
|
+
"S3 file holds; read-only, reproduces no MATLAB file"),
|
|
211
|
+
"inventory": _t("raw-file inventory flagging empty and truncated raw files before "
|
|
212
|
+
"processing; reproduces no MATLAB file and computes nothing"),
|
|
213
|
+
"reproduce_report": _t("compares a product against an archived product cell by cell; "
|
|
214
|
+
"read-only, reproduces no MATLAB file"),
|
|
215
|
+
"readers": _t("the readers package root"),
|
|
216
|
+
"regimes": _t("named cloud-regime S4 threshold bundles; selects, computes nothing"),
|
|
217
|
+
"attributed_export": _t("a self-describing sibling of a faithful product; reads it "
|
|
218
|
+
"read-only and computes nothing"),
|
|
219
|
+
"ai_ready": _t("checks an attributed export against the metadata and storage it claims; "
|
|
220
|
+
"reads files only, computes nothing"),
|
|
221
|
+
"hvps_caveat": _t("the HVPS count caveat; a warning, changes no number"),
|
|
222
|
+
"hvps_flight_config": _t("per-flight HVPS inter-arrival source table; records a "
|
|
223
|
+
"configuration, computes nothing"),
|
|
224
|
+
"authordefaults": _t("loads the author-editable defaults file; selects a profile, "
|
|
225
|
+
"computes nothing"),
|
|
226
|
+
"render": _t("particle visualisation"),
|
|
227
|
+
"review_sampling": _t("stratified review samples"),
|
|
228
|
+
"review_agreement": _t("re-check queues and label agreement (Cohen's kappa)"),
|
|
229
|
+
"sizing": _t("the size-definition registry"),
|
|
230
|
+
"_v314_lazy": _t("lazy access to the v3.1.4 modules the public distribution omits"),
|
|
231
|
+
"timing_closure": _t("the interarrival closure check"),
|
|
232
|
+
"tools": _t("tooling shipped inside the package"),
|
|
233
|
+
"tools.make_demo_flight": _t("the synthetic raw-file generator"),
|
|
234
|
+
"tools.heldout_stamp": _t("stamps held-out evaluation outputs; computes nothing"),
|
|
235
|
+
"tools.synthetic_truth": _t("known-truth synthetic 2D-S flights for accuracy checks"),
|
|
236
|
+
# 2026-09-16, from the cold-start usability audit: the v3.5 engine refuses to
|
|
237
|
+
# run without an aircraft TAS file whose schema no page stated and no tool
|
|
238
|
+
# wrote. This writes one. Tooling -- it produces an input, computes nothing.
|
|
239
|
+
"tools.make_tas_file": _t("writes the aircraft TAS file the v3.5 engine requires"),
|
|
240
|
+
"tools.tas_sources": _t("the TAS source chain: finds, reads and checks a run's airspeed"),
|
|
241
|
+
# 2026-09-17: the SEA/CIP chain had no measured TAS at all -- nothing on it writes a
|
|
242
|
+
# .tas.csv, and --constant-tas fabricates one. This reads the aircraft data system's own
|
|
243
|
+
# NASA-Ames 1001 series into that sidecar. Tooling -- it converts a time base and
|
|
244
|
+
# copies an aircraft measurement; no UIOOPS release reads this format.
|
|
245
|
+
"tools.nasa_ames_tas": _t("reads a NASA-Ames 1001 aircraft TAS file into a .tas.csv"),
|
|
246
|
+
"tools.probe_comparison": _t(
|
|
247
|
+
"puts two probes' written products on a common size grid and time axis for "
|
|
248
|
+
"comparison; reproduces no MATLAB file"),
|
|
249
|
+
"products": _t(
|
|
250
|
+
"arrayprobe.open_product, opens a written product as written, engine-neutral. "
|
|
251
|
+
"TOOLING: it reproduces no MATLAB file and computes nothing"),
|
|
252
|
+
"selector": _t(
|
|
253
|
+
"the project-level engine selector, arrayprobe.engine() -- spans all "
|
|
254
|
+
"three engines where this module spans the two UIOPS ones. "
|
|
255
|
+
"TOOLING: it reproduces no MATLAB file and computes nothing"),
|
|
256
|
+
"triage_server": _t("the triage GUI"),
|
|
257
|
+
"run_page": _t("the triage GUI's Run page"),
|
|
258
|
+
"triage_context": _t("what the triage pages show beside a particle"),
|
|
259
|
+
"tune": _t("the tune package root"),
|
|
260
|
+
"tune.settings": _t(
|
|
261
|
+
"lists every setting a v3.5 run can change, cited to file:line, and whether it "
|
|
262
|
+
"reaches the output on a given probe case; reproduces no MATLAB file and computes "
|
|
263
|
+
"nothing"),
|
|
264
|
+
"tune.sample": _t(
|
|
265
|
+
"draws triage review queues from a proc file inside time windows; reads only and "
|
|
266
|
+
"computes no product"),
|
|
267
|
+
"tune.distributions": _t(
|
|
268
|
+
"reports per-particle distributions inside time windows with each threshold marked; "
|
|
269
|
+
"reads only and computes no product"),
|
|
270
|
+
"tune.score": _t(
|
|
271
|
+
"crosses a reviewer's triage labels with each particle's reject code and size bin; "
|
|
272
|
+
"reads only and computes no product"),
|
|
273
|
+
"tune.diodes": _t(
|
|
274
|
+
"reports stuck diodes from a proc file's bin_stats, delegating the rule to "
|
|
275
|
+
"arrayprobe_uiops.diode_mask; reads only and computes no product"),
|
|
276
|
+
"validate_by_condition": _t("stratified agreement against a product"),
|
|
277
|
+
"validation_report": _t("typed comparison results"),
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
#: One line per engine on what its results rest on. Stated at the point of
|
|
281
|
+
#: selection because "default" and "authoritative" are different here, and a
|
|
282
|
+
#: user who only reads the default would draw the wrong conclusion.
|
|
283
|
+
_VALIDATION = {
|
|
284
|
+
"3.1.4": "layer 1 -- reproduces a field campaign's archived products bit "
|
|
285
|
+
"for bit in the validated flights. The only engine with an "
|
|
286
|
+
"archived product behind it; it exists to validate against that "
|
|
287
|
+
"record, not as a general-purpose alternative to v3.5.",
|
|
288
|
+
"3.5": "layer 2 only -- every routine is asserted against GNU Octave "
|
|
289
|
+
"running v3.5's own sources. No archived campaign product was ever "
|
|
290
|
+
"produced by v3.5, so there is nothing to make a layer-1 claim "
|
|
291
|
+
"against, and there never will be. Its profile is STOCK_V35 "
|
|
292
|
+
"(stock-v3.5): every field read from the v3.5 sources and checked "
|
|
293
|
+
"against an Octave parse of the same lines; its values equal "
|
|
294
|
+
"stock-v3.1.4's, cited to v3.5 lines.",
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
|
|
298
|
+
@dataclass(frozen=True)
|
|
299
|
+
class Engine:
|
|
300
|
+
"""A chosen UIOOPS version, and the modules that implement it."""
|
|
301
|
+
|
|
302
|
+
version: str
|
|
303
|
+
|
|
304
|
+
@property
|
|
305
|
+
def validation(self) -> str:
|
|
306
|
+
"""What results from this engine rest on, in one line."""
|
|
307
|
+
return _VALIDATION[self.version]
|
|
308
|
+
|
|
309
|
+
@property
|
|
310
|
+
def is_default(self) -> bool:
|
|
311
|
+
"""True when this engine is ``DEFAULT_VERSION``, the one ``engine()`` returns with no
|
|
312
|
+
argument."""
|
|
313
|
+
return self.version == DEFAULT_VERSION
|
|
314
|
+
|
|
315
|
+
def _entry(self, name: str) -> Entry:
|
|
316
|
+
if name not in CATALOGUE:
|
|
317
|
+
raise UnknownModule(
|
|
318
|
+
f"no module {name!r} in the v3.1.4 port. Known: "
|
|
319
|
+
f"{sorted(n for n in CATALOGUE if n)}")
|
|
320
|
+
return CATALOGUE[name]
|
|
321
|
+
|
|
322
|
+
def dotted(self, name: str) -> str:
|
|
323
|
+
"""The importable name of the module implementing ``name`` here."""
|
|
324
|
+
entry = self._entry(name)
|
|
325
|
+
if self.version == "3.5" and entry.v35:
|
|
326
|
+
return entry.v35
|
|
327
|
+
return f"arrayprobe.{name}" if name else "arrayprobe"
|
|
328
|
+
|
|
329
|
+
def module(self, name: str) -> ModuleType:
|
|
330
|
+
"""Import and return the module implementing ``name`` here. A v3.1.4 module missing
|
|
331
|
+
because the v3.1.4 engine is not installed raises ``V314EngineAbsent``, naming why."""
|
|
332
|
+
dotted = self.dotted(name)
|
|
333
|
+
try:
|
|
334
|
+
return importlib.import_module(dotted)
|
|
335
|
+
except ModuleNotFoundError as exc:
|
|
336
|
+
if self.version == "3.1.4" and exc.name == dotted:
|
|
337
|
+
from arrayprobe_uiops.engine_absence import ABSENT_MESSAGE, V314EngineAbsent
|
|
338
|
+
raise V314EngineAbsent(ABSENT_MESSAGE) from exc
|
|
339
|
+
raise
|
|
340
|
+
|
|
341
|
+
def get(self, name: str, attribute: str) -> Any:
|
|
342
|
+
"""One attribute of :meth:`module` -- the common two-step, in one."""
|
|
343
|
+
return getattr(self.module(name), attribute)
|
|
344
|
+
|
|
345
|
+
def provenance(self, name: str) -> str:
|
|
346
|
+
"""One line on where this engine's implementation of ``name`` comes
|
|
347
|
+
from, and what that means -- the thing a reader could not previously
|
|
348
|
+
find out without reading ``arrayprobe_uiops``'s import list."""
|
|
349
|
+
entry = self._entry(name)
|
|
350
|
+
dotted = self.dotted(name)
|
|
351
|
+
sources = ", ".join(entry.sources) or "no MATLAB source"
|
|
352
|
+
if self.version == "3.1.4":
|
|
353
|
+
if entry.state == FORK_ONLY:
|
|
354
|
+
return (f"{dotted} -- translates {sources} from the field "
|
|
355
|
+
f"campaign's production variant, which made the "
|
|
356
|
+
f"archived products")
|
|
357
|
+
if entry.state == TOOLING:
|
|
358
|
+
return f"{dotted} -- {entry.note or 'tooling'}, no MATLAB source"
|
|
359
|
+
return f"{dotted} -- ports {sources} as of v3.1.4"
|
|
360
|
+
if entry.state == OVERRIDDEN:
|
|
361
|
+
return (f"{dotted} -- v3.5's own translation of {sources}, which "
|
|
362
|
+
f"changed between the releases")
|
|
363
|
+
if entry.state == SHARED:
|
|
364
|
+
return (f"{dotted} -- the v3.1.4 port's translation, reused "
|
|
365
|
+
f"because {sources} is byte-identical in v3.5")
|
|
366
|
+
if entry.state == READ_SHARED:
|
|
367
|
+
return (f"{dotted} -- the v3.1.4 port's translation. {entry.note}")
|
|
368
|
+
if entry.state == FORK_ONLY:
|
|
369
|
+
borrowed = (" Borrowed for v3.5, opt-in, and labelled so in its "
|
|
370
|
+
".call sidecar." if entry.v35 else "")
|
|
371
|
+
return (f"{dotted} -- ports {sources}, which exists in NO stock "
|
|
372
|
+
f"UIOPS release. There is no v3.5 counterpart to be "
|
|
373
|
+
f"faithful to.{borrowed}")
|
|
374
|
+
return f"{dotted} -- {entry.note or 'tooling'}, shared by both engines"
|
|
375
|
+
|
|
376
|
+
def catalogue(self) -> dict[str, str]:
|
|
377
|
+
"""Every module name mapped to :meth:`provenance`."""
|
|
378
|
+
return {name: self.provenance(name) for name in sorted(CATALOGUE)}
|
|
379
|
+
|
|
380
|
+
def overrides(self) -> tuple[str, ...]:
|
|
381
|
+
"""The modules where this engine differs from the other one."""
|
|
382
|
+
if self.version == "3.1.4":
|
|
383
|
+
return ()
|
|
384
|
+
return tuple(sorted(n for n, e in CATALOGUE.items() if e.v35))
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
def engine(version: str | None = None) -> Engine:
|
|
388
|
+
"""The engine for ``version``, or :data:`DEFAULT_VERSION` if none is named."""
|
|
389
|
+
chosen = DEFAULT_VERSION if version is None else str(version)
|
|
390
|
+
if chosen in ("soda2", "soda-2", "SODA-2", "SODA2"):
|
|
391
|
+
raise UnknownVersion(
|
|
392
|
+
"SODA-2 is not a UIOOPS version and is not selectable here -- it is "
|
|
393
|
+
"a separate processing lineage (NCAR, IDL) whose port covers the "
|
|
394
|
+
"particle path only. Import arrayprobe_soda2 directly.")
|
|
395
|
+
if chosen == "3.1.4" and "3.1.4" not in versions():
|
|
396
|
+
from arrayprobe_uiops.engine_absence import ABSENT_MESSAGE, V314EngineAbsent
|
|
397
|
+
raise V314EngineAbsent(ABSENT_MESSAGE)
|
|
398
|
+
if chosen not in ("3.1.4", "3.5"):
|
|
399
|
+
raise UnknownVersion(
|
|
400
|
+
f"unknown UIOOPS version {chosen!r}; this package offers "
|
|
401
|
+
f"{list(versions())}. The default is {DEFAULT_VERSION}.")
|
|
402
|
+
return Engine(chosen)
|
uiops/py.typed
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# PEP 561 marker.
|
|
2
|
+
#
|
|
3
|
+
# This package is fully annotated and `mypy src` is clean, but without this
|
|
4
|
+
# file a type checker in a DOWNSTREAM project ignores every annotation --
|
|
5
|
+
# PEP 561 says an installed package's types are invisible unless it says so.
|
|
6
|
+
# Nothing in this repository would ever have noticed: `mypy src` runs against
|
|
7
|
+
# the source tree, where the marker is irrelevant.
|
|
8
|
+
#
|
|
9
|
+
# Added 2026-09-12 in a release-readiness pass. `tests/test_py_typed.py`
|
|
10
|
+
# asserts one exists per shipped package and that setuptools is told to
|
|
11
|
+
# include it, because a marker that is not packaged is the same as no marker.
|