fathom-acoustics 1.2.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 (249) hide show
  1. fathom_acoustics-1.2.0/.github/scripts/changelog_section.py +38 -0
  2. fathom_acoustics-1.2.0/.github/workflows/ci.yml +238 -0
  3. fathom_acoustics-1.2.0/.github/workflows/docs.yml +52 -0
  4. fathom_acoustics-1.2.0/.github/workflows/installers.yml +309 -0
  5. fathom_acoustics-1.2.0/.github/workflows/release.yml +213 -0
  6. fathom_acoustics-1.2.0/.gitignore +24 -0
  7. fathom_acoustics-1.2.0/CHANGELOG.md +295 -0
  8. fathom_acoustics-1.2.0/LICENSE +21 -0
  9. fathom_acoustics-1.2.0/PKG-INFO +204 -0
  10. fathom_acoustics-1.2.0/README.md +149 -0
  11. fathom_acoustics-1.2.0/benchmarks/compare.py +63 -0
  12. fathom_acoustics-1.2.0/benchmarks/test_benchmarks.py +126 -0
  13. fathom_acoustics-1.2.0/docs/api/analysis.md +3 -0
  14. fathom_acoustics-1.2.0/docs/api/gui.md +3 -0
  15. fathom_acoustics-1.2.0/docs/api/io.md +3 -0
  16. fathom_acoustics-1.2.0/docs/api/jupyter.md +3 -0
  17. fathom_acoustics-1.2.0/docs/api/mcp.md +3 -0
  18. fathom_acoustics-1.2.0/docs/api/models.md +3 -0
  19. fathom_acoustics-1.2.0/docs/api/plotting.md +3 -0
  20. fathom_acoustics-1.2.0/docs/api/schema.md +3 -0
  21. fathom_acoustics-1.2.0/docs/api/signals.md +3 -0
  22. fathom_acoustics-1.2.0/docs/api/stream.md +3 -0
  23. fathom_acoustics-1.2.0/docs/api/theme.md +3 -0
  24. fathom_acoustics-1.2.0/docs/api/units.md +3 -0
  25. fathom_acoustics-1.2.0/docs/api/workspace.md +3 -0
  26. fathom_acoustics-1.2.0/docs/changelog.md +1 -0
  27. fathom_acoustics-1.2.0/docs/channel-studio.md +155 -0
  28. fathom_acoustics-1.2.0/docs/cli.md +152 -0
  29. fathom_acoustics-1.2.0/docs/design.md +44 -0
  30. fathom_acoustics-1.2.0/docs/formats.md +75 -0
  31. fathom_acoustics-1.2.0/docs/fsp.md +46 -0
  32. fathom_acoustics-1.2.0/docs/hooks.py +44 -0
  33. fathom_acoustics-1.2.0/docs/index.md +85 -0
  34. fathom_acoustics-1.2.0/docs/install.md +103 -0
  35. fathom_acoustics-1.2.0/docs/jupyter.md +77 -0
  36. fathom_acoustics-1.2.0/docs/mcp.md +165 -0
  37. fathom_acoustics-1.2.0/docs/models.md +156 -0
  38. fathom_acoustics-1.2.0/docs/releases.md +167 -0
  39. fathom_acoustics-1.2.0/docs/roadmap.md +94 -0
  40. fathom_acoustics-1.2.0/docs/spec.md +567 -0
  41. fathom_acoustics-1.2.0/docs/studio.md +130 -0
  42. fathom_acoustics-1.2.0/docs/stylesheets/sige.css +55 -0
  43. fathom_acoustics-1.2.0/docs/workspace.md +59 -0
  44. fathom_acoustics-1.2.0/examples/data/harbor_stream.fsp +0 -0
  45. fathom_acoustics-1.2.0/examples/data/hydrophone_ocv.csv +64 -0
  46. fathom_acoustics-1.2.0/examples/data/make_recordings.py +260 -0
  47. fathom_acoustics-1.2.0/examples/data/projector_tvr.csv +85 -0
  48. fathom_acoustics-1.2.0/examples/data/tank_expsweep.tdms +0 -0
  49. fathom_acoustics-1.2.0/examples/models/harbor_multipath.yaml +33 -0
  50. fathom_acoustics-1.2.0/examples/notebooks/01_lfm_vs_hfm.ipynb +294 -0
  51. fathom_acoustics-1.2.0/examples/notebooks/02_harbor_roc.ipynb +347 -0
  52. fathom_acoustics-1.2.0/examples/notebooks/03_impulse_response_red_pitaya.ipynb +429 -0
  53. fathom_acoustics-1.2.0/examples/notebooks/04_live_spectrogram.ipynb +280 -0
  54. fathom_acoustics-1.2.0/examples/notebooks/05_bpsk_ber.ipynb +268 -0
  55. fathom_acoustics-1.2.0/installer/README.md +14 -0
  56. fathom_acoustics-1.2.0/installer/construct.yaml +75 -0
  57. fathom_acoustics-1.2.0/installer/make_icons.py +72 -0
  58. fathom_acoustics-1.2.0/installer/post_install.sh +16 -0
  59. fathom_acoustics-1.2.0/installer/recipe/menu/fathom.json +52 -0
  60. fathom_acoustics-1.2.0/installer/recipe/recipe.yaml +82 -0
  61. fathom_acoustics-1.2.0/installer/smoke_test.py +174 -0
  62. fathom_acoustics-1.2.0/mkdocs.yml +84 -0
  63. fathom_acoustics-1.2.0/pyproject.toml +182 -0
  64. fathom_acoustics-1.2.0/src/fathom/__init__.py +62 -0
  65. fathom_acoustics-1.2.0/src/fathom/__main__.py +7 -0
  66. fathom_acoustics-1.2.0/src/fathom/_config.py +65 -0
  67. fathom_acoustics-1.2.0/src/fathom/_decimate.py +160 -0
  68. fathom_acoustics-1.2.0/src/fathom/_version.py +24 -0
  69. fathom_acoustics-1.2.0/src/fathom/analysis/__init__.py +105 -0
  70. fathom_acoustics-1.2.0/src/fathom/analysis/_common.py +71 -0
  71. fathom_acoustics-1.2.0/src/fathom/analysis/_results.py +820 -0
  72. fathom_acoustics-1.2.0/src/fathom/analysis/ambiguity.py +196 -0
  73. fathom_acoustics-1.2.0/src/fathom/analysis/array.py +150 -0
  74. fathom_acoustics-1.2.0/src/fathom/analysis/compare.py +135 -0
  75. fathom_acoustics-1.2.0/src/fathom/analysis/correlation.py +180 -0
  76. fathom_acoustics-1.2.0/src/fathom/analysis/detection.py +159 -0
  77. fathom_acoustics-1.2.0/src/fathom/analysis/measure.py +264 -0
  78. fathom_acoustics-1.2.0/src/fathom/analysis/modulation.py +70 -0
  79. fathom_acoustics-1.2.0/src/fathom/analysis/spectral.py +433 -0
  80. fathom_acoustics-1.2.0/src/fathom/analysis/timedomain.py +64 -0
  81. fathom_acoustics-1.2.0/src/fathom/analysis/transfer.py +75 -0
  82. fathom_acoustics-1.2.0/src/fathom/cli/__init__.py +220 -0
  83. fathom_acoustics-1.2.0/src/fathom/cli/_analyze.py +293 -0
  84. fathom_acoustics-1.2.0/src/fathom/cli/_common.py +288 -0
  85. fathom_acoustics-1.2.0/src/fathom/cli/_gen.py +447 -0
  86. fathom_acoustics-1.2.0/src/fathom/cli/_lab.py +59 -0
  87. fathom_acoustics-1.2.0/src/fathom/cli/_mcp.py +100 -0
  88. fathom_acoustics-1.2.0/src/fathom/cli/_model.py +471 -0
  89. fathom_acoustics-1.2.0/src/fathom/cli/_serve.py +92 -0
  90. fathom_acoustics-1.2.0/src/fathom/cli/_studio.py +52 -0
  91. fathom_acoustics-1.2.0/src/fathom/gui/__init__.py +139 -0
  92. fathom_acoustics-1.2.0/src/fathom/gui/_analysis_views.py +325 -0
  93. fathom_acoustics-1.2.0/src/fathom/gui/_app.py +114 -0
  94. fathom_acoustics-1.2.0/src/fathom/gui/_axis_limits.py +307 -0
  95. fathom_acoustics-1.2.0/src/fathom/gui/_canvas.py +785 -0
  96. fathom_acoustics-1.2.0/src/fathom/gui/_channel_panels.py +1256 -0
  97. fathom_acoustics-1.2.0/src/fathom/gui/_channel_state.py +845 -0
  98. fathom_acoustics-1.2.0/src/fathom/gui/_channel_window.py +655 -0
  99. fathom_acoustics-1.2.0/src/fathom/gui/_forms.py +449 -0
  100. fathom_acoustics-1.2.0/src/fathom/gui/_generator.py +584 -0
  101. fathom_acoustics-1.2.0/src/fathom/gui/_image_views.py +449 -0
  102. fathom_acoustics-1.2.0/src/fathom/gui/_live_view.py +331 -0
  103. fathom_acoustics-1.2.0/src/fathom/gui/_panels.py +528 -0
  104. fathom_acoustics-1.2.0/src/fathom/gui/_qt.py +33 -0
  105. fathom_acoustics-1.2.0/src/fathom/gui/_session.py +266 -0
  106. fathom_acoustics-1.2.0/src/fathom/gui/_spectrum_view.py +164 -0
  107. fathom_acoustics-1.2.0/src/fathom/gui/_state.py +282 -0
  108. fathom_acoustics-1.2.0/src/fathom/gui/_style.py +164 -0
  109. fathom_acoustics-1.2.0/src/fathom/gui/_tasks.py +180 -0
  110. fathom_acoustics-1.2.0/src/fathom/gui/_time_view.py +297 -0
  111. fathom_acoustics-1.2.0/src/fathom/gui/_view_base.py +314 -0
  112. fathom_acoustics-1.2.0/src/fathom/gui/_window.py +260 -0
  113. fathom_acoustics-1.2.0/src/fathom/io/__init__.py +271 -0
  114. fathom_acoustics-1.2.0/src/fathom/io/_audio.py +323 -0
  115. fathom_acoustics-1.2.0/src/fathom/io/_common.py +284 -0
  116. fathom_acoustics-1.2.0/src/fathom/io/_csv.py +270 -0
  117. fathom_acoustics-1.2.0/src/fathom/io/_hdf5.py +236 -0
  118. fathom_acoustics-1.2.0/src/fathom/io/_mat.py +360 -0
  119. fathom_acoustics-1.2.0/src/fathom/io/_netcdf.py +181 -0
  120. fathom_acoustics-1.2.0/src/fathom/io/_numpy.py +264 -0
  121. fathom_acoustics-1.2.0/src/fathom/io/_plot.py +32 -0
  122. fathom_acoustics-1.2.0/src/fathom/io/_raw.py +225 -0
  123. fathom_acoustics-1.2.0/src/fathom/io/_redpitaya.py +132 -0
  124. fathom_acoustics-1.2.0/src/fathom/io/_registry.py +368 -0
  125. fathom_acoustics-1.2.0/src/fathom/io/_sigmf.py +353 -0
  126. fathom_acoustics-1.2.0/src/fathom/io/_tdms.py +157 -0
  127. fathom_acoustics-1.2.0/src/fathom/io/_zarr.py +149 -0
  128. fathom_acoustics-1.2.0/src/fathom/jupyter/__init__.py +91 -0
  129. fathom_acoustics-1.2.0/src/fathom/jupyter/_display.py +558 -0
  130. fathom_acoustics-1.2.0/src/fathom/jupyter/_lab.py +170 -0
  131. fathom_acoustics-1.2.0/src/fathom/jupyter/_magics.py +243 -0
  132. fathom_acoustics-1.2.0/src/fathom/jupyter/_session.py +594 -0
  133. fathom_acoustics-1.2.0/src/fathom/jupyter/_widget.py +544 -0
  134. fathom_acoustics-1.2.0/src/fathom/jupyter/static/signal_view.css +129 -0
  135. fathom_acoustics-1.2.0/src/fathom/jupyter/static/signal_view.js +882 -0
  136. fathom_acoustics-1.2.0/src/fathom/mcp/__init__.py +95 -0
  137. fathom_acoustics-1.2.0/src/fathom/mcp/_docs.py +100 -0
  138. fathom_acoustics-1.2.0/src/fathom/mcp/_guard.py +207 -0
  139. fathom_acoustics-1.2.0/src/fathom/mcp/_jobs.py +230 -0
  140. fathom_acoustics-1.2.0/src/fathom/mcp/_resources.py +250 -0
  141. fathom_acoustics-1.2.0/src/fathom/mcp/_server.py +506 -0
  142. fathom_acoustics-1.2.0/src/fathom/mcp/_tools.py +1518 -0
  143. fathom_acoustics-1.2.0/src/fathom/models/__init__.py +111 -0
  144. fathom_acoustics-1.2.0/src/fathom/models/_block.py +974 -0
  145. fathom_acoustics-1.2.0/src/fathom/models/_catalog.py +104 -0
  146. fathom_acoustics-1.2.0/src/fathom/models/_dsp.py +258 -0
  147. fathom_acoustics-1.2.0/src/fathom/models/_engine.py +842 -0
  148. fathom_acoustics-1.2.0/src/fathom/models/_graph.py +1070 -0
  149. fathom_acoustics-1.2.0/src/fathom/models/_medium.py +78 -0
  150. fathom_acoustics-1.2.0/src/fathom/models/_rng.py +88 -0
  151. fathom_acoustics-1.2.0/src/fathom/models/_sweep.py +307 -0
  152. fathom_acoustics-1.2.0/src/fathom/models/blocks/__init__.py +40 -0
  153. fathom_acoustics-1.2.0/src/fathom/models/blocks/absorption.py +341 -0
  154. fathom_acoustics-1.2.0/src/fathom/models/blocks/basic.py +89 -0
  155. fathom_acoustics-1.2.0/src/fathom/models/blocks/boundaries.py +280 -0
  156. fathom_acoustics-1.2.0/src/fathom/models/blocks/delay.py +705 -0
  157. fathom_acoustics-1.2.0/src/fathom/models/blocks/electronics.py +476 -0
  158. fathom_acoustics-1.2.0/src/fathom/models/blocks/multipath.py +410 -0
  159. fathom_acoustics-1.2.0/src/fathom/models/blocks/noise.py +448 -0
  160. fathom_acoustics-1.2.0/src/fathom/models/blocks/nonlinear.py +126 -0
  161. fathom_acoustics-1.2.0/src/fathom/models/blocks/propagation.py +248 -0
  162. fathom_acoustics-1.2.0/src/fathom/models/blocks/response.py +180 -0
  163. fathom_acoustics-1.2.0/src/fathom/models/blocks/sources.py +219 -0
  164. fathom_acoustics-1.2.0/src/fathom/models/blocks/transducers.py +333 -0
  165. fathom_acoustics-1.2.0/src/fathom/models/blocks/utility.py +571 -0
  166. fathom_acoustics-1.2.0/src/fathom/plotting.py +934 -0
  167. fathom_acoustics-1.2.0/src/fathom/py.typed +0 -0
  168. fathom_acoustics-1.2.0/src/fathom/schema/__init__.py +67 -0
  169. fathom_acoustics-1.2.0/src/fathom/schema/_catalog.py +204 -0
  170. fathom_acoustics-1.2.0/src/fathom/schema/_functions.py +706 -0
  171. fathom_acoustics-1.2.0/src/fathom/signals/__init__.py +101 -0
  172. fathom_acoustics-1.2.0/src/fathom/signals/_arbitrary.py +205 -0
  173. fathom_acoustics-1.2.0/src/fathom/signals/_codes.py +191 -0
  174. fathom_acoustics-1.2.0/src/fathom/signals/_common.py +273 -0
  175. fathom_acoustics-1.2.0/src/fathom/signals/_impulses.py +224 -0
  176. fathom_acoustics-1.2.0/src/fathom/signals/_metadata.py +280 -0
  177. fathom_acoustics-1.2.0/src/fathom/signals/_modulation.py +438 -0
  178. fathom_acoustics-1.2.0/src/fathom/signals/_noise.py +199 -0
  179. fathom_acoustics-1.2.0/src/fathom/signals/_signal.py +514 -0
  180. fathom_acoustics-1.2.0/src/fathom/signals/_sweeps.py +189 -0
  181. fathom_acoustics-1.2.0/src/fathom/signals/_tones.py +265 -0
  182. fathom_acoustics-1.2.0/src/fathom/stream/__init__.py +41 -0
  183. fathom_acoustics-1.2.0/src/fathom/stream/_live.py +175 -0
  184. fathom_acoustics-1.2.0/src/fathom/stream/fsp.py +565 -0
  185. fathom_acoustics-1.2.0/src/fathom/stream/include/fsp.h +130 -0
  186. fathom_acoustics-1.2.0/src/fathom/theme/__init__.py +650 -0
  187. fathom_acoustics-1.2.0/src/fathom/theme/_tokens.py +126 -0
  188. fathom_acoustics-1.2.0/src/fathom/units.py +182 -0
  189. fathom_acoustics-1.2.0/src/fathom/workspace/__init__.py +85 -0
  190. fathom_acoustics-1.2.0/src/fathom/workspace/_api.py +327 -0
  191. fathom_acoustics-1.2.0/src/fathom/workspace/_client.py +490 -0
  192. fathom_acoustics-1.2.0/src/fathom/workspace/_local.py +218 -0
  193. fathom_acoustics-1.2.0/src/fathom/workspace/_protocol.py +145 -0
  194. fathom_acoustics-1.2.0/src/fathom/workspace/_service.py +561 -0
  195. fathom_acoustics-1.2.0/src/fathom/workspace/_store.py +1028 -0
  196. fathom_acoustics-1.2.0/tests/conftest.py +11 -0
  197. fathom_acoustics-1.2.0/tests/gui_helpers.py +32 -0
  198. fathom_acoustics-1.2.0/tests/mcp_helpers.py +41 -0
  199. fathom_acoustics-1.2.0/tests/public_api.json +6707 -0
  200. fathom_acoustics-1.2.0/tests/test_analysis_ambiguity.py +165 -0
  201. fathom_acoustics-1.2.0/tests/test_analysis_correlation.py +109 -0
  202. fathom_acoustics-1.2.0/tests/test_analysis_detection.py +183 -0
  203. fathom_acoustics-1.2.0/tests/test_analysis_measure.py +170 -0
  204. fathom_acoustics-1.2.0/tests/test_analysis_spectral.py +242 -0
  205. fathom_acoustics-1.2.0/tests/test_architecture.py +295 -0
  206. fathom_acoustics-1.2.0/tests/test_block_catalog.py +56 -0
  207. fathom_acoustics-1.2.0/tests/test_cli.py +558 -0
  208. fathom_acoustics-1.2.0/tests/test_cli_model.py +183 -0
  209. fathom_acoustics-1.2.0/tests/test_decimate.py +116 -0
  210. fathom_acoustics-1.2.0/tests/test_docs_examples.py +59 -0
  211. fathom_acoustics-1.2.0/tests/test_fsp.py +368 -0
  212. fathom_acoustics-1.2.0/tests/test_generators.py +621 -0
  213. fathom_acoustics-1.2.0/tests/test_gui_channel.py +721 -0
  214. fathom_acoustics-1.2.0/tests/test_gui_forms.py +171 -0
  215. fathom_acoustics-1.2.0/tests/test_gui_gate.py +274 -0
  216. fathom_acoustics-1.2.0/tests/test_gui_session.py +63 -0
  217. fathom_acoustics-1.2.0/tests/test_gui_studio.py +888 -0
  218. fathom_acoustics-1.2.0/tests/test_io_detect.py +280 -0
  219. fathom_acoustics-1.2.0/tests/test_io_formats.py +898 -0
  220. fathom_acoustics-1.2.0/tests/test_io_roundtrip.py +265 -0
  221. fathom_acoustics-1.2.0/tests/test_jupyter.py +737 -0
  222. fathom_acoustics-1.2.0/tests/test_jupyter_display.py +253 -0
  223. fathom_acoustics-1.2.0/tests/test_jupyter_widget.py +448 -0
  224. fathom_acoustics-1.2.0/tests/test_live.py +165 -0
  225. fathom_acoustics-1.2.0/tests/test_mcp_gate.py +151 -0
  226. fathom_acoustics-1.2.0/tests/test_mcp_guard_jobs.py +197 -0
  227. fathom_acoustics-1.2.0/tests/test_mcp_schema.py +278 -0
  228. fathom_acoustics-1.2.0/tests/test_mcp_sdk_additions.py +213 -0
  229. fathom_acoustics-1.2.0/tests/test_mcp_server.py +280 -0
  230. fathom_acoustics-1.2.0/tests/test_mcp_tools.py +680 -0
  231. fathom_acoustics-1.2.0/tests/test_models_absorption.py +300 -0
  232. fathom_acoustics-1.2.0/tests/test_models_blocks.py +909 -0
  233. fathom_acoustics-1.2.0/tests/test_models_core.py +832 -0
  234. fathom_acoustics-1.2.0/tests/test_models_delay.py +415 -0
  235. fathom_acoustics-1.2.0/tests/test_models_inspect.py +230 -0
  236. fathom_acoustics-1.2.0/tests/test_models_multipath.py +523 -0
  237. fathom_acoustics-1.2.0/tests/test_models_propagation.py +386 -0
  238. fathom_acoustics-1.2.0/tests/test_models_response.py +182 -0
  239. fathom_acoustics-1.2.0/tests/test_notebooks.py +66 -0
  240. fathom_acoustics-1.2.0/tests/test_plotting.py +235 -0
  241. fathom_acoustics-1.2.0/tests/test_release_config.py +403 -0
  242. fathom_acoustics-1.2.0/tests/test_requirements.py +68 -0
  243. fathom_acoustics-1.2.0/tests/test_signal.py +301 -0
  244. fathom_acoustics-1.2.0/tests/test_theme_studio.py +80 -0
  245. fathom_acoustics-1.2.0/tests/test_tooling.py +46 -0
  246. fathom_acoustics-1.2.0/tests/test_units_theme.py +161 -0
  247. fathom_acoustics-1.2.0/tests/test_workspace.py +555 -0
  248. fathom_acoustics-1.2.0/tests/test_workspace_service.py +637 -0
  249. fathom_acoustics-1.2.0/tests/traceability.py +162 -0
@@ -0,0 +1,38 @@
1
+ """Print the CHANGELOG.md section for a version (used by the release workflow).
2
+
3
+ Usage: python changelog_section.py 1.2.0
4
+
5
+ The section starts at a heading ``## [1.2.0]`` (or ``## 1.2.0``) and ends at
6
+ the next ``## `` heading. If there is no such section, print a short note.
7
+ """
8
+
9
+ from __future__ import annotations
10
+
11
+ import re
12
+ import sys
13
+ from pathlib import Path
14
+
15
+
16
+ def section(text: str, version: str) -> str:
17
+ pattern = re.compile(rf"^## \[?v?{re.escape(version)}\]?.*$", re.MULTILINE)
18
+ match = pattern.search(text)
19
+ if not match:
20
+ return f"Release {version}. See CHANGELOG.md for details.\n"
21
+ rest = text[match.end() :]
22
+ nxt = re.search(r"^## ", rest, re.MULTILINE)
23
+ body = rest[: nxt.start()] if nxt else rest
24
+ return body.strip() + "\n"
25
+
26
+
27
+ def main() -> int:
28
+ if len(sys.argv) != 2:
29
+ print(__doc__, file=sys.stderr)
30
+ return 1
31
+ root = Path(__file__).resolve().parents[2]
32
+ text = (root / "CHANGELOG.md").read_text(encoding="utf-8")
33
+ sys.stdout.write(section(text, sys.argv[1]))
34
+ return 0
35
+
36
+
37
+ if __name__ == "__main__":
38
+ sys.exit(main())
@@ -0,0 +1,238 @@
1
+ name: CI
2
+
3
+ # PKG-010: each push and pull request runs ruff, the type check, the tests and
4
+ # a docs build. The OS set changes with the event, to keep the macOS (10x) and
5
+ # Windows (2x) billed minutes low:
6
+ # - Push to a branch other than main: Linux only, Python 3.12 to 3.14.
7
+ # - Pull request or push to main: Linux on 3.12 to 3.14, and macOS and
8
+ # Windows on Python 3.13.
9
+ # - Release (a tag push that calls this workflow): 3 OSes x 3 Python
10
+ # versions (NFR-014).
11
+ # NFR-003: benchmarks run and
12
+ # fail when one is more than 20 % slower than the last release. JUP-009: the
13
+ # example notebooks run on 3 OSes from recorded data, with no hardware. The
14
+ # M2 gate (tests/test_mcp_gate.py) runs `fathom mcp` on stdio in the tests.
15
+ # NFR-009: the studio tests run headless with pytest-qt and the Qt offscreen
16
+ # platform. The M4 gate (SIG-003, SIG-004) runs in its own job, with no
17
+ # coverage tracing, because it measures time. The M5 gate (all P1
18
+ # requirements verified, tests/test_requirements.py) runs with the tests.
19
+ # NFR-014: CPython 3.12 to 3.14 on Linux x86_64, macOS arm64 and Windows
20
+ # x86_64, and Linux arm64. Intel Macs are not supported (roadmap decision).
21
+
22
+ on:
23
+ push:
24
+ branches: ["**"]
25
+ pull_request:
26
+ workflow_call:
27
+
28
+ permissions:
29
+ contents: read
30
+
31
+ concurrency:
32
+ group: ci-${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }}
33
+ cancel-in-progress: ${{ github.event_name != 'workflow_call' }}
34
+
35
+ env:
36
+ UV_PYTHON_PREFERENCE: only-managed
37
+ PYTHONUTF8: "1"
38
+ QT_QPA_PLATFORM: offscreen
39
+
40
+ jobs:
41
+ lint:
42
+ name: Lint and type check
43
+ runs-on: ubuntu-latest
44
+ steps:
45
+ - uses: actions/checkout@v4
46
+ with:
47
+ fetch-depth: 0
48
+ - uses: astral-sh/setup-uv@v6
49
+ with:
50
+ python-version: "3.13"
51
+ - run: uv sync --locked --group lint
52
+ - run: uv run ruff check .
53
+ - run: uv run ruff format --check .
54
+ - run: uv run mypy
55
+
56
+ test:
57
+ name: Test (${{ matrix.os }}, Python ${{ matrix.python }})
58
+ runs-on: ${{ matrix.os }}
59
+ strategy:
60
+ fail-fast: false
61
+ matrix:
62
+ # Branch pushes (not main) run on Linux only. See the header.
63
+ os: ${{ fromJSON((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main') && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "windows-latest"]') }}
64
+ # NFR-014 asks for the three latest CPython minor versions. 3.15 is
65
+ # out, but h5py, PyYAML and numcodecs have no 3.15 wheels yet. Move the
66
+ # window when they do.
67
+ python: ["3.12", "3.13", "3.14"]
68
+ # macOS and Windows run all three versions only for a release (tag).
69
+ exclude: ${{ fromJSON(startsWith(github.ref, 'refs/tags/') && '[]' || '[{"os":"macos-latest", "python":"3.12"}, {"os":"macos-latest", "python":"3.14"}, {"os":"windows-latest", "python":"3.12"}, {"os":"windows-latest", "python":"3.14"}]') }}
70
+ steps:
71
+ - uses: actions/checkout@v4
72
+ with:
73
+ fetch-depth: 0
74
+ - uses: astral-sh/setup-uv@v6
75
+ with:
76
+ python-version: ${{ matrix.python }}
77
+ - name: Qt system libraries (Linux)
78
+ if: runner.os == 'Linux'
79
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
80
+ - run: uv sync --locked --group test
81
+ - name: Tests with coverage (NFR-008, 85 % or more)
82
+ run: uv run pytest --cov --cov-report=term --cov-report=xml
83
+ - name: CLI smoke test
84
+ shell: bash
85
+ run: |
86
+ uv run fathom --version
87
+ uv run fathom gen lfm --f0 8k --f1 12k --dur 10ms --fs 500k -o - \
88
+ | uv run fathom analyze psd - --json > psd.json
89
+ uv run python -c "import json; assert json.load(open('psd.json'))['result']['nfft'] == 4096"
90
+ uv run fathom model blocks --json > blocks.json
91
+ uv run fathom gen lfm --f0 8k --f1 12k --dur 10ms --fs 200k -o ping.wav
92
+ uv run fathom model run examples/models/harbor_multipath.yaml \
93
+ --in ping_lfm=ping.wav -o rx.sigmf-meta --json > run.json
94
+ uv run python -c "import json; assert json.load(open('run.json'))['outputs']"
95
+ uv run fathom mcp --help > /dev/null
96
+ uv run fathom studio --help > /dev/null
97
+ uv run fathom model edit --help > /dev/null
98
+
99
+ test-arm64:
100
+ name: Test (ubuntu-24.04-arm, Python 3.13)
101
+ # GitHub gives arm64 Linux runners to public repositories. A private
102
+ # repository runs this job when the variable LINUX_ARM64_RUNNER is true.
103
+ if: ${{ !github.event.repository.private || vars.LINUX_ARM64_RUNNER == 'true' }}
104
+ runs-on: ubuntu-24.04-arm
105
+ steps:
106
+ - uses: actions/checkout@v4
107
+ with:
108
+ fetch-depth: 0
109
+ - uses: astral-sh/setup-uv@v6
110
+ with:
111
+ python-version: "3.13"
112
+ - name: Qt system libraries
113
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
114
+ - run: uv sync --locked --group test
115
+ - run: uv run pytest -q
116
+
117
+ gate:
118
+ name: M4 gate, Signal Studio performance (${{ matrix.os }})
119
+ runs-on: ${{ matrix.os }}
120
+ strategy:
121
+ fail-fast: false
122
+ matrix:
123
+ # Branch pushes (not main) run on Linux only. See the header.
124
+ os: ${{ fromJSON((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main') && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "windows-latest"]') }}
125
+ steps:
126
+ - uses: actions/checkout@v4
127
+ with:
128
+ fetch-depth: 0
129
+ - uses: astral-sh/setup-uv@v6
130
+ with:
131
+ python-version: "3.13"
132
+ - name: Qt system libraries (Linux)
133
+ if: runner.os == 'Linux'
134
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
135
+ - run: uv sync --locked --group test
136
+ - name: SIG-003 preview latency and SIG-004 pan and zoom of a 1e8-sample record
137
+ run: uv run pytest -m gate tests/test_gui_gate.py -v -s
138
+
139
+ notebooks:
140
+ name: Example notebooks (${{ matrix.os }})
141
+ runs-on: ${{ matrix.os }}
142
+ strategy:
143
+ fail-fast: false
144
+ matrix:
145
+ # Branch pushes (not main) run on Linux only. See the header.
146
+ os: ${{ fromJSON((github.event_name == 'push' && startsWith(github.ref, 'refs/heads/') && github.ref != 'refs/heads/main') && '["ubuntu-latest"]' || '["ubuntu-latest", "macos-latest", "windows-latest"]') }}
147
+ steps:
148
+ - uses: actions/checkout@v4
149
+ with:
150
+ fetch-depth: 0
151
+ - uses: astral-sh/setup-uv@v6
152
+ with:
153
+ python-version: "3.13"
154
+ - name: Qt system libraries (Linux)
155
+ if: runner.os == 'Linux'
156
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
157
+ - run: uv sync --locked --group test
158
+ - name: Run the example notebooks from recorded data (JUP-009)
159
+ env:
160
+ FATHOM_NOTEBOOK_OUT: executed-notebooks
161
+ run: uv run pytest -m notebook tests/test_notebooks.py -v
162
+ - uses: actions/upload-artifact@v4
163
+ if: always()
164
+ with:
165
+ name: executed-notebooks-${{ matrix.os }}
166
+ path: executed-notebooks/
167
+ if-no-files-found: ignore
168
+
169
+ docs:
170
+ name: Docs build
171
+ runs-on: ubuntu-latest
172
+ steps:
173
+ - uses: actions/checkout@v4
174
+ with:
175
+ fetch-depth: 0
176
+ - uses: astral-sh/setup-uv@v6
177
+ with:
178
+ python-version: "3.13"
179
+ - run: uv sync --locked --group docs
180
+ - run: uv run mkdocs build --strict
181
+
182
+ build:
183
+ name: Build wheel and sdist
184
+ runs-on: ubuntu-latest
185
+ steps:
186
+ - uses: actions/checkout@v4
187
+ with:
188
+ fetch-depth: 0
189
+ - uses: astral-sh/setup-uv@v6
190
+ with:
191
+ python-version: "3.13"
192
+ - run: uv build
193
+ - name: Install the wheel in a clean environment
194
+ run: |
195
+ uv venv /tmp/wheel-env
196
+ uv pip install --python /tmp/wheel-env dist/*.whl
197
+ /tmp/wheel-env/bin/fathom --version
198
+ /tmp/wheel-env/bin/python -c "import fathom.stream as s, pathlib; assert pathlib.Path(s.c_header_path()).is_file()"
199
+ # PKG-005: with no [mcp] extra, fathom.mcp imports and `fathom mcp` names the extra.
200
+ /tmp/wheel-env/bin/python -c "import fathom.mcp as m; assert len(m.tools()) == 11"
201
+ if /tmp/wheel-env/bin/fathom mcp --project /tmp 2> mcp.err; then exit 1; fi
202
+ grep -q 'fathom-acoustics\[mcp\]' mcp.err
203
+ # With no [gui] extra, fathom.gui imports and `fathom studio` names the extra.
204
+ /tmp/wheel-env/bin/python -c "import fathom.gui as g; assert not g.qt_available()"
205
+ if /tmp/wheel-env/bin/fathom studio --project /tmp 2> studio.err; then exit 1; fi
206
+ grep -q 'fathom-acoustics\[gui\]' studio.err
207
+ if /tmp/wheel-env/bin/fathom model edit --project /tmp 2> edit.err; then exit 1; fi
208
+ grep -q 'fathom-acoustics\[gui\]' edit.err
209
+ - uses: actions/upload-artifact@v4
210
+ with:
211
+ name: dist
212
+ path: dist/
213
+
214
+ benchmarks:
215
+ name: Benchmarks against the last release
216
+ runs-on: ubuntu-latest
217
+ steps:
218
+ - uses: actions/checkout@v4
219
+ with:
220
+ fetch-depth: 0
221
+ - uses: astral-sh/setup-uv@v6
222
+ with:
223
+ python-version: "3.13"
224
+ - name: Qt system libraries (pytest-qt loads Qt at the start of pytest)
225
+ run: sudo apt-get update && sudo apt-get install -y libegl1 libxkbcommon0 libfontconfig1 libdbus-1-3
226
+ - run: uv sync --locked --group test
227
+ - run: uv run pytest benchmarks --benchmark-only --benchmark-json=benchmarks.json -q
228
+ - name: Get the baseline from the latest release
229
+ env:
230
+ GH_TOKEN: ${{ github.token }}
231
+ run: |
232
+ gh release download --repo "$GITHUB_REPOSITORY" --pattern benchmarks.json \
233
+ --output baseline.json || echo "No release baseline yet."
234
+ - run: uv run python benchmarks/compare.py benchmarks.json baseline.json --threshold 0.20
235
+ - uses: actions/upload-artifact@v4
236
+ with:
237
+ name: benchmarks
238
+ path: benchmarks.json
@@ -0,0 +1,52 @@
1
+ name: Docs site
2
+
3
+ # NFR-010: the docs site holds the API reference from the docstrings and the
4
+ # block catalog from the block schemas. UI-001: it follows the SIGE dark
5
+ # design language. The release of a version vX.Y.Z publishes the site to
6
+ # GitHub Pages; the release files also hold the site as a zip archive.
7
+ # GitHub Pages must be on in the repository settings (source: GitHub Actions).
8
+
9
+ on:
10
+ workflow_call:
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ concurrency:
17
+ group: pages
18
+ cancel-in-progress: false
19
+
20
+ env:
21
+ UV_PYTHON_PREFERENCE: only-managed
22
+
23
+ jobs:
24
+ build:
25
+ name: Build the site
26
+ runs-on: ubuntu-latest
27
+ steps:
28
+ - uses: actions/checkout@v4
29
+ with:
30
+ fetch-depth: 0
31
+ - uses: astral-sh/setup-uv@v6
32
+ with:
33
+ python-version: "3.13"
34
+ - run: uv sync --locked --group docs
35
+ - run: uv run mkdocs build --strict
36
+ - uses: actions/upload-pages-artifact@v3
37
+ with:
38
+ path: site/
39
+
40
+ deploy:
41
+ name: Publish to GitHub Pages
42
+ needs: build
43
+ runs-on: ubuntu-latest
44
+ permissions:
45
+ pages: write
46
+ id-token: write
47
+ environment:
48
+ name: github-pages
49
+ url: ${{ steps.deployment.outputs.page_url }}
50
+ steps:
51
+ - id: deployment
52
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,309 @@
1
+ name: Installers
2
+
3
+ # PKG-006: desktop installers for macOS arm64 (.pkg) and Linux x64 (.sh),
4
+ # built with constructor on a conda-based environment. Each holds Python,
5
+ # JupyterLab and the packages of all extras. Only the fathom conda package is
6
+ # built here (rattler-build, from the wheel of `uv build`); conda-forge has all
7
+ # other packages. BELLHOP (GPL) is not bundled (NFR-013). There is no Windows
8
+ # installer (decided 2026-11-17); the PyPI wheel still installs on Windows.
9
+ # PKG-007: with sign=true, the macOS installer gets a Developer ID signature
10
+ # and notarization. A signed build fails if a signing secret is missing.
11
+ # PKG-008: each installer installs on a clean runner and passes the smoke test
12
+ # (installer/smoke_test.py): `fathom --version`, the extras, both studios, a
13
+ # kernel, and one example notebook.
14
+ #
15
+ # The release workflow calls this workflow with sign=true. A push or a pull
16
+ # request that changes the installer files runs it unsigned. To test the
17
+ # signature and the notarization before a release, start this workflow by
18
+ # hand (Actions > Installers > Run workflow) with sign=true.
19
+ #
20
+ # Signing secrets (macOS), see docs/releases.md:
21
+ # MACOS_APP_CERTIFICATE_P12, MACOS_INSTALLER_CERTIFICATE_P12 (base64),
22
+ # MACOS_CERTIFICATE_PASSWORD, MACOS_APP_IDENTITY, MACOS_INSTALLER_IDENTITY,
23
+ # APPLE_ID, APPLE_TEAM_ID, APPLE_APP_PASSWORD (notarytool)
24
+
25
+ on:
26
+ workflow_call:
27
+ inputs:
28
+ version:
29
+ description: Package version (empty = from git)
30
+ type: string
31
+ default: ""
32
+ sign:
33
+ description: Sign and notarize the installers (PKG-007)
34
+ type: boolean
35
+ default: false
36
+ workflow_dispatch:
37
+ inputs:
38
+ sign:
39
+ description: Sign and notarize the installers (PKG-007)
40
+ type: boolean
41
+ default: false
42
+ push:
43
+ branches: ["**"]
44
+ paths:
45
+ - "installer/**"
46
+ - ".github/workflows/installers.yml"
47
+ pull_request:
48
+ paths:
49
+ - "installer/**"
50
+ - ".github/workflows/installers.yml"
51
+
52
+ permissions:
53
+ contents: read
54
+
55
+ concurrency:
56
+ group: installers-${{ github.ref }}-${{ github.event_name }}
57
+ cancel-in-progress: ${{ github.event_name != 'workflow_call' }}
58
+
59
+ env:
60
+ UV_PYTHON_PREFERENCE: only-managed
61
+ PYTHONUTF8: "1"
62
+
63
+ jobs:
64
+ package:
65
+ name: Conda package (noarch)
66
+ runs-on: ubuntu-latest
67
+ outputs:
68
+ version: ${{ steps.version.outputs.version }}
69
+ steps:
70
+ - uses: actions/checkout@v4
71
+ with:
72
+ fetch-depth: 0
73
+ - uses: astral-sh/setup-uv@v6
74
+ with:
75
+ python-version: "3.13"
76
+ - name: Version (PKG-002)
77
+ id: version
78
+ shell: bash
79
+ run: |
80
+ version="${{ inputs.version }}"
81
+ if [[ -z "$version" ]]; then
82
+ version=$(uvx --from hatchling --with hatch-vcs hatchling version)
83
+ version="${version%%+*}" # conda versions have no local part
84
+ fi
85
+ echo "version=$version" >> "$GITHUB_OUTPUT"
86
+ echo "Version: $version"
87
+ - name: Wheel
88
+ env:
89
+ SETUPTOOLS_SCM_PRETEND_VERSION: ${{ steps.version.outputs.version }}
90
+ run: uv build --wheel
91
+ - name: Icons from the SIGE tokens
92
+ run: |
93
+ uv sync --locked
94
+ uv run python installer/make_icons.py installer/recipe/menu
95
+ - uses: mamba-org/setup-micromamba@v2
96
+ with:
97
+ environment-name: build
98
+ create-args: rattler-build python=3.13
99
+ init-shell: bash
100
+ - name: Build the conda package
101
+ shell: bash -el {0}
102
+ env:
103
+ FATHOM_VERSION: ${{ steps.version.outputs.version }}
104
+ run: rattler-build build --recipe installer/recipe --output-dir build/channel -c conda-forge
105
+ - uses: actions/upload-artifact@v4
106
+ with:
107
+ name: conda-channel
108
+ path: build/channel/
109
+ if-no-files-found: error
110
+
111
+ installer:
112
+ name: Installer (${{ matrix.platform }})
113
+ needs: package
114
+ runs-on: ${{ matrix.os }}
115
+ strategy:
116
+ fail-fast: false
117
+ matrix:
118
+ include:
119
+ - { os: macos-latest, platform: osx-arm64, ext: pkg }
120
+ - { os: ubuntu-latest, platform: linux-64, ext: sh }
121
+ env:
122
+ FATHOM_VERSION: ${{ needs.package.outputs.version }}
123
+ SIGN: ${{ inputs.sign && 'true' || 'false' }}
124
+ MACOS_APP_CERTIFICATE_P12: ${{ secrets.MACOS_APP_CERTIFICATE_P12 }}
125
+ MACOS_INSTALLER_CERTIFICATE_P12: ${{ secrets.MACOS_INSTALLER_CERTIFICATE_P12 }}
126
+ MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
127
+ APPLE_ID: ${{ secrets.APPLE_ID }}
128
+ APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
129
+ APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
130
+ steps:
131
+ - uses: actions/checkout@v4
132
+ - uses: actions/download-artifact@v4
133
+ with:
134
+ name: conda-channel
135
+ path: build/channel
136
+ - name: Check the signing secrets (PKG-007)
137
+ if: env.SIGN == 'true'
138
+ shell: bash
139
+ env:
140
+ MACOS_APP_IDENTITY: ${{ secrets.MACOS_APP_IDENTITY }}
141
+ MACOS_INSTALLER_IDENTITY: ${{ secrets.MACOS_INSTALLER_IDENTITY }}
142
+ run: |
143
+ case "${{ matrix.platform }}" in
144
+ osx-*) need="MACOS_APP_CERTIFICATE_P12 MACOS_INSTALLER_CERTIFICATE_P12 MACOS_CERTIFICATE_PASSWORD MACOS_APP_IDENTITY MACOS_INSTALLER_IDENTITY APPLE_ID APPLE_TEAM_ID APPLE_APP_PASSWORD" ;;
145
+ *) need="" ;;
146
+ esac
147
+ missing=""
148
+ for v in $need; do [[ -n "${!v:-}" ]] || missing="$missing $v"; done
149
+ if [[ -n "$missing" ]]; then
150
+ echo "::error::A signed build needs these secrets:$missing"
151
+ exit 1
152
+ fi
153
+ - name: Signing keychain (macOS)
154
+ if: env.SIGN == 'true' && runner.os == 'macOS'
155
+ shell: bash
156
+ env:
157
+ MACOS_APP_IDENTITY: ${{ secrets.MACOS_APP_IDENTITY }}
158
+ MACOS_INSTALLER_IDENTITY: ${{ secrets.MACOS_INSTALLER_IDENTITY }}
159
+ run: |
160
+ keychain="$RUNNER_TEMP/signing.keychain-db"
161
+ password=$(openssl rand -base64 24)
162
+ security create-keychain -p "$password" "$keychain"
163
+ security set-keychain-settings -lut 21600 "$keychain"
164
+ security unlock-keychain -p "$password" "$keychain"
165
+ for var in MACOS_APP_CERTIFICATE_P12 MACOS_INSTALLER_CERTIFICATE_P12; do
166
+ echo "${!var}" | base64 --decode > "$RUNNER_TEMP/cert.p12"
167
+ security import "$RUNNER_TEMP/cert.p12" -k "$keychain" -P "$MACOS_CERTIFICATE_PASSWORD" \
168
+ -T /usr/bin/codesign -T /usr/bin/productsign -T /usr/bin/pkgbuild
169
+ done
170
+ rm -f "$RUNNER_TEMP/cert.p12"
171
+ # The Developer ID G2 intermediate certificate: codesign and
172
+ # productsign need it to build the certificate chain.
173
+ ca="$RUNNER_TEMP/DeveloperIDG2CA.cer"
174
+ if curl -fsSL --retry 3 -o "$ca" https://www.apple.com/certificateauthority/DeveloperIDG2CA.cer; then
175
+ security import "$ca" -k "$keychain" || echo "The keychain has the intermediate certificate."
176
+ else
177
+ echo "::warning::The download of the Developer ID G2 intermediate certificate failed."
178
+ fi
179
+ security set-key-partition-list -S apple-tool:,apple: -s -k "$password" "$keychain"
180
+ security list-keychains -d user -s "$keychain" $(security list-keychains -d user | tr -d '"')
181
+ # A wrong identity secret fails here, before the installer build.
182
+ identities=$(security find-identity -p basic "$keychain")
183
+ echo "$identities"
184
+ for pair in "MACOS_APP_IDENTITY:Developer ID Application" \
185
+ "MACOS_INSTALLER_IDENTITY:Developer ID Installer"; do
186
+ name="${pair%%:*}" kind="${pair#*:}"
187
+ if [[ "${!name}" != "$kind: "* ]]; then
188
+ echo "::error::$name must be the name of the $kind certificate: \"$kind: <Team name> (<Team ID>)\"."
189
+ exit 1
190
+ fi
191
+ if ! grep -qF "${!name}" <<< "$identities"; then
192
+ echo "::error::No certificate in the .p12 files has the identity of $name."
193
+ exit 1
194
+ fi
195
+ done
196
+ echo "MACOS_APP_IDENTITY=$MACOS_APP_IDENTITY" >> "$GITHUB_ENV"
197
+ echo "MACOS_INSTALLER_IDENTITY=$MACOS_INSTALLER_IDENTITY" >> "$GITHUB_ENV"
198
+ - uses: mamba-org/setup-micromamba@v2
199
+ with:
200
+ environment-name: constructor
201
+ create-args: constructor conda-standalone python=3.13
202
+ init-shell: bash
203
+ - name: Build the installer with constructor
204
+ shell: bash -el {0}
205
+ run: |
206
+ export FATHOM_CHANNEL="$PWD/build/channel"
207
+ constructor installer --output-dir build/installers
208
+ ls -l build/installers
209
+ - name: Notarize (macOS)
210
+ if: env.SIGN == 'true' && runner.os == 'macOS'
211
+ shell: bash
212
+ run: |
213
+ pkg=$(ls build/installers/*.pkg)
214
+ pkgutil --check-signature "$pkg"
215
+ auth=(--apple-id "$APPLE_ID" --team-id "$APPLE_TEAM_ID" --password "$APPLE_APP_PASSWORD")
216
+ # notarytool can give exit code 0 for a rejected submission, so read the status.
217
+ result="$RUNNER_TEMP/notary.json"
218
+ xcrun notarytool submit "$pkg" "${auth[@]}" --wait --timeout 1h \
219
+ --output-format json > "$result" || true
220
+ field() {
221
+ python3 -c 'import json, sys; print(json.load(open(sys.argv[1])).get(sys.argv[2], ""))' \
222
+ "$result" "$1" 2> /dev/null || true
223
+ }
224
+ id=$(field id)
225
+ status=$(field status)
226
+ echo "Notarization: submission ${id:-none}, status ${status:-none}"
227
+ if [[ "$status" != "Accepted" ]]; then
228
+ cat "$result" || true
229
+ # The log gives the reason: each file with no valid signature, and why.
230
+ if [[ -n "$id" ]]; then xcrun notarytool log "$id" "${auth[@]}" || true; fi
231
+ echo "::error::The notary service did not accept the installer (status: ${status:-none})."
232
+ exit 1
233
+ fi
234
+ xcrun stapler staple "$pkg"
235
+ xcrun stapler validate "$pkg"
236
+ spctl --assess --type install --verbose=4 "$pkg"
237
+ - name: Checksum
238
+ shell: bash
239
+ run: |
240
+ cd build/installers
241
+ for f in AcousticWorkbench-*.${{ matrix.ext }}; do
242
+ python3 -c "import hashlib,sys; p=sys.argv[1]; print(hashlib.sha256(open(p,'rb').read()).hexdigest() + ' ' + p)" "$f" > "$f.sha256"
243
+ done
244
+ cat *.sha256
245
+ - uses: actions/upload-artifact@v4
246
+ with:
247
+ name: installer-${{ matrix.platform }}
248
+ path: |
249
+ build/installers/AcousticWorkbench-*.${{ matrix.ext }}
250
+ build/installers/AcousticWorkbench-*.sha256
251
+ if-no-files-found: error
252
+
253
+ smoke:
254
+ name: Smoke test on a clean runner (${{ matrix.platform }})
255
+ needs: [package, installer]
256
+ runs-on: ${{ matrix.os }}
257
+ strategy:
258
+ fail-fast: false
259
+ matrix:
260
+ include:
261
+ - { os: macos-latest, platform: osx-arm64 }
262
+ - { os: ubuntu-latest, platform: linux-64 }
263
+ env:
264
+ QT_QPA_PLATFORM: offscreen
265
+ VERSION: ${{ needs.package.outputs.version }}
266
+ steps:
267
+ - uses: actions/checkout@v4
268
+ with:
269
+ sparse-checkout: |
270
+ examples
271
+ installer
272
+ - uses: actions/download-artifact@v4
273
+ with:
274
+ name: installer-${{ matrix.platform }}
275
+ path: dl
276
+ - name: Install (Linux)
277
+ if: runner.os == 'Linux'
278
+ shell: bash
279
+ run: |
280
+ bash dl/AcousticWorkbench-*.sh -b -p "$HOME/AcousticWorkbench"
281
+ echo "PREFIX=$HOME/AcousticWorkbench" >> "$GITHUB_ENV"
282
+ echo "PY=$HOME/AcousticWorkbench/bin/python" >> "$GITHUB_ENV"
283
+ - name: Install (macOS)
284
+ if: runner.os == 'macOS'
285
+ shell: bash
286
+ run: |
287
+ installer -pkg dl/AcousticWorkbench-*.pkg -target CurrentUserHomeDirectory
288
+ # "Just me" with default_location_pkg: Applications gives ~/Applications/<pkg_name>,
289
+ # in lower case (constructor).
290
+ prefix=""
291
+ for cand in "$HOME/Applications/acousticworkbench" "$HOME/acousticworkbench" \
292
+ "/Applications/acousticworkbench"; do
293
+ if [[ -x "$cand/bin/python" ]]; then prefix="$cand"; break; fi
294
+ done
295
+ if [[ -z "$prefix" ]]; then
296
+ echo "::error::The installer made no environment in the expected places."
297
+ ls -la "$HOME" "$HOME/Applications" || true
298
+ pkgutil --pkgs | grep -i -E "acoustic|fathom" || true
299
+ find "$HOME" /Applications -maxdepth 4 -name conda-meta -type d 2>/dev/null || true
300
+ grep -i -E "acoustic|postinstall|error" /var/log/install.log | tail -40 || true
301
+ exit 1
302
+ fi
303
+ echo "PREFIX=$prefix" >> "$GITHUB_ENV"
304
+ echo "PY=$prefix/bin/python" >> "$GITHUB_ENV"
305
+ - name: Smoke test (PKG-008)
306
+ shell: bash
307
+ run: |
308
+ "$PY" installer/smoke_test.py --prefix "$PREFIX" --version "$VERSION" \
309
+ --notebook examples/notebooks/01_lfm_vs_hfm.ipynb