voids 0.1.4__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 (255) hide show
  1. voids-0.1.4/.gitattributes +2 -0
  2. voids-0.1.4/.github/ISSUE_TEMPLATE/config.yml +1 -0
  3. voids-0.1.4/.github/ISSUE_TEMPLATE/issue.yml +23 -0
  4. voids-0.1.4/.github/dependabot.yml +25 -0
  5. voids-0.1.4/.github/pull_request_template.md +7 -0
  6. voids-0.1.4/.github/workflows/docs.yml +48 -0
  7. voids-0.1.4/.github/workflows/lint-diff.yml +41 -0
  8. voids-0.1.4/.github/workflows/pixi-lock-weekly.yml +45 -0
  9. voids-0.1.4/.github/workflows/publish-pypi.yml +88 -0
  10. voids-0.1.4/.github/workflows/tests.yml +184 -0
  11. voids-0.1.4/.github/workflows/typecheck-diff.yml +29 -0
  12. voids-0.1.4/.gitignore +219 -0
  13. voids-0.1.4/.mypy.ini +58 -0
  14. voids-0.1.4/.pre-commit-config.yaml +56 -0
  15. voids-0.1.4/.ruff.toml +35 -0
  16. voids-0.1.4/CODE_OF_CONDUCT.md +128 -0
  17. voids-0.1.4/CONTRIBUTING.md +372 -0
  18. voids-0.1.4/LICENSE +504 -0
  19. voids-0.1.4/PKG-INFO +266 -0
  20. voids-0.1.4/README.md +214 -0
  21. voids-0.1.4/codecov.yml +20 -0
  22. voids-0.1.4/docs/api/benchmarks.md +46 -0
  23. voids-0.1.4/docs/api/core.md +32 -0
  24. voids-0.1.4/docs/api/examples.md +22 -0
  25. voids-0.1.4/docs/api/generators.md +22 -0
  26. voids-0.1.4/docs/api/geom.md +16 -0
  27. voids-0.1.4/docs/api/graph.md +22 -0
  28. voids-0.1.4/docs/api/image.md +22 -0
  29. voids-0.1.4/docs/api/index.md +61 -0
  30. voids-0.1.4/docs/api/io.md +21 -0
  31. voids-0.1.4/docs/api/linalg.md +34 -0
  32. voids-0.1.4/docs/api/physics.md +22 -0
  33. voids-0.1.4/docs/api/simulators.md +10 -0
  34. voids-0.1.4/docs/api/visualization.md +20 -0
  35. voids-0.1.4/docs/assets/lncc-mcti.svg +137 -0
  36. voids-0.1.4/docs/assets/logo-mark.svg +14 -0
  37. voids-0.1.4/docs/assets/logo.png +0 -0
  38. voids-0.1.4/docs/assets/valvatne_conduit_series_model.svg +65 -0
  39. voids-0.1.4/docs/assets/valvatne_equivalent_shape_factor.png +0 -0
  40. voids-0.1.4/docs/assets/valvatne_equivalent_shape_factor.svg +5 -0
  41. voids-0.1.4/docs/assets/valvatne_equivalent_shape_factor_original.png +0 -0
  42. voids-0.1.4/docs/assets/verification/openpnm_5_case_results.csv +6 -0
  43. voids-0.1.4/docs/assets/verification/openpnm_permeability_scatter.png +0 -0
  44. voids-0.1.4/docs/assets/verification/openpnm_porosity_pipeline.png +0 -0
  45. voids-0.1.4/docs/assets/verification/openpnm_representative_segmentation.png +0 -0
  46. voids-0.1.4/docs/assets/verification/pnflow_5_case_results.csv +6 -0
  47. voids-0.1.4/docs/assets/verification/pnflow_permeability_scatter_and_error.png +0 -0
  48. voids-0.1.4/docs/assets/verification/pnflow_porosity_vs_permeability.png +0 -0
  49. voids-0.1.4/docs/assets/verification/xlb_15_case_results.csv +16 -0
  50. voids-0.1.4/docs/assets/verification/xlb_benchmark_vs_stokes_limit.png +0 -0
  51. voids-0.1.4/docs/assets/verification/xlb_permeability_scatter_and_error.png +0 -0
  52. voids-0.1.4/docs/assets/verification/xlb_porosity_vs_permeability.png +0 -0
  53. voids-0.1.4/docs/assets/verification/xlb_stokes_15_case_results.csv +16 -0
  54. voids-0.1.4/docs/assets/verification/xlb_stokes_limit_representative.csv +3 -0
  55. voids-0.1.4/docs/assets/verification/xlb_stokes_permeability_scatter_and_error.png +0 -0
  56. voids-0.1.4/docs/assets/verification/xlb_stokes_porosity_vs_permeability.png +0 -0
  57. voids-0.1.4/docs/background.md +490 -0
  58. voids-0.1.4/docs/concepts.md +274 -0
  59. voids-0.1.4/docs/examples.md +213 -0
  60. voids-0.1.4/docs/getting_started.md +151 -0
  61. voids-0.1.4/docs/index.md +159 -0
  62. voids-0.1.4/docs/javascripts/mathjax.js +12 -0
  63. voids-0.1.4/docs/verification/index.md +47 -0
  64. voids-0.1.4/docs/verification/openpnm.md +188 -0
  65. voids-0.1.4/docs/verification/pnflow.md +227 -0
  66. voids-0.1.4/docs/verification/xlb.md +478 -0
  67. voids-0.1.4/docs/workflow.md +146 -0
  68. voids-0.1.4/examples/data/README.md +38 -0
  69. voids-0.1.4/examples/data/berea/berea_micromodel_200.tif +0 -0
  70. voids-0.1.4/examples/data/cartesian_mesh_20x20_pyvista.png +0 -0
  71. voids-0.1.4/examples/data/cartesian_mesh_20x20x20_pyvista.png +0 -0
  72. voids-0.1.4/examples/data/cartesian_mesh_20x20x20_voids.h5 +0 -0
  73. voids-0.1.4/examples/data/external_pnflow_benchmark/README.md +24 -0
  74. voids-0.1.4/examples/data/external_pnflow_benchmark/manifest.csv +6 -0
  75. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/input_pnflow.dat +22 -0
  76. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_link1.dat +203 -0
  77. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_link2.dat +202 -0
  78. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_node1.dat +81 -0
  79. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_node2.dat +80 -0
  80. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_pnflow.prt +120 -0
  81. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/phi032_b14_upscaled.tsv +62 -0
  82. voids-0.1.4/examples/data/external_pnflow_benchmark/phi032_b14/void_volume.npy +0 -0
  83. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/input_pnflow.dat +22 -0
  84. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_link1.dat +199 -0
  85. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_link2.dat +198 -0
  86. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_node1.dat +72 -0
  87. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_node2.dat +71 -0
  88. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_pnflow.prt +119 -0
  89. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/phi035_b16_upscaled.tsv +61 -0
  90. voids-0.1.4/examples/data/external_pnflow_benchmark/phi035_b16/void_volume.npy +0 -0
  91. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/input_pnflow.dat +22 -0
  92. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_link1.dat +181 -0
  93. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_link2.dat +180 -0
  94. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_node1.dat +65 -0
  95. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_node2.dat +64 -0
  96. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_pnflow.prt +119 -0
  97. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/phi038_b18_upscaled.tsv +61 -0
  98. voids-0.1.4/examples/data/external_pnflow_benchmark/phi038_b18/void_volume.npy +0 -0
  99. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/input_pnflow.dat +22 -0
  100. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_link1.dat +281 -0
  101. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_link2.dat +280 -0
  102. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_node1.dat +84 -0
  103. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_node2.dat +83 -0
  104. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_pnflow.prt +129 -0
  105. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/phi040_b18_upscaled.tsv +61 -0
  106. voids-0.1.4/examples/data/external_pnflow_benchmark/phi040_b18/void_volume.npy +0 -0
  107. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/input_pnflow.dat +22 -0
  108. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_link1.dat +248 -0
  109. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_link2.dat +247 -0
  110. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_node1.dat +73 -0
  111. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_node2.dat +72 -0
  112. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_pnflow.prt +129 -0
  113. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/phi041_b20_upscaled.tsv +61 -0
  114. voids-0.1.4/examples/data/external_pnflow_benchmark/phi041_b20/void_volume.npy +0 -0
  115. voids-0.1.4/examples/data/ketton/ketton_segmented.tif +0 -0
  116. voids-0.1.4/examples/data/ketton_network_full_voids.h5 +0 -0
  117. voids-0.1.4/examples/data/ketton_network_raw.npz +0 -0
  118. voids-0.1.4/examples/data/ketton_network_zspanning_voids.h5 +0 -0
  119. voids-0.1.4/examples/data/manufactured_porespy_network.png +0 -0
  120. voids-0.1.4/examples/data/manufactured_porespy_network_raw.npz +0 -0
  121. voids-0.1.4/examples/data/manufactured_porespy_network_voids.h5 +0 -0
  122. voids-0.1.4/examples/data/manufactured_void_image.npy +0 -0
  123. voids-0.1.4/examples/data/syn_vugs/synthetic_vugs.tif +0 -0
  124. voids-0.1.4/examples/data/syn_vugs/synthetic_vugs_cropped_binary.npy +0 -0
  125. voids-0.1.4/examples/data/syn_vugs/synthetic_vugs_network_full_voids.h5 +0 -0
  126. voids-0.1.4/examples/data/syn_vugs/synthetic_vugs_network_raw.npz +0 -0
  127. voids-0.1.4/examples/data/syn_vugs/synthetic_vugs_network_yspanning_voids.h5 +0 -0
  128. voids-0.1.4/jupytext.toml +3 -0
  129. voids-0.1.4/mkdocs.yml +117 -0
  130. voids-0.1.4/notebooks/01_mwe_singlephase_porosity_perm.ipynb +163 -0
  131. voids-0.1.4/notebooks/01_mwe_singlephase_porosity_perm.py +53 -0
  132. voids-0.1.4/notebooks/02_mwe_openpnm_crosscheck_optional.ipynb +112 -0
  133. voids-0.1.4/notebooks/02_mwe_openpnm_crosscheck_optional.py +30 -0
  134. voids-0.1.4/notebooks/03_mwe_pyvista_visualization.ipynb +165 -0
  135. voids-0.1.4/notebooks/03_mwe_pyvista_visualization.py +75 -0
  136. voids-0.1.4/notebooks/04_mwe_manufactured_porespy_extraction.ipynb +1620 -0
  137. voids-0.1.4/notebooks/04_mwe_manufactured_porespy_extraction.py +181 -0
  138. voids-0.1.4/notebooks/05_mwe_cartesian_mesh_network.ipynb +52588 -0
  139. voids-0.1.4/notebooks/05_mwe_cartesian_mesh_network.py +168 -0
  140. voids-0.1.4/notebooks/06_mwe_real_porespy_extraction.ipynb +8826 -0
  141. voids-0.1.4/notebooks/06_mwe_real_porespy_extraction.py +440 -0
  142. voids-0.1.4/notebooks/07_mwe_synthetic_vug_case.ipynb +21056 -0
  143. voids-0.1.4/notebooks/07_mwe_synthetic_vug_case.py +522 -0
  144. voids-0.1.4/notebooks/08_mwe_image_based_vug_shape_sensitivity.ipynb +2686 -0
  145. voids-0.1.4/notebooks/08_mwe_image_based_vug_shape_sensitivity.py +866 -0
  146. voids-0.1.4/notebooks/09_mwe_image_based_vug_sensitivity_2d.ipynb +1597 -0
  147. voids-0.1.4/notebooks/09_mwe_image_based_vug_sensitivity_2d.py +862 -0
  148. voids-0.1.4/notebooks/10_mwe_lattice_based_vug_sensitivity.ipynb +1461 -0
  149. voids-0.1.4/notebooks/10_mwe_lattice_based_vug_sensitivity.py +692 -0
  150. voids-0.1.4/notebooks/11_mwe_lattice_based_vug_sensitivity_2d.ipynb +1249 -0
  151. voids-0.1.4/notebooks/11_mwe_lattice_based_vug_sensitivity_2d.py +645 -0
  152. voids-0.1.4/notebooks/12_mwe_synthetic_volume_openpnm_benchmark.ipynb +715 -0
  153. voids-0.1.4/notebooks/12_mwe_synthetic_volume_openpnm_benchmark.py +346 -0
  154. voids-0.1.4/notebooks/13_mwe_synthetic_volume_xlb_benchmark.ipynb +2176 -0
  155. voids-0.1.4/notebooks/13_mwe_synthetic_volume_xlb_benchmark.py +872 -0
  156. voids-0.1.4/notebooks/14_mwe_shape_factor_conductance_comparison.ipynb +869 -0
  157. voids-0.1.4/notebooks/14_mwe_shape_factor_conductance_comparison.py +348 -0
  158. voids-0.1.4/notebooks/15_mwe_external_pnflow_benchmark.ipynb +874 -0
  159. voids-0.1.4/notebooks/15_mwe_external_pnflow_benchmark.py +405 -0
  160. voids-0.1.4/pixi.lock +18661 -0
  161. voids-0.1.4/pixi.toml +96 -0
  162. voids-0.1.4/pyproject.toml +87 -0
  163. voids-0.1.4/resources/logo/Voids logo.png +0 -0
  164. voids-0.1.4/resources/logo/lncc-mcti.svg +137 -0
  165. voids-0.1.4/scripts/bump_version.py +150 -0
  166. voids-0.1.4/scripts/sync_deps.py +287 -0
  167. voids-0.1.4/spec_v0_1.md +639 -0
  168. voids-0.1.4/src/voids/__init__.py +8 -0
  169. voids-0.1.4/src/voids/_logging.py +5 -0
  170. voids-0.1.4/src/voids/_testing.py +25 -0
  171. voids-0.1.4/src/voids/benchmarks/__init__.py +29 -0
  172. voids-0.1.4/src/voids/benchmarks/_shared.py +92 -0
  173. voids-0.1.4/src/voids/benchmarks/crosscheck.py +353 -0
  174. voids-0.1.4/src/voids/benchmarks/segmented_volume.py +261 -0
  175. voids-0.1.4/src/voids/benchmarks/xlb.py +1045 -0
  176. voids-0.1.4/src/voids/core/__init__.py +6 -0
  177. voids-0.1.4/src/voids/core/network.py +176 -0
  178. voids-0.1.4/src/voids/core/provenance.py +83 -0
  179. voids-0.1.4/src/voids/core/sample.py +165 -0
  180. voids-0.1.4/src/voids/core/validation.py +140 -0
  181. voids-0.1.4/src/voids/examples/__init__.py +13 -0
  182. voids-0.1.4/src/voids/examples/demo.py +117 -0
  183. voids-0.1.4/src/voids/examples/manufactured.py +73 -0
  184. voids-0.1.4/src/voids/examples/mesh.py +283 -0
  185. voids-0.1.4/src/voids/generators/__init__.py +63 -0
  186. voids-0.1.4/src/voids/generators/network.py +825 -0
  187. voids-0.1.4/src/voids/generators/porous_image.py +717 -0
  188. voids-0.1.4/src/voids/generators/vug_templates.py +373 -0
  189. voids-0.1.4/src/voids/geom/__init__.py +14 -0
  190. voids-0.1.4/src/voids/geom/characteristic.py +103 -0
  191. voids-0.1.4/src/voids/geom/hydraulic.py +717 -0
  192. voids-0.1.4/src/voids/graph/__init__.py +15 -0
  193. voids-0.1.4/src/voids/graph/connectivity.py +244 -0
  194. voids-0.1.4/src/voids/graph/incidence.py +34 -0
  195. voids-0.1.4/src/voids/graph/metrics.py +96 -0
  196. voids-0.1.4/src/voids/image/__init__.py +30 -0
  197. voids-0.1.4/src/voids/image/_utils.py +76 -0
  198. voids-0.1.4/src/voids/image/connectivity.py +97 -0
  199. voids-0.1.4/src/voids/image/network_extraction.py +265 -0
  200. voids-0.1.4/src/voids/image/segmentation.py +362 -0
  201. voids-0.1.4/src/voids/io/__init__.py +13 -0
  202. voids-0.1.4/src/voids/io/hdf5.py +160 -0
  203. voids-0.1.4/src/voids/io/openpnm.py +147 -0
  204. voids-0.1.4/src/voids/io/porespy.py +669 -0
  205. voids-0.1.4/src/voids/linalg/__init__.py +0 -0
  206. voids-0.1.4/src/voids/linalg/assemble.py +58 -0
  207. voids-0.1.4/src/voids/linalg/backends.py +28 -0
  208. voids-0.1.4/src/voids/linalg/bc.py +67 -0
  209. voids-0.1.4/src/voids/linalg/diagnostics.py +26 -0
  210. voids-0.1.4/src/voids/linalg/solve.py +48 -0
  211. voids-0.1.4/src/voids/paths.py +110 -0
  212. voids-0.1.4/src/voids/physics/__init__.py +0 -0
  213. voids-0.1.4/src/voids/physics/petrophysics.py +174 -0
  214. voids-0.1.4/src/voids/physics/singlephase.py +350 -0
  215. voids-0.1.4/src/voids/physics/transport.py +1 -0
  216. voids-0.1.4/src/voids/py.typed +0 -0
  217. voids-0.1.4/src/voids/simulators/__init__.py +5 -0
  218. voids-0.1.4/src/voids/simulators/run_singlephase.py +38 -0
  219. voids-0.1.4/src/voids/version.py +1 -0
  220. voids-0.1.4/src/voids/visualization/__init__.py +6 -0
  221. voids-0.1.4/src/voids/visualization/_sizing.py +88 -0
  222. voids-0.1.4/src/voids/visualization/plotly.py +370 -0
  223. voids-0.1.4/src/voids/visualization/pyvista.py +305 -0
  224. voids-0.1.4/tests/conftest.py +44 -0
  225. voids-0.1.4/tests/test_bc.py +28 -0
  226. voids-0.1.4/tests/test_benchmark_segmented_volume.py +244 -0
  227. voids-0.1.4/tests/test_benchmark_xlb.py +1127 -0
  228. voids-0.1.4/tests/test_bump_version.py +41 -0
  229. voids-0.1.4/tests/test_connectivity.py +89 -0
  230. voids-0.1.4/tests/test_core_and_utils.py +160 -0
  231. voids-0.1.4/tests/test_crosscheck_roundtrip.py +19 -0
  232. voids-0.1.4/tests/test_demo_examples.py +29 -0
  233. voids-0.1.4/tests/test_examples_and_validation_branches.py +213 -0
  234. voids-0.1.4/tests/test_hydraulic_models.py +446 -0
  235. voids-0.1.4/tests/test_image_utils.py +17 -0
  236. voids-0.1.4/tests/test_io_and_crosscheck_branches.py +421 -0
  237. voids-0.1.4/tests/test_legacy_solver_coverage.py +290 -0
  238. voids-0.1.4/tests/test_manufactured_examples.py +28 -0
  239. voids-0.1.4/tests/test_mesh_examples.py +64 -0
  240. voids-0.1.4/tests/test_openpnm_crosscheck_optional.py +24 -0
  241. voids-0.1.4/tests/test_paths.py +34 -0
  242. voids-0.1.4/tests/test_porespy_io.py +421 -0
  243. voids-0.1.4/tests/test_porosity.py +52 -0
  244. voids-0.1.4/tests/test_schema_network.py +34 -0
  245. voids-0.1.4/tests/test_serialization.py +19 -0
  246. voids-0.1.4/tests/test_singlephase_scaling.py +48 -0
  247. voids-0.1.4/tests/test_singlephase_toy.py +22 -0
  248. voids-0.1.4/tests/test_sync_deps.py +64 -0
  249. voids-0.1.4/tests/test_visualization_and_workflow_branches/test_run_singlephase_main_regression.yml +8 -0
  250. voids-0.1.4/tests/test_visualization_and_workflow_branches.py +406 -0
  251. voids-0.1.4/tests/test_visualization_optional.py +66 -0
  252. voids-0.1.4/tests/test_workflows_porespy_volume.py +419 -0
  253. voids-0.1.4/tests/test_workflows_vug_image.py +488 -0
  254. voids-0.1.4/tests/test_workflows_vug_lattice.py +262 -0
  255. voids-0.1.4/tests/test_workflows_vug_templates.py +196 -0
@@ -0,0 +1,2 @@
1
+ # SCM syntax highlighting & preventing 3-way merges
2
+ pixi.lock merge=binary linguist-language=YAML linguist-generated=true
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,23 @@
1
+ name: Issue
2
+ description: Report a problem or propose a change.
3
+ title: "[Issue]: "
4
+ body:
5
+ - type: dropdown
6
+ id: expected-impact
7
+ attributes:
8
+ label: Expected Impact
9
+ description: Select the expected impact of this issue.
10
+ options:
11
+ - Minor
12
+ - Regular
13
+ - Major
14
+ validations:
15
+ required: true
16
+ - type: textarea
17
+ id: overview
18
+ attributes:
19
+ label: Overview
20
+ description: Provide a brief description of the issue.
21
+ placeholder: Describe the issue, motivation, or observed problem.
22
+ validations:
23
+ required: true
@@ -0,0 +1,25 @@
1
+ # Each Github Actions has versions, so we somehow need to keep it up-to-date.
2
+ # This GH Actions is an approach to handle this problem using dependabot.
3
+ # See docs here: https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot
4
+
5
+ version: 2
6
+ updates:
7
+
8
+ - package-ecosystem: github-actions
9
+ directory: "/"
10
+ schedule:
11
+ # Check for updates to GitHub Actions every week
12
+ interval: "weekly"
13
+
14
+ # list here the users to be added as reviewers in dependabot PRs
15
+ reviewers:
16
+ - volpatto
17
+
18
+ # Since we have a lot of workflows, it is better to save time and PRs
19
+ # and gather them into a single PR.
20
+ # Based on here: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/optimizing-pr-creation-version-updates#prioritizing-meaningful-updates
21
+ groups:
22
+ github-actions:
23
+ patterns:
24
+ # A wildcard to collect all the workflows
25
+ - "*"
@@ -0,0 +1,7 @@
1
+ ## Overview
2
+
3
+ Briefly describe the purpose of this pull request.
4
+
5
+ ## Changes
6
+
7
+ Describe what code behavior has changed.
@@ -0,0 +1,48 @@
1
+ name: Deploy Docs
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+ pages: write
12
+ id-token: write
13
+
14
+ concurrency:
15
+ group: pages
16
+ cancel-in-progress: false
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - name: Check out repository
23
+ uses: actions/checkout@v6
24
+
25
+ - name: Install Pixi
26
+ uses: prefix-dev/setup-pixi@v0
27
+ with:
28
+ environments: docs
29
+ locked: false
30
+
31
+ - name: Build docs
32
+ run: pixi run -e docs mkdocs build --strict
33
+
34
+ - name: Upload Pages artifact
35
+ uses: actions/upload-pages-artifact@v3
36
+ with:
37
+ path: site/
38
+
39
+ deploy:
40
+ needs: build
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: github-pages
44
+ url: ${{ steps.deployment.outputs.page_url }}
45
+ steps:
46
+ - name: Deploy to GitHub Pages
47
+ id: deployment
48
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,41 @@
1
+ name: Lint Diff
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: lint-diff-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ pre-commit-diff:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Check out repository
20
+ uses: actions/checkout@v6
21
+ with:
22
+ fetch-depth: 0
23
+
24
+ - name: Install Pixi
25
+ uses: prefix-dev/setup-pixi@v0
26
+ with:
27
+ environments: default
28
+
29
+ - name: Fetch PR base branch
30
+ shell: bash
31
+ run: |
32
+ git fetch origin \
33
+ "${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
34
+
35
+ - name: Run pre-commit on PR diff
36
+ shell: bash
37
+ run: |
38
+ pixi run -e default pre-commit run \
39
+ --from-ref "origin/${{ github.base_ref }}" \
40
+ --to-ref "${{ github.sha }}" \
41
+ --show-diff-on-failure
@@ -0,0 +1,45 @@
1
+ name: Weekly Pixi Lock Update
2
+
3
+ on:
4
+ schedule:
5
+ - cron: "0 6 * * 0"
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: write
10
+ pull-requests: write
11
+
12
+ concurrency:
13
+ group: pixi-lock-update
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ refresh-lockfile:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v6
23
+
24
+ - name: Install Pixi
25
+ uses: prefix-dev/setup-pixi@v0
26
+ with:
27
+ locked: false
28
+
29
+ - name: Refresh pixi.lock
30
+ shell: bash
31
+ run: pixi update --no-install
32
+
33
+ - name: Create pull request
34
+ uses: peter-evans/create-pull-request@v8
35
+ with:
36
+ branch: ci/weekly-pixi-lock
37
+ delete-branch: true
38
+ commit-message: "Update pixi lockfile"
39
+ title: "Update pixi lockfile"
40
+ body: |
41
+ Automated weekly refresh of `pixi.lock`.
42
+
43
+ This PR was created by the scheduled GitHub Actions workflow.
44
+ add-paths: |
45
+ pixi.lock
@@ -0,0 +1,88 @@
1
+ name: Publish PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: publish-pypi-${{ github.ref }}
14
+ cancel-in-progress: false
15
+
16
+ jobs:
17
+ build:
18
+ name: Build distribution
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - name: Check out repository
22
+ uses: actions/checkout@v6
23
+
24
+ - name: Set up Python
25
+ uses: actions/setup-python@v6
26
+ with:
27
+ python-version: "3.12"
28
+
29
+ - name: Install build tooling
30
+ run: python -m pip install --upgrade build twine
31
+
32
+ - name: Validate tag matches pyproject version
33
+ if: github.event_name == 'push'
34
+ shell: bash
35
+ run: |
36
+ python - <<'PY'
37
+ import tomllib
38
+ from pathlib import Path
39
+
40
+ version = tomllib.loads(Path("pyproject.toml").read_text(encoding="utf-8"))["project"]["version"]
41
+ tag = "${{ github.ref_name }}"
42
+ expected = f"v{version}"
43
+ if tag != expected:
44
+ raise SystemExit(f"Tag/version mismatch: got {tag!r}, expected {expected!r}")
45
+ print(f"Validated release tag {tag} against pyproject version {version}")
46
+ PY
47
+
48
+ - name: Build sdist and wheel
49
+ run: python -m build
50
+
51
+ - name: Check distribution metadata
52
+ run: python -m twine check dist/*
53
+
54
+ - name: Smoke-test wheel install
55
+ shell: bash
56
+ run: |
57
+ python -m venv .venv-smoke
58
+ source .venv-smoke/bin/activate
59
+ python -m pip install --upgrade pip
60
+ python -m pip install dist/*.whl
61
+ python -c "import voids; print(voids.__version__)"
62
+
63
+ - name: Upload distribution artifacts
64
+ uses: actions/upload-artifact@v7
65
+ with:
66
+ name: python-dist
67
+ path: dist/
68
+
69
+ publish:
70
+ name: Publish to PyPI
71
+ needs: build
72
+ runs-on: ubuntu-latest
73
+ if: github.event_name == 'push'
74
+ permissions:
75
+ id-token: write
76
+ contents: read
77
+ environment:
78
+ name: pypi
79
+ url: https://pypi.org/project/voids/
80
+ steps:
81
+ - name: Download distribution artifacts
82
+ uses: actions/download-artifact@v5
83
+ with:
84
+ name: python-dist
85
+ path: dist/
86
+
87
+ - name: Publish package distributions to PyPI
88
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,184 @@
1
+ name: Tests
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - main
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+ issues: write
13
+ pull-requests: write
14
+
15
+ concurrency:
16
+ group: tests-${{ github.ref }}
17
+ cancel-in-progress: true
18
+
19
+ jobs:
20
+ test:
21
+ name: test (${{ matrix.os }})
22
+ runs-on: ${{ matrix.os }}
23
+ env:
24
+ CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
25
+ strategy:
26
+ fail-fast: false
27
+ matrix:
28
+ os:
29
+ - ubuntu-latest
30
+ - macos-latest
31
+ - windows-latest
32
+
33
+ steps:
34
+ - name: Check out repository
35
+ uses: actions/checkout@v6
36
+ with:
37
+ fetch-depth: 0
38
+
39
+ - name: Install Pixi
40
+ uses: prefix-dev/setup-pixi@v0
41
+ with:
42
+ environments: lbm
43
+
44
+ - name: Run tests with coverage (Ubuntu only)
45
+ if: runner.os == 'Linux'
46
+ shell: bash
47
+ run: |
48
+ pixi run -e lbm pytest \
49
+ --cov=voids \
50
+ --cov-report=term-missing \
51
+ --cov-report=xml:coverage.xml \
52
+ -q
53
+
54
+ - name: Run tests
55
+ if: runner.os != 'Linux'
56
+ run: pixi run -e lbm pytest -q
57
+
58
+ - name: Upload coverage artifact
59
+ if: runner.os == 'Linux'
60
+ uses: actions/upload-artifact@v7
61
+ with:
62
+ name: coverage-xml
63
+ path: coverage.xml
64
+
65
+ - name: Fetch PR base branch
66
+ if: runner.os == 'Linux' && github.event_name == 'pull_request'
67
+ shell: bash
68
+ run: |
69
+ git fetch origin \
70
+ "${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}"
71
+
72
+ - name: Check diff coverage threshold
73
+ id: diff_cover
74
+ if: runner.os == 'Linux' && github.event_name == 'pull_request'
75
+ continue-on-error: true
76
+ shell: bash
77
+ run: |
78
+ python -m pip install --disable-pip-version-check diff-cover
79
+ diff-cover coverage.xml \
80
+ --compare-branch "origin/${{ github.base_ref }}" \
81
+ --fail-under=99 | tee diff-cover.txt
82
+
83
+ - name: Summarize coverage
84
+ id: coverage_summary
85
+ if: runner.os == 'Linux'
86
+ shell: bash
87
+ run: |
88
+ python - <<'PY'
89
+ import os
90
+ import pathlib
91
+ import re
92
+ import xml.etree.ElementTree as ET
93
+
94
+ overall = 100.0 * float(ET.parse("coverage.xml").getroot().attrib["line-rate"])
95
+ diff_text = ""
96
+ diff_path = pathlib.Path("diff-cover.txt")
97
+ if diff_path.exists():
98
+ diff_text = diff_path.read_text(encoding="utf-8")
99
+ match = re.search(r"(?m)^(?:Diff )?Coverage:\s+([0-9.]+)%$", diff_text)
100
+ diff = match.group(1) if match else "n/a"
101
+
102
+ with open(os.environ["GITHUB_OUTPUT"], "a", encoding="utf-8") as fh:
103
+ fh.write(f"overall={overall:.2f}\n")
104
+ fh.write(f"diff={diff}\n")
105
+ PY
106
+
107
+ - name: Comment coverage on PR
108
+ if: >
109
+ runner.os == 'Linux' &&
110
+ github.event_name == 'pull_request' &&
111
+ github.event.pull_request.head.repo.full_name == github.repository
112
+ uses: actions/github-script@v8
113
+ env:
114
+ OVERALL_COVERAGE: ${{ steps.coverage_summary.outputs.overall }}
115
+ DIFF_COVERAGE: ${{ steps.coverage_summary.outputs.diff }}
116
+ DIFF_STATUS: ${{ steps.diff_cover.outcome }}
117
+ with:
118
+ script: |
119
+ const fs = require('fs');
120
+ const marker = '<!-- voids-coverage-report -->';
121
+ const diffText = fs.existsSync('diff-cover.txt')
122
+ ? fs.readFileSync('diff-cover.txt', 'utf8').trim()
123
+ : 'diff-cover did not run.';
124
+ const result = process.env.DIFF_STATUS === 'success' ? 'passed' : 'failed';
125
+ const icon = process.env.DIFF_STATUS === 'success' ? '✅' : '❌';
126
+ const body = `${marker}
127
+ ## Coverage
128
+ - Overall line coverage on Ubuntu: \`${process.env.OVERALL_COVERAGE}%\`
129
+ - Diff coverage: \`${process.env.DIFF_COVERAGE}%\`
130
+ - Required diff coverage: \`99%\`
131
+ - Result: ${icon} ${result}
132
+
133
+ <details><summary>diff-cover output</summary>
134
+
135
+ \`\`\`text
136
+ ${diffText}
137
+ \`\`\`
138
+ </details>`;
139
+
140
+ const { owner, repo } = context.repo;
141
+ const issue_number = context.issue.number;
142
+ const comments = await github.paginate(github.rest.issues.listComments, {
143
+ owner,
144
+ repo,
145
+ issue_number,
146
+ });
147
+ const previous = comments.find(
148
+ (comment) =>
149
+ comment.user.type === 'Bot' &&
150
+ comment.body &&
151
+ comment.body.includes(marker),
152
+ );
153
+
154
+ if (previous) {
155
+ await github.rest.issues.updateComment({
156
+ owner,
157
+ repo,
158
+ comment_id: previous.id,
159
+ body,
160
+ });
161
+ } else {
162
+ await github.rest.issues.createComment({
163
+ owner,
164
+ repo,
165
+ issue_number,
166
+ body,
167
+ });
168
+ }
169
+
170
+ - name: Upload coverage to Codecov
171
+ if: runner.os == 'Linux' && env.CODECOV_TOKEN != ''
172
+ uses: codecov/codecov-action@v5
173
+ with:
174
+ files: coverage.xml
175
+ fail_ci_if_error: false
176
+ token: ${{ env.CODECOV_TOKEN }}
177
+ verbose: true
178
+
179
+ - name: Enforce diff coverage threshold
180
+ if: runner.os == 'Linux' && github.event_name == 'pull_request' && steps.diff_cover.outcome == 'failure'
181
+ shell: bash
182
+ run: |
183
+ echo "Diff coverage is below the required 99% threshold."
184
+ exit 1
@@ -0,0 +1,29 @@
1
+ name: Type Check Diff
2
+
3
+ on:
4
+ pull_request:
5
+ workflow_dispatch:
6
+
7
+ permissions:
8
+ contents: read
9
+
10
+ concurrency:
11
+ group: typecheck-diff-${{ github.ref }}
12
+ cancel-in-progress: true
13
+
14
+ jobs:
15
+ mypy:
16
+ runs-on: ubuntu-latest
17
+
18
+ steps:
19
+ - name: Check out repository
20
+ uses: actions/checkout@v6
21
+
22
+ - name: Install Pixi
23
+ uses: prefix-dev/setup-pixi@v0
24
+ with:
25
+ environments: default
26
+
27
+ - name: Run mypy
28
+ shell: bash
29
+ run: pixi run -e default typecheck