bitvf 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. bitvf-0.1.0/.github/workflows/ci.yml +114 -0
  2. bitvf-0.1.0/.github/workflows/docs.yml +64 -0
  3. bitvf-0.1.0/.github/workflows/release.yml +129 -0
  4. bitvf-0.1.0/.gitignore +22 -0
  5. bitvf-0.1.0/CHANGELOG.md +5 -0
  6. bitvf-0.1.0/CITATION.cff +39 -0
  7. bitvf-0.1.0/CMakeLists.txt +407 -0
  8. bitvf-0.1.0/LICENSE +339 -0
  9. bitvf-0.1.0/PKG-INFO +155 -0
  10. bitvf-0.1.0/README.md +124 -0
  11. bitvf-0.1.0/app/bitvf.cpp +661 -0
  12. bitvf-0.1.0/app/bitvf_field.cpp +145 -0
  13. bitvf-0.1.0/app/common.h +349 -0
  14. bitvf-0.1.0/cmake/bitvfConfig.cmake.in +26 -0
  15. bitvf-0.1.0/include/bitvf/BitVF.h +575 -0
  16. bitvf-0.1.0/include/bitvf/VoidFinder.h +1599 -0
  17. bitvf-0.1.0/include/bitvf/io.h +381 -0
  18. bitvf-0.1.0/pyproject.toml +85 -0
  19. bitvf-0.1.0/python/bitvf/__init__.py +81 -0
  20. bitvf-0.1.0/python/bitvf/__init__.pyi +1802 -0
  21. bitvf-0.1.0/python/bitvf/io.py +33 -0
  22. bitvf-0.1.0/python/bitvf/io.pyi +358 -0
  23. bitvf-0.1.0/python/bitvf/py.typed +0 -0
  24. bitvf-0.1.0/python/bitvf_python.cpp +2025 -0
  25. bitvf-0.1.0/src/Basins.cpp +371 -0
  26. bitvf-0.1.0/src/BitVFBox.cpp +352 -0
  27. bitvf-0.1.0/src/BitVFLightcone.cpp +335 -0
  28. bitvf-0.1.0/src/BoxGrid.cpp +205 -0
  29. bitvf-0.1.0/src/Checks.cpp +737 -0
  30. bitvf-0.1.0/src/Divergence.cpp +356 -0
  31. bitvf-0.1.0/src/LightconeBasins.cpp +229 -0
  32. bitvf-0.1.0/src/LightconeCentres.cpp +183 -0
  33. bitvf-0.1.0/src/LightconeDensities.cpp +200 -0
  34. bitvf-0.1.0/src/LightconeDivergence.cpp +546 -0
  35. bitvf-0.1.0/src/LightconeGrid.cpp +733 -0
  36. bitvf-0.1.0/src/LightconeSmoothing.cpp +185 -0
  37. bitvf-0.1.0/src/LightconeWatershed.cpp +177 -0
  38. bitvf-0.1.0/src/Readers.cpp +434 -0
  39. bitvf-0.1.0/src/Smoothing.cpp +203 -0
  40. bitvf-0.1.0/src/Support.cpp +139 -0
  41. bitvf-0.1.0/src/VoidFinderBox.cpp +385 -0
  42. bitvf-0.1.0/src/VoidFinderField.cpp +321 -0
  43. bitvf-0.1.0/src/VoidFinderLightcone.cpp +1070 -0
  44. bitvf-0.1.0/src/Watershed.cpp +317 -0
  45. bitvf-0.1.0/src/Writers.cpp +660 -0
  46. bitvf-0.1.0/src/internal.h +1630 -0
  47. bitvf-0.1.0/tests/check.h +88 -0
  48. bitvf-0.1.0/tests/determinism_hashes.json +172 -0
  49. bitvf-0.1.0/tests/executable/cases/box_empty_min.ini +16 -0
  50. bitvf-0.1.0/tests/executable/cases/box_missing_max.ini +15 -0
  51. bitvf-0.1.0/tests/executable/cases/box_not_above.ini +16 -0
  52. bitvf-0.1.0/tests/executable/cases/cmdline_dashed_file.ini +6 -0
  53. bitvf-0.1.0/tests/executable/cases/cmdline_help.ini +9 -0
  54. bitvf-0.1.0/tests/executable/cases/cmdline_help_and_more.ini +6 -0
  55. bitvf-0.1.0/tests/executable/cases/cmdline_missing_file.ini +6 -0
  56. bitvf-0.1.0/tests/executable/cases/cmdline_no_argument.ini +6 -0
  57. bitvf-0.1.0/tests/executable/cases/cmdline_two_arguments.ini +6 -0
  58. bitvf-0.1.0/tests/executable/cases/cmdline_unknown_option.ini +6 -0
  59. bitvf-0.1.0/tests/executable/cases/cmdline_version.ini +6 -0
  60. bitvf-0.1.0/tests/executable/cases/empty_many_box_max.ini +16 -0
  61. bitvf-0.1.0/tests/executable/cases/empty_many_mps.ini +15 -0
  62. bitvf-0.1.0/tests/executable/cases/field_cmdline_help.ini +10 -0
  63. bitvf-0.1.0/tests/executable/cases/field_cmdline_missing_file.ini +7 -0
  64. bitvf-0.1.0/tests/executable/cases/field_cmdline_no_argument.ini +7 -0
  65. bitvf-0.1.0/tests/executable/cases/field_cmdline_two_arguments.ini +7 -0
  66. bitvf-0.1.0/tests/executable/cases/field_cmdline_unknown_option.ini +7 -0
  67. bitvf-0.1.0/tests/executable/cases/field_cmdline_version.ini +7 -0
  68. bitvf-0.1.0/tests/executable/cases/field_comma.ini +25 -0
  69. bitvf-0.1.0/tests/executable/cases/field_irrelevant.ini +16 -0
  70. bitvf-0.1.0/tests/executable/cases/field_library_missing_column.ini +14 -0
  71. bitvf-0.1.0/tests/executable/cases/field_mps_default_unit.ini +13 -0
  72. bitvf-0.1.0/tests/executable/cases/field_mps_unit_written.ini +15 -0
  73. bitvf-0.1.0/tests/executable/cases/field_output_dir_file.ini +15 -0
  74. bitvf-0.1.0/tests/executable/cases/field_output_file.ini +14 -0
  75. bitvf-0.1.0/tests/executable/cases/field_range_mps.ini +14 -0
  76. bitvf-0.1.0/tests/executable/cases/field_run_1.ini +27 -0
  77. bitvf-0.1.0/tests/executable/cases/field_run_4.ini +27 -0
  78. bitvf-0.1.0/tests/executable/cases/field_sigma_zero.ini +15 -0
  79. bitvf-0.1.0/tests/executable/cases/field_three_column_centre.ini +14 -0
  80. bitvf-0.1.0/tests/executable/cases/geometry_cube.ini +14 -0
  81. bitvf-0.1.0/tests/executable/cases/geometry_missing.ini +13 -0
  82. bitvf-0.1.0/tests/executable/cases/id_column_duplicate.ini +15 -0
  83. bitvf-0.1.0/tests/executable/cases/id_column_tracer_column.ini +15 -0
  84. bitvf-0.1.0/tests/executable/cases/input_two_keys.ini +16 -0
  85. bitvf-0.1.0/tests/executable/cases/irrelevant_box.ini +35 -0
  86. bitvf-0.1.0/tests/executable/cases/irrelevant_complete.ini +66 -0
  87. bitvf-0.1.0/tests/executable/cases/irrelevant_divergence.ini +62 -0
  88. bitvf-0.1.0/tests/executable/cases/irrelevant_lightcone.ini +41 -0
  89. bitvf-0.1.0/tests/executable/cases/irrelevant_lightcone_complete.ini +68 -0
  90. bitvf-0.1.0/tests/executable/cases/irrelevant_lightcone_no_recons.ini +40 -0
  91. bitvf-0.1.0/tests/executable/cases/irrelevant_lightcone_not_external.ini +29 -0
  92. bitvf-0.1.0/tests/executable/cases/irrelevant_mean.ini +66 -0
  93. bitvf-0.1.0/tests/executable/cases/irrelevant_no_random_file.ini +16 -0
  94. bitvf-0.1.0/tests/executable/cases/irrelevant_no_recons.ini +36 -0
  95. bitvf-0.1.0/tests/executable/cases/irrelevant_pipeline_divergence_file.ini +15 -0
  96. bitvf-0.1.0/tests/executable/cases/irrelevant_precedence.ini +14 -0
  97. bitvf-0.1.0/tests/executable/cases/irrelevant_with_divergence_file.ini +13 -0
  98. bitvf-0.1.0/tests/executable/cases/library_wrong_product.ini +11 -0
  99. bitvf-0.1.0/tests/executable/cases/lightcone_box_file.ini +15 -0
  100. bitvf-0.1.0/tests/executable/cases/lightcone_divergence_input_file.ini +16 -0
  101. bitvf-0.1.0/tests/executable/cases/lightcone_range_bins.ini +24 -0
  102. bitvf-0.1.0/tests/executable/cases/lightcone_range_z_max.ini +24 -0
  103. bitvf-0.1.0/tests/executable/cases/lightcone_required_Omega_matter.ini +23 -0
  104. bitvf-0.1.0/tests/executable/cases/lightcone_required_bias_file.ini +26 -0
  105. bitvf-0.1.0/tests/executable/cases/lightcone_required_bins.ini +23 -0
  106. bitvf-0.1.0/tests/executable/cases/lightcone_required_mask.ini +23 -0
  107. bitvf-0.1.0/tests/executable/cases/lightcone_required_random_file.ini +23 -0
  108. bitvf-0.1.0/tests/executable/cases/lightcone_required_units.ini +23 -0
  109. bitvf-0.1.0/tests/executable/cases/lightcone_run_complete_1.ini +31 -0
  110. bitvf-0.1.0/tests/executable/cases/lightcone_run_external_1.ini +35 -0
  111. bitvf-0.1.0/tests/executable/cases/lightcone_run_mean_4.ini +31 -0
  112. bitvf-0.1.0/tests/executable/cases/lightcone_run_pipeline_1.ini +44 -0
  113. bitvf-0.1.0/tests/executable/cases/lightcone_run_pipeline_4.ini +44 -0
  114. bitvf-0.1.0/tests/executable/cases/lightcone_run_rsd_1.ini +73 -0
  115. bitvf-0.1.0/tests/executable/cases/lightcone_word_random_recons_mode.ini +28 -0
  116. bitvf-0.1.0/tests/executable/cases/lightcone_word_units.ini +24 -0
  117. bitvf-0.1.0/tests/executable/cases/malformed_Nrec.ini +14 -0
  118. bitvf-0.1.0/tests/executable/cases/mean_no_box_limits.ini +11 -0
  119. bitvf-0.1.0/tests/executable/cases/otswap_missing_tracer_file.ini +14 -0
  120. bitvf-0.1.0/tests/executable/cases/output_dir_file.ini +15 -0
  121. bitvf-0.1.0/tests/executable/cases/output_file_slash.ini +14 -0
  122. bitvf-0.1.0/tests/executable/cases/range_Nrec.ini +14 -0
  123. bitvf-0.1.0/tests/executable/cases/range_Omega_matter.ini +21 -0
  124. bitvf-0.1.0/tests/executable/cases/range_bias.ini +21 -0
  125. bitvf-0.1.0/tests/executable/cases/range_cell_size.ini +15 -0
  126. bitvf-0.1.0/tests/executable/cases/range_little_h.ini +21 -0
  127. bitvf-0.1.0/tests/executable/cases/range_los_axis.ini +21 -0
  128. bitvf-0.1.0/tests/executable/cases/range_mesh_cellsize.ini +15 -0
  129. bitvf-0.1.0/tests/executable/cases/range_mps.ini +15 -0
  130. bitvf-0.1.0/tests/executable/cases/range_redshift.ini +21 -0
  131. bitvf-0.1.0/tests/executable/cases/range_rsd_smoothing_scale.ini +21 -0
  132. bitvf-0.1.0/tests/executable/cases/range_sigma.ini +15 -0
  133. bitvf-0.1.0/tests/executable/cases/range_threshold.ini +15 -0
  134. bitvf-0.1.0/tests/executable/cases/required_column_random.ini +15 -0
  135. bitvf-0.1.0/tests/executable/cases/required_output_dir.ini +13 -0
  136. bitvf-0.1.0/tests/executable/cases/required_recons_redshift.ini +20 -0
  137. bitvf-0.1.0/tests/executable/cases/required_tracer_file.ini +13 -0
  138. bitvf-0.1.0/tests/executable/cases/run_complete_1.ini +25 -0
  139. bitvf-0.1.0/tests/executable/cases/run_complete_4.ini +25 -0
  140. bitvf-0.1.0/tests/executable/cases/run_divergence_1.ini +27 -0
  141. bitvf-0.1.0/tests/executable/cases/run_divergence_4.ini +27 -0
  142. bitvf-0.1.0/tests/executable/cases/run_mean_1.ini +28 -0
  143. bitvf-0.1.0/tests/executable/cases/run_mean_4.ini +28 -0
  144. bitvf-0.1.0/tests/executable/cases/run_meanmulti_4.ini +28 -0
  145. bitvf-0.1.0/tests/executable/cases/run_pipeline_1.ini +34 -0
  146. bitvf-0.1.0/tests/executable/cases/run_pipeline_4.ini +34 -0
  147. bitvf-0.1.0/tests/executable/cases/run_rsd_1.ini +61 -0
  148. bitvf-0.1.0/tests/executable/cases/run_rsd_4.ini +61 -0
  149. bitvf-0.1.0/tests/executable/cases/three_column_tracer.ini +14 -0
  150. bitvf-0.1.0/tests/executable/cases/unknown_keys.ini +19 -0
  151. bitvf-0.1.0/tests/executable/cases/word_output_format.ini +15 -0
  152. bitvf-0.1.0/tests/executable/cases/word_sigma_unit.ini +15 -0
  153. bitvf-0.1.0/tests/executable/cases/writer_fails.ini +19 -0
  154. bitvf-0.1.0/tests/executable/data/box_tracers.dat +2002 -0
  155. bitvf-0.1.0/tests/executable/data/field.dat +1838 -0
  156. bitvf-0.1.0/tests/executable/data/field_comma.csv +1838 -0
  157. bitvf-0.1.0/tests/executable/data/lightcone_bias.dat +3 -0
  158. bitvf-0.1.0/tests/executable/data/lightcone_mask.fits +0 -0
  159. bitvf-0.1.0/tests/executable/data/lightcone_randoms.dat +1502 -0
  160. bitvf-0.1.0/tests/executable/data/lightcone_tracers.dat +502 -0
  161. bitvf-0.1.0/tests/executable/data/tracers_dup_id.dat +6 -0
  162. bitvf-0.1.0/tests/executable/reference.cpp +301 -0
  163. bitvf-0.1.0/tests/executable/run_case.cmake +220 -0
  164. bitvf-0.1.0/tests/fixtures.h +184 -0
  165. bitvf-0.1.0/tests/python_reference.cpp +542 -0
  166. bitvf-0.1.0/tests/test_basins.cpp +950 -0
  167. bitvf-0.1.0/tests/test_bitvf.py +775 -0
  168. bitvf-0.1.0/tests/test_box_grid.cpp +373 -0
  169. bitvf-0.1.0/tests/test_checks.cpp +917 -0
  170. bitvf-0.1.0/tests/test_crossmodule.py +49 -0
  171. bitvf-0.1.0/tests/test_determinism.py +214 -0
  172. bitvf-0.1.0/tests/test_divergence.cpp +601 -0
  173. bitvf-0.1.0/tests/test_from_divergence.cpp +197 -0
  174. bitvf-0.1.0/tests/test_from_field.cpp +469 -0
  175. bitvf-0.1.0/tests/test_import.py +15 -0
  176. bitvf-0.1.0/tests/test_lightcone_basins.cpp +466 -0
  177. bitvf-0.1.0/tests/test_lightcone_centres.cpp +386 -0
  178. bitvf-0.1.0/tests/test_lightcone_densities.cpp +210 -0
  179. bitvf-0.1.0/tests/test_lightcone_divergence.cpp +473 -0
  180. bitvf-0.1.0/tests/test_lightcone_entry.cpp +631 -0
  181. bitvf-0.1.0/tests/test_lightcone_faces.cpp +632 -0
  182. bitvf-0.1.0/tests/test_lightcone_files.cpp +559 -0
  183. bitvf-0.1.0/tests/test_lightcone_fill.cpp +495 -0
  184. bitvf-0.1.0/tests/test_lightcone_grid.cpp +902 -0
  185. bitvf-0.1.0/tests/test_lightcone_pipeline.cpp +803 -0
  186. bitvf-0.1.0/tests/test_lightcone_python.py +575 -0
  187. bitvf-0.1.0/tests/test_lightcone_smoothing.cpp +409 -0
  188. bitvf-0.1.0/tests/test_lightcone_watershed.cpp +336 -0
  189. bitvf-0.1.0/tests/test_readers.cpp +761 -0
  190. bitvf-0.1.0/tests/test_readme.py +34 -0
  191. bitvf-0.1.0/tests/test_report.cpp +431 -0
  192. bitvf-0.1.0/tests/test_runbox.cpp +558 -0
  193. bitvf-0.1.0/tests/test_smoothing.cpp +574 -0
  194. bitvf-0.1.0/tests/test_watershed.cpp +679 -0
  195. bitvf-0.1.0/tests/test_writers.cpp +925 -0
  196. bitvf-0.1.0/tools/wheels/build_deps.sh +123 -0
  197. bitvf-0.1.0/tools/wheels/check_dependencies.py +93 -0
  198. bitvf-0.1.0/tools/wheels/check_openmp.py +71 -0
  199. bitvf-0.1.0/tools/wheels/check_pins.sh +42 -0
  200. bitvf-0.1.0/tools/wheels/select_otswap_omp.sh +49 -0
  201. bitvf-0.1.0/tools/wheels/test_wheel.sh +55 -0
@@ -0,0 +1,114 @@
1
+ name: CI
2
+
3
+ # Builds and tests the C++ library and the Python module on every push and
4
+ # pull request: with GCC and clang on Linux and with Apple clang on macOS,
5
+ # warnings as errors. The C++ tests run with 1 and with 4 threads.
6
+
7
+ on: [push, pull_request]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ name: ${{ matrix.name }}
15
+ runs-on: ${{ matrix.os }}
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ include:
20
+ - name: Linux GCC
21
+ os: ubuntu-24.04
22
+ cc: gcc
23
+ cxx: g++
24
+ - name: Linux clang
25
+ os: ubuntu-24.04
26
+ cc: clang
27
+ cxx: clang++
28
+ - name: macOS Apple clang
29
+ os: macos-latest
30
+ cc: clang
31
+ cxx: clang++
32
+
33
+ env:
34
+ CC: ${{ matrix.cc }}
35
+ CXX: ${{ matrix.cxx }}
36
+
37
+ steps:
38
+ - uses: actions/checkout@v7
39
+
40
+ - uses: actions/setup-python@v7
41
+ with:
42
+ python-version: "3.12"
43
+
44
+ # The wheels link the same zlib and cfitsio sources as otswap's.
45
+ - name: Wheel dependency pins are otswap's
46
+ if: runner.os == 'Linux' && matrix.cc == 'gcc'
47
+ run: bash tools/wheels/check_pins.sh .
48
+
49
+ # GCC brings libgomp; clang on Linux needs libomp.
50
+ - name: Install cfitsio and OpenMP
51
+ if: runner.os == 'Linux'
52
+ run: sudo apt-get update && sudo apt-get install --yes libcfitsio-dev libomp-dev
53
+
54
+ # Homebrew's libomp is keg-only: bitvf finds it without OpenMP_ROOT.
55
+ - name: Install cfitsio and libomp
56
+ if: runner.os == 'macOS'
57
+ run: |
58
+ brew install cfitsio libomp
59
+ echo "CFITSIO_ROOT=$(brew --prefix cfitsio)" >> "$GITHUB_ENV"
60
+
61
+ # otswap and meshsearch are fetched and built by CMake.
62
+ - name: Configure
63
+ run: |
64
+ cmake -S . -B build -DCMAKE_COMPILE_WARNING_AS_ERROR=ON | tee configure.log
65
+ # without OpenMP every test would still pass, serially
66
+ grep -q "Found OpenMP_CXX" configure.log
67
+
68
+ - name: Build
69
+ run: cmake --build build --parallel
70
+
71
+ - name: Test with 1 thread
72
+ env:
73
+ OMP_NUM_THREADS: "1"
74
+ run: ctest --test-dir build --output-on-failure
75
+
76
+ - name: Test with 4 threads
77
+ env:
78
+ OMP_NUM_THREADS: "4"
79
+ run: ctest --test-dir build --output-on-failure
80
+
81
+ - name: Every translation unit is compiled without FP contraction or math errno
82
+ run: |
83
+ python3 - <<'PY'
84
+ import json, sys
85
+ entries = json.load(open("build/compile_commands.json"))
86
+ bad = 0
87
+ for flag in ("-ffp-contract=off", "-fno-math-errno"):
88
+ missing = [e["file"] for e in entries
89
+ if flag not in e.get("command", " ".join(e.get("arguments", [])))]
90
+ print(len(entries), "translation units;", len(missing), "without", flag)
91
+ bad += len(missing)
92
+ sys.exit(1 if bad or not entries else 0)
93
+ PY
94
+
95
+ # The module is built only by pip, in an isolated environment with
96
+ # otswap's wheel: its OpenMP runtime is the one the module loads.
97
+ - name: Build and install the module
98
+ run: |
99
+ python -m venv "$RUNNER_TEMP/venv"
100
+ "$RUNNER_TEMP/venv/bin/python" -m pip install ".[test]"
101
+
102
+ # The comparison tests need the C++ reference built above.
103
+ - name: Build the C++ reference
104
+ run: cmake --build build --target python_reference
105
+
106
+ # Run from outside the source tree, so that the installed module is the
107
+ # one imported.
108
+ - name: Python tests
109
+ working-directory: ${{ runner.temp }}
110
+ env:
111
+ BITVF_PYTHON_REFERENCE: ${{ github.workspace }}/build/python_reference
112
+ run: >-
113
+ "$RUNNER_TEMP/venv/bin/python" -m pytest "$GITHUB_WORKSPACE/tests"
114
+ -p no:cacheprovider -rs
@@ -0,0 +1,64 @@
1
+ name: Docs
2
+
3
+ # Builds the documentation on every push and pull request, so a broken
4
+ # reference or a malformed docstring fails here and not silently. Publishing to
5
+ # Pages happens only from main. Deliberately separate from release.yml: a docs
6
+ # failure must never stand between a tag and PyPI.
7
+
8
+ on:
9
+ push:
10
+ pull_request:
11
+
12
+ permissions:
13
+ contents: read
14
+
15
+ concurrency:
16
+ group: pages
17
+ cancel-in-progress: false
18
+
19
+ jobs:
20
+ build:
21
+ name: build
22
+ runs-on: ubuntu-24.04
23
+
24
+ steps:
25
+ - uses: actions/checkout@v7
26
+
27
+ - uses: actions/setup-python@v7
28
+ with:
29
+ python-version: "3.12"
30
+
31
+ - name: Install Doxygen
32
+ run: sudo apt-get update && sudo apt-get install --yes doxygen
33
+
34
+ # The package is not built: the Python reference is read from the type
35
+ # stubs, and the C++ one from the headers.
36
+ - name: Install the documentation toolchain
37
+ run: pip install -r docs/requirements.txt
38
+
39
+ - name: Build
40
+ # -W: a warning is a failure. An unresolved reference or a docstring
41
+ # Sphinx cannot parse should break the build, not reach the site.
42
+ run: sphinx-build -W -n --keep-going -b html docs docs/_build/html
43
+
44
+ - uses: actions/upload-pages-artifact@v5
45
+ with:
46
+ path: docs/_build/html
47
+
48
+ deploy:
49
+ name: deploy to Pages
50
+ needs: build
51
+ if: github.ref == 'refs/heads/main' && github.event_name == 'push'
52
+ runs-on: ubuntu-24.04
53
+
54
+ environment:
55
+ name: github-pages
56
+ url: ${{ steps.deployment.outputs.page_url }}
57
+
58
+ permissions:
59
+ pages: write
60
+ id-token: write
61
+
62
+ steps:
63
+ - id: deployment
64
+ uses: actions/deploy-pages@v5
@@ -0,0 +1,129 @@
1
+ name: Release
2
+
3
+ # Publishes to PyPI when a v* tag is pushed: the sdist and the wheels for
4
+ # CPython 3.10 to 3.14 on manylinux x86_64 and aarch64 and on macOS arm64 and
5
+ # x86_64, each wheel tested (the comparison tests against the C++ library, the
6
+ # determinism hashes, the README's code, and otswap and bitvf in one process).
7
+ # Run it from the Actions tab (workflow_dispatch) to build and test everything
8
+ # without publishing. The wheels' configuration is in pyproject.toml and
9
+ # tools/wheels/.
10
+
11
+ on:
12
+ push:
13
+ tags: ["v*"]
14
+ workflow_dispatch:
15
+
16
+ permissions:
17
+ contents: read
18
+
19
+ jobs:
20
+ sdist:
21
+ name: sdist
22
+ runs-on: ubuntu-24.04
23
+ steps:
24
+ - uses: actions/checkout@v7
25
+
26
+ - uses: actions/setup-python@v7
27
+ with:
28
+ python-version: "3.12"
29
+
30
+ # The version lives in pyproject.toml, CMakeLists.txt and CITATION.cff;
31
+ # on a tag push the tag must name it too, and the changelog and the
32
+ # citation file must carry the release date.
33
+ - name: The versions agree
34
+ run: |
35
+ version=$(python -c "import tomllib, pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
36
+ cmake_version=$(sed -nE 's/^project\(bitvf VERSION ([0-9.]+).*/\1/p' CMakeLists.txt)
37
+ cff_version=$(sed -nE 's/^version: *([0-9.]+).*/\1/p' CITATION.cff)
38
+ if [ "$version" != "$cmake_version" ] || [ "$version" != "$cff_version" ]; then
39
+ echo "pyproject.toml says $version, CMakeLists.txt $cmake_version and CITATION.cff $cff_version"
40
+ exit 1
41
+ fi
42
+ if [ "$GITHUB_EVENT_NAME" = push ]; then
43
+ if [ "${GITHUB_REF_NAME#v}" != "$version" ]; then
44
+ echo "tag $GITHUB_REF_NAME does not match version $version"
45
+ exit 1
46
+ fi
47
+ if ! grep -qE "^## $version — [0-9]{4}-[0-9]{2}-[0-9]{2}$" CHANGELOG.md; then
48
+ echo "CHANGELOG.md has no heading '## $version — YYYY-MM-DD' with a date"
49
+ exit 1
50
+ fi
51
+ if ! grep -qE '^date-released: [0-9]{4}-[0-9]{2}-[0-9]{2}$' CITATION.cff; then
52
+ echo "CITATION.cff has no date-released"
53
+ exit 1
54
+ fi
55
+ fi
56
+
57
+ - name: Build
58
+ run: pipx run build --sdist
59
+
60
+ - name: The sdist holds no example
61
+ run: |
62
+ if tar -tzf dist/*.tar.gz | grep '/examples/'; then
63
+ exit 1
64
+ fi
65
+
66
+ - name: Check the metadata PyPI will render
67
+ run: pipx run twine check dist/*
68
+
69
+ - uses: actions/upload-artifact@v7
70
+ with:
71
+ name: dist-sdist
72
+ path: dist/*.tar.gz
73
+
74
+ wheels:
75
+ name: wheels on ${{ matrix.os }}
76
+ runs-on: ${{ matrix.os }}
77
+ strategy:
78
+ fail-fast: false
79
+ matrix:
80
+ os: [ubuntu-24.04, ubuntu-24.04-arm, macos-latest]
81
+
82
+ steps:
83
+ - uses: actions/checkout@v7
84
+
85
+ - uses: pypa/cibuildwheel@v4.2.1
86
+ with:
87
+ output-dir: wheelhouse
88
+
89
+ # bitvf installs no C++ library, header, CMake file or example.
90
+ - name: The wheels hold no C++ library, header, CMake file or example
91
+ run: |
92
+ python3 - <<'PY'
93
+ import glob, sys, zipfile
94
+ wheels = glob.glob("wheelhouse/*.whl")
95
+ bad = [f"{w}: {name}" for w in wheels for name in zipfile.ZipFile(w).namelist()
96
+ if name.endswith((".a", ".h", ".cmake")) or "examples/" in name]
97
+ print(len(wheels), "wheels;", len(bad), "C++ library, header, CMake or example files")
98
+ print("\n".join(bad))
99
+ sys.exit(1 if bad or not wheels else 0)
100
+ PY
101
+
102
+ - uses: actions/upload-artifact@v7
103
+ with:
104
+ name: dist-${{ matrix.os }}
105
+ path: wheelhouse/*.whl
106
+
107
+ publish:
108
+ name: publish to PyPI
109
+ needs: [sdist, wheels]
110
+ if: github.event_name == 'push'
111
+ runs-on: ubuntu-24.04
112
+
113
+ # The trusted publisher on PyPI is configured against this environment name
114
+ # and this workflow's filename. Changing either means changing it there.
115
+ environment:
116
+ name: pypi
117
+ url: https://pypi.org/p/bitvf
118
+
119
+ permissions:
120
+ id-token: write # mints the OIDC token PyPI checks; no API token
121
+
122
+ steps:
123
+ - uses: actions/download-artifact@v8
124
+ with:
125
+ pattern: dist-*
126
+ merge-multiple: true
127
+ path: dist
128
+
129
+ - uses: pypa/gh-action-pypi-publish@release/v1
bitvf-0.1.0/.gitignore ADDED
@@ -0,0 +1,22 @@
1
+ build/
2
+ build-*/
3
+ _build/
4
+ docs/_build/
5
+ docs/doxygen/
6
+ dist/
7
+ *.egg-info/
8
+ CMakeCache.txt
9
+ CMakeFiles/
10
+ cmake_install.cmake
11
+ *.o
12
+ *.a
13
+ *.so
14
+ *.dylib
15
+ __pycache__/
16
+ *.pyc
17
+ .pytest_cache/
18
+ .DS_Store
19
+ .venv/
20
+ examples/*/output/
21
+ wheelhouse/
22
+ .cache/
@@ -0,0 +1,5 @@
1
+ # Changelog
2
+
3
+ ## 0.1.0 — 2026-11-23
4
+
5
+ First public release.
@@ -0,0 +1,39 @@
1
+ cff-version: 1.2.0
2
+ message: "If you use bitvf, please cite the paper below."
3
+ title: bitvf
4
+ abstract: >-
5
+ The Back-in-time Void Finder: cosmic voids from the optimal transport
6
+ displacement field of a tracer catalogue.
7
+ type: software
8
+ authors:
9
+ - family-names: Sartori
10
+ given-names: Simone
11
+ email: simone.sartori@inaf.it
12
+ version: 0.1.0
13
+ date-released: 2026-11-23
14
+ license: GPL-2.0-or-later
15
+ repository-code: "https://github.com/SimoSartori/bitvf"
16
+ url: "https://simosartori.github.io/bitvf/"
17
+ preferred-citation:
18
+ type: article
19
+ title: "The Back-in-time Void Finder: dynamical identification of cosmic voids through optimal transport reconstruction"
20
+ authors:
21
+ - family-names: Sartori
22
+ given-names: Simone
23
+ - family-names: Contarini
24
+ given-names: Sofia
25
+ - family-names: Sarpa
26
+ given-names: Elena
27
+ - family-names: Degni
28
+ given-names: Giulia
29
+ - family-names: Marulli
30
+ given-names: Federico
31
+ - family-names: Escoffier
32
+ given-names: Stephanie
33
+ - family-names: Moscardini
34
+ given-names: Lauro
35
+ year: 2026
36
+ identifiers:
37
+ - type: other
38
+ value: "arXiv:2601.15378"
39
+ url: "https://arxiv.org/abs/2601.15378"