torchfits 0.1.1__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 (264) hide show
  1. torchfits-0.1.1/.gitattributes +2 -0
  2. torchfits-0.1.1/.github/workflows/README.md +48 -0
  3. torchfits-0.1.1/.github/workflows/ci.yml +203 -0
  4. torchfits-0.1.1/.github/workflows/memory_tests.yml.backup +118 -0
  5. torchfits-0.1.1/.gitignore +142 -0
  6. torchfits-0.1.1/.gitmodules +3 -0
  7. torchfits-0.1.1/.pre-commit-config.yaml +35 -0
  8. torchfits-0.1.1/API.md +915 -0
  9. torchfits-0.1.1/CHANGELOG.md +114 -0
  10. torchfits-0.1.1/CMakeLists.txt +5 -0
  11. torchfits-0.1.1/LICENSE +339 -0
  12. torchfits-0.1.1/MANIFEST.in +33 -0
  13. torchfits-0.1.1/PKG-INFO +264 -0
  14. torchfits-0.1.1/README.md +216 -0
  15. torchfits-0.1.1/RELEASE_NOTES_v0.1.1.md +164 -0
  16. torchfits-0.1.1/benchmarks/benchmark_all.py +1465 -0
  17. torchfits-0.1.1/benchmarks/benchmark_buffer.py +320 -0
  18. torchfits-0.1.1/benchmarks/benchmark_cache.py +321 -0
  19. torchfits-0.1.1/benchmarks/benchmark_cpp_backend.py +365 -0
  20. torchfits-0.1.1/benchmarks/benchmark_float64.py +51 -0
  21. torchfits-0.1.1/benchmarks/benchmark_gpu_memory.py +352 -0
  22. torchfits-0.1.1/benchmarks/benchmark_mmap.py +71 -0
  23. torchfits-0.1.1/benchmarks/benchmark_mps.py +142 -0
  24. torchfits-0.1.1/benchmarks/benchmark_parallel.py +77 -0
  25. torchfits-0.1.1/benchmarks/benchmark_scaled.py +62 -0
  26. torchfits-0.1.1/benchmarks/benchmark_table.py +330 -0
  27. torchfits-0.1.1/benchmarks/benchmark_table_comprehensive.py +518 -0
  28. torchfits-0.1.1/benchmarks/benchmark_transforms.py +190 -0
  29. torchfits-0.1.1/benchmarks/benchmark_vertical_slice.py +93 -0
  30. torchfits-0.1.1/examples/README.md +124 -0
  31. torchfits-0.1.1/examples/example_basic_reading.py +73 -0
  32. torchfits-0.1.1/examples/example_comprehensive_ml_pipeline.py +461 -0
  33. torchfits-0.1.1/examples/example_cutouts.py +89 -0
  34. torchfits-0.1.1/examples/example_datacube.py +95 -0
  35. torchfits-0.1.1/examples/example_dataset.py +130 -0
  36. torchfits-0.1.1/examples/example_frame.py +204 -0
  37. torchfits-0.1.1/examples/example_mef.py +91 -0
  38. torchfits-0.1.1/examples/example_ml_pipeline.py +362 -0
  39. torchfits-0.1.1/examples/example_mnist.py +279 -0
  40. torchfits-0.1.1/examples/example_phase2_features.py +362 -0
  41. torchfits-0.1.1/examples/example_sdss_classification.py +401 -0
  42. torchfits-0.1.1/examples/example_tables.py +114 -0
  43. torchfits-0.1.1/examples/example_wcs.py +124 -0
  44. torchfits-0.1.1/extern/cfitsio/.gitattributes +0 -0
  45. torchfits-0.1.1/extern/cfitsio/.github/workflows/ci.yml +76 -0
  46. torchfits-0.1.1/extern/cfitsio/.github/workflows/codeql.yml +72 -0
  47. torchfits-0.1.1/extern/cfitsio/.gitignore +93 -0
  48. torchfits-0.1.1/extern/cfitsio/CMakeLists.txt +426 -0
  49. torchfits-0.1.1/extern/cfitsio/ChangeLog +4892 -0
  50. torchfits-0.1.1/extern/cfitsio/INSTALL +368 -0
  51. torchfits-0.1.1/extern/cfitsio/Makefile.am +214 -0
  52. torchfits-0.1.1/extern/cfitsio/Makefile.in +2228 -0
  53. torchfits-0.1.1/extern/cfitsio/README.MacOS +69 -0
  54. torchfits-0.1.1/extern/cfitsio/README.md +102 -0
  55. torchfits-0.1.1/extern/cfitsio/README.win +211 -0
  56. torchfits-0.1.1/extern/cfitsio/README_OLD.win +83 -0
  57. torchfits-0.1.1/extern/cfitsio/aclocal.m4 +1348 -0
  58. torchfits-0.1.1/extern/cfitsio/buffers.c +1377 -0
  59. torchfits-0.1.1/extern/cfitsio/cfileio.c +8086 -0
  60. torchfits-0.1.1/extern/cfitsio/cfitsio.pc.cmake +12 -0
  61. torchfits-0.1.1/extern/cfitsio/cfitsio.pc.in +12 -0
  62. torchfits-0.1.1/extern/cfitsio/cfitsio.spec +152 -0
  63. torchfits-0.1.1/extern/cfitsio/cfitsio.xcodeproj/project.pbxproj +120 -0
  64. torchfits-0.1.1/extern/cfitsio/cfortran.h +2599 -0
  65. torchfits-0.1.1/extern/cfitsio/checksum.c +508 -0
  66. torchfits-0.1.1/extern/cfitsio/cmake/cfitsioConfig.cmake +1 -0
  67. torchfits-0.1.1/extern/cfitsio/cmake/portfile.cmake +68 -0
  68. torchfits-0.1.1/extern/cfitsio/config/compile +351 -0
  69. torchfits-0.1.1/extern/cfitsio/config/config.guess +1812 -0
  70. torchfits-0.1.1/extern/cfitsio/config/config.sub +1971 -0
  71. torchfits-0.1.1/extern/cfitsio/config/depcomp +792 -0
  72. torchfits-0.1.1/extern/cfitsio/config/install-sh +541 -0
  73. torchfits-0.1.1/extern/cfitsio/config/ltmain.sh +11524 -0
  74. torchfits-0.1.1/extern/cfitsio/config/missing +236 -0
  75. torchfits-0.1.1/extern/cfitsio/configure +25213 -0
  76. torchfits-0.1.1/extern/cfitsio/configure.ac +639 -0
  77. torchfits-0.1.1/extern/cfitsio/docs/cfitsio.ps +18813 -0
  78. torchfits-0.1.1/extern/cfitsio/docs/cfitsio.tex +11414 -0
  79. torchfits-0.1.1/extern/cfitsio/docs/cfitsio.toc +127 -0
  80. torchfits-0.1.1/extern/cfitsio/docs/cfortran.doc +2088 -0
  81. torchfits-0.1.1/extern/cfitsio/docs/fitsio.ps +14045 -0
  82. torchfits-0.1.1/extern/cfitsio/docs/fitsio.tex +7935 -0
  83. torchfits-0.1.1/extern/cfitsio/docs/fitsio.toc +95 -0
  84. torchfits-0.1.1/extern/cfitsio/docs/fpackguide.odt +0 -0
  85. torchfits-0.1.1/extern/cfitsio/docs/quick.ps +5291 -0
  86. torchfits-0.1.1/extern/cfitsio/docs/quick.tex +2157 -0
  87. torchfits-0.1.1/extern/cfitsio/docs/quick.toc +25 -0
  88. torchfits-0.1.1/extern/cfitsio/drvrfile.c +1140 -0
  89. torchfits-0.1.1/extern/cfitsio/drvrgsiftp.c +538 -0
  90. torchfits-0.1.1/extern/cfitsio/drvrgsiftp.h +21 -0
  91. torchfits-0.1.1/extern/cfitsio/drvrmem.c +1343 -0
  92. torchfits-0.1.1/extern/cfitsio/drvrnet.c +4511 -0
  93. torchfits-0.1.1/extern/cfitsio/drvrsmem.c +974 -0
  94. torchfits-0.1.1/extern/cfitsio/drvrsmem.h +179 -0
  95. torchfits-0.1.1/extern/cfitsio/editcol.c +3226 -0
  96. torchfits-0.1.1/extern/cfitsio/edithdu.c +924 -0
  97. torchfits-0.1.1/extern/cfitsio/eval.l +559 -0
  98. torchfits-0.1.1/extern/cfitsio/eval.y +6401 -0
  99. torchfits-0.1.1/extern/cfitsio/eval_defs.h +208 -0
  100. torchfits-0.1.1/extern/cfitsio/eval_f.c +2955 -0
  101. torchfits-0.1.1/extern/cfitsio/eval_l.c +2962 -0
  102. torchfits-0.1.1/extern/cfitsio/eval_tab.h +130 -0
  103. torchfits-0.1.1/extern/cfitsio/eval_y.c +8639 -0
  104. torchfits-0.1.1/extern/cfitsio/f77.inc +31 -0
  105. torchfits-0.1.1/extern/cfitsio/f77_wrap.h +289 -0
  106. torchfits-0.1.1/extern/cfitsio/f77_wrap1.c +362 -0
  107. torchfits-0.1.1/extern/cfitsio/f77_wrap2.c +734 -0
  108. torchfits-0.1.1/extern/cfitsio/f77_wrap3.c +860 -0
  109. torchfits-0.1.1/extern/cfitsio/f77_wrap4.c +572 -0
  110. torchfits-0.1.1/extern/cfitsio/fits_hcompress.c +1872 -0
  111. torchfits-0.1.1/extern/cfitsio/fits_hdecompress.c +2616 -0
  112. torchfits-0.1.1/extern/cfitsio/fitscore.c +9931 -0
  113. torchfits-0.1.1/extern/cfitsio/fitsio.h +2086 -0
  114. torchfits-0.1.1/extern/cfitsio/fitsio2.h +1349 -0
  115. torchfits-0.1.1/extern/cfitsio/getcol.c +1221 -0
  116. torchfits-0.1.1/extern/cfitsio/getcolb.c +2046 -0
  117. torchfits-0.1.1/extern/cfitsio/getcold.c +1721 -0
  118. torchfits-0.1.1/extern/cfitsio/getcole.c +1789 -0
  119. torchfits-0.1.1/extern/cfitsio/getcoli.c +1962 -0
  120. torchfits-0.1.1/extern/cfitsio/getcolj.c +3855 -0
  121. torchfits-0.1.1/extern/cfitsio/getcolk.c +1955 -0
  122. torchfits-0.1.1/extern/cfitsio/getcoll.c +621 -0
  123. torchfits-0.1.1/extern/cfitsio/getcols.c +992 -0
  124. torchfits-0.1.1/extern/cfitsio/getcolsb.c +2045 -0
  125. torchfits-0.1.1/extern/cfitsio/getcolui.c +1967 -0
  126. torchfits-0.1.1/extern/cfitsio/getcoluj.c +3882 -0
  127. torchfits-0.1.1/extern/cfitsio/getcoluk.c +1975 -0
  128. torchfits-0.1.1/extern/cfitsio/getkey.c +3745 -0
  129. torchfits-0.1.1/extern/cfitsio/group.c +6749 -0
  130. torchfits-0.1.1/extern/cfitsio/group.h +68 -0
  131. torchfits-0.1.1/extern/cfitsio/grparser.c +1357 -0
  132. torchfits-0.1.1/extern/cfitsio/grparser.h +183 -0
  133. torchfits-0.1.1/extern/cfitsio/histo.c +3252 -0
  134. torchfits-0.1.1/extern/cfitsio/imcompress.c +9928 -0
  135. torchfits-0.1.1/extern/cfitsio/iraffits.c +2098 -0
  136. torchfits-0.1.1/extern/cfitsio/iter_a.c +147 -0
  137. torchfits-0.1.1/extern/cfitsio/iter_a.f +224 -0
  138. torchfits-0.1.1/extern/cfitsio/iter_a.fit +1111 -0
  139. torchfits-0.1.1/extern/cfitsio/iter_b.c +114 -0
  140. torchfits-0.1.1/extern/cfitsio/iter_b.f +193 -0
  141. torchfits-0.1.1/extern/cfitsio/iter_b.fit +0 -0
  142. torchfits-0.1.1/extern/cfitsio/iter_c.c +171 -0
  143. torchfits-0.1.1/extern/cfitsio/iter_c.f +347 -0
  144. torchfits-0.1.1/extern/cfitsio/iter_c.fit +708 -6
  145. torchfits-0.1.1/extern/cfitsio/iter_image.fit +1 -0
  146. torchfits-0.1.1/extern/cfitsio/licenses/License.txt +25 -0
  147. torchfits-0.1.1/extern/cfitsio/longnam.h +631 -0
  148. torchfits-0.1.1/extern/cfitsio/m4/ax_cfitsio.m4 +156 -0
  149. torchfits-0.1.1/extern/cfitsio/m4/libtool.m4 +8488 -0
  150. torchfits-0.1.1/extern/cfitsio/m4/ltoptions.m4 +467 -0
  151. torchfits-0.1.1/extern/cfitsio/m4/ltsugar.m4 +124 -0
  152. torchfits-0.1.1/extern/cfitsio/m4/ltversion.m4 +24 -0
  153. torchfits-0.1.1/extern/cfitsio/m4/lt~obsolete.m4 +99 -0
  154. torchfits-0.1.1/extern/cfitsio/modkey.c +1828 -0
  155. torchfits-0.1.1/extern/cfitsio/pliocomp.c +331 -0
  156. torchfits-0.1.1/extern/cfitsio/putcol.c +2187 -0
  157. torchfits-0.1.1/extern/cfitsio/putcolb.c +1045 -0
  158. torchfits-0.1.1/extern/cfitsio/putcold.c +1089 -0
  159. torchfits-0.1.1/extern/cfitsio/putcole.c +1102 -0
  160. torchfits-0.1.1/extern/cfitsio/putcoli.c +1007 -0
  161. torchfits-0.1.1/extern/cfitsio/putcolj.c +2038 -0
  162. torchfits-0.1.1/extern/cfitsio/putcolk.c +1038 -0
  163. torchfits-0.1.1/extern/cfitsio/putcoll.c +372 -0
  164. torchfits-0.1.1/extern/cfitsio/putcols.c +304 -0
  165. torchfits-0.1.1/extern/cfitsio/putcolsb.c +994 -0
  166. torchfits-0.1.1/extern/cfitsio/putcolu.c +629 -0
  167. torchfits-0.1.1/extern/cfitsio/putcolui.c +987 -0
  168. torchfits-0.1.1/extern/cfitsio/putcoluj.c +1974 -0
  169. torchfits-0.1.1/extern/cfitsio/putcoluk.c +1012 -0
  170. torchfits-0.1.1/extern/cfitsio/putkey.c +3482 -0
  171. torchfits-0.1.1/extern/cfitsio/quantize.c +3945 -0
  172. torchfits-0.1.1/extern/cfitsio/region.c +1809 -0
  173. torchfits-0.1.1/extern/cfitsio/region.h +82 -0
  174. torchfits-0.1.1/extern/cfitsio/ricecomp.c +1366 -0
  175. torchfits-0.1.1/extern/cfitsio/sample.tpl +121 -0
  176. torchfits-0.1.1/extern/cfitsio/scalnull.c +229 -0
  177. torchfits-0.1.1/extern/cfitsio/simplerng.c +461 -0
  178. torchfits-0.1.1/extern/cfitsio/simplerng.h +27 -0
  179. torchfits-0.1.1/extern/cfitsio/swapproc.c +247 -0
  180. torchfits-0.1.1/extern/cfitsio/testf77.std +0 -0
  181. torchfits-0.1.1/extern/cfitsio/testprog.std +48 -0
  182. torchfits-0.1.1/extern/cfitsio/testprog.tpt +12 -0
  183. torchfits-0.1.1/extern/cfitsio/utilities/cookbook.c +573 -0
  184. torchfits-0.1.1/extern/cfitsio/utilities/cookbook.f +772 -0
  185. torchfits-0.1.1/extern/cfitsio/utilities/fitscopy.c +60 -0
  186. torchfits-0.1.1/extern/cfitsio/utilities/fitsverify.c +267 -0
  187. torchfits-0.1.1/extern/cfitsio/utilities/fpack.c +453 -0
  188. torchfits-0.1.1/extern/cfitsio/utilities/fpack.h +189 -0
  189. torchfits-0.1.1/extern/cfitsio/utilities/fpackutil.c +2431 -0
  190. torchfits-0.1.1/extern/cfitsio/utilities/ftverify.c +466 -0
  191. torchfits-0.1.1/extern/cfitsio/utilities/funpack.c +174 -0
  192. torchfits-0.1.1/extern/cfitsio/utilities/fverify.h +214 -0
  193. torchfits-0.1.1/extern/cfitsio/utilities/fvrf_data.c +890 -0
  194. torchfits-0.1.1/extern/cfitsio/utilities/fvrf_file.c +289 -0
  195. torchfits-0.1.1/extern/cfitsio/utilities/fvrf_head.c +3347 -0
  196. torchfits-0.1.1/extern/cfitsio/utilities/fvrf_key.c +730 -0
  197. torchfits-0.1.1/extern/cfitsio/utilities/fvrf_misc.c +337 -0
  198. torchfits-0.1.1/extern/cfitsio/utilities/imcopy.c +233 -0
  199. torchfits-0.1.1/extern/cfitsio/utilities/iter_image.c +85 -0
  200. torchfits-0.1.1/extern/cfitsio/utilities/iter_var.c +93 -0
  201. torchfits-0.1.1/extern/cfitsio/utilities/smem.c +77 -0
  202. torchfits-0.1.1/extern/cfitsio/utilities/speed.c +590 -0
  203. torchfits-0.1.1/extern/cfitsio/utilities/testf77.f +2488 -0
  204. torchfits-0.1.1/extern/cfitsio/utilities/testprog.c +2589 -0
  205. torchfits-0.1.1/extern/cfitsio/vmsieee.c +130 -0
  206. torchfits-0.1.1/extern/cfitsio/wcssub.c +1043 -0
  207. torchfits-0.1.1/extern/cfitsio/wcsutil.c +502 -0
  208. torchfits-0.1.1/extern/cfitsio/winDumpExts.mak +191 -0
  209. torchfits-0.1.1/extern/cfitsio/windumpexts.c +504 -0
  210. torchfits-0.1.1/extern/cfitsio/zcompress.c +549 -0
  211. torchfits-0.1.1/extern/cfitsio/zuncompress.c +603 -0
  212. torchfits-0.1.1/pixi.toml +128 -0
  213. torchfits-0.1.1/pyproject.toml +89 -0
  214. torchfits-0.1.1/src/torchfits/__init__.py +641 -0
  215. torchfits-0.1.1/src/torchfits/buffer.py +362 -0
  216. torchfits-0.1.1/src/torchfits/cache.py +239 -0
  217. torchfits-0.1.1/src/torchfits/core.py +231 -0
  218. torchfits-0.1.1/src/torchfits/cpp_src/CMakeLists.txt +186 -0
  219. torchfits-0.1.1/src/torchfits/cpp_src/bindings.cpp +313 -0
  220. torchfits-0.1.1/src/torchfits/cpp_src/cache.cpp +107 -0
  221. torchfits-0.1.1/src/torchfits/cpp_src/cache.h +31 -0
  222. torchfits-0.1.1/src/torchfits/cpp_src/fast_io.cpp +228 -0
  223. torchfits-0.1.1/src/torchfits/cpp_src/fits.cpp +737 -0
  224. torchfits-0.1.1/src/torchfits/cpp_src/hardware.cpp +161 -0
  225. torchfits-0.1.1/src/torchfits/cpp_src/hardware.h +85 -0
  226. torchfits-0.1.1/src/torchfits/cpp_src/table.cpp +1189 -0
  227. torchfits-0.1.1/src/torchfits/cpp_src/table.h +43 -0
  228. torchfits-0.1.1/src/torchfits/cpp_src/torch_compat.h +52 -0
  229. torchfits-0.1.1/src/torchfits/cpp_src/types.h +14 -0
  230. torchfits-0.1.1/src/torchfits/cpp_src/wcs.cpp +466 -0
  231. torchfits-0.1.1/src/torchfits/cpp_src/wcs.h +89 -0
  232. torchfits-0.1.1/src/torchfits/dataloader.py +338 -0
  233. torchfits-0.1.1/src/torchfits/datasets.py +178 -0
  234. torchfits-0.1.1/src/torchfits/frame.py +163 -0
  235. torchfits-0.1.1/src/torchfits/hdu.py +594 -0
  236. torchfits-0.1.1/src/torchfits/header_parser.py +341 -0
  237. torchfits-0.1.1/src/torchfits/interop.py +87 -0
  238. torchfits-0.1.1/src/torchfits/logging.py +95 -0
  239. torchfits-0.1.1/src/torchfits/spectral.py +425 -0
  240. torchfits-0.1.1/src/torchfits/transforms.py +621 -0
  241. torchfits-0.1.1/src/torchfits/wcs.py +321 -0
  242. torchfits-0.1.1/tests/test_api.py +207 -0
  243. torchfits-0.1.1/tests/test_ascii_table.py +80 -0
  244. torchfits-0.1.1/tests/test_astro_transforms.py +65 -0
  245. torchfits-0.1.1/tests/test_buffer.py +493 -0
  246. torchfits-0.1.1/tests/test_cache.py +106 -0
  247. torchfits-0.1.1/tests/test_complex_header.py +70 -0
  248. torchfits-0.1.1/tests/test_compression.py +203 -0
  249. torchfits-0.1.1/tests/test_core.py +55 -0
  250. torchfits-0.1.1/tests/test_dataloader.py +329 -0
  251. torchfits-0.1.1/tests/test_dlpack_roundtrip.py +11 -0
  252. torchfits-0.1.1/tests/test_frame.py +52 -0
  253. torchfits-0.1.1/tests/test_get_header.py +36 -0
  254. torchfits-0.1.1/tests/test_hdu.py +52 -0
  255. torchfits-0.1.1/tests/test_integration.py +337 -0
  256. torchfits-0.1.1/tests/test_performance.py +273 -0
  257. torchfits-0.1.1/tests/test_spectral.py +318 -0
  258. torchfits-0.1.1/tests/test_table.py +220 -0
  259. torchfits-0.1.1/tests/test_transforms.py +290 -0
  260. torchfits-0.1.1/tests/test_validation.py +25 -0
  261. torchfits-0.1.1/tests/test_wcs.py +64 -0
  262. torchfits-0.1.1/tests/test_wcs_projections.py +89 -0
  263. torchfits-0.1.1/tests/test_wcs_spectral.py +72 -0
  264. torchfits-0.1.1/tests/test_writing.py +53 -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,48 @@
1
+ # GitHub Workflows
2
+
3
+ This directory contains the GitHub Actions CI/CD workflows for torchfits.
4
+
5
+ ## Active Workflows
6
+
7
+ ### `ci.yml` - Comprehensive CI Pipeline
8
+ **Triggers:** Push to main/develop branches, Pull Requests, Releases
9
+ **Purpose:** Complete build, test, quality assurance, and deployment pipeline
10
+
11
+ **Jobs:**
12
+ 1. **Code Quality** - Code formatting and linting (Python 3.12)
13
+ - black (formatting)
14
+ - ruff (linting)
15
+
16
+ 2. **Build & Test** - Multi-version builds and tests
17
+ - **OS:** Ubuntu
18
+ - **Python:** 3.11, 3.12
19
+ - **System deps:** cfitsio, wcslib
20
+ - **Tests:** Full pytest suite
21
+
22
+ 3. **Memory Safety** - Memory leak detection (placeholder for valgrind)
23
+
24
+ 4. **Performance Benchmarks** - Performance regression testing (placeholder)
25
+
26
+ 5. **Documentation** - Documentation build verification (placeholder)
27
+
28
+ 6. **Publish** - Automated PyPI publishing on GitHub releases
29
+
30
+ **Key Features:**
31
+ - C++ extension compilation with cfitsio/wcslib
32
+ - Cross-Python version testing
33
+ - Code quality enforcement
34
+ - Automated PyPI releases
35
+
36
+ ## CI Configuration
37
+
38
+ - **Python Versions:** 3.11, 3.12
39
+ - **Code Quality Tools:** black, ruff
40
+ - **Build Dependencies:** cfitsio, wcslib (installed via apt)
41
+ - **PyPI Publishing:** Requires `PYPI_API_TOKEN` repository secret
42
+
43
+ ## Setup for PyPI Publishing
44
+
45
+ Add the following secret to your GitHub repository settings:
46
+ - `PYPI_API_TOKEN`: Your PyPI API token
47
+
48
+ The workflow automatically publishes to PyPI when you create a GitHub release.
@@ -0,0 +1,203 @@
1
+ name: Comprehensive CI
2
+
3
+ on:
4
+ push:
5
+ branches: [ main, develop ]
6
+ pull_request:
7
+ branches: [ main, develop ]
8
+ release:
9
+ types: [published]
10
+
11
+ env:
12
+ FORCE_COLOR: 1
13
+
14
+ jobs:
15
+ code-quality:
16
+ name: Code Quality
17
+ runs-on: ubuntu-latest
18
+ steps:
19
+ - uses: actions/checkout@v4
20
+
21
+ - name: Set up Python 3.12
22
+ uses: actions/setup-python@v5
23
+ with:
24
+ python-version: '3.12'
25
+
26
+ - name: Install code quality tools
27
+ run: |
28
+ python -m pip install --upgrade pip
29
+ pip install black ruff
30
+
31
+ - name: Check formatting with black
32
+ run: black --check --diff src/ tests/ examples/ benchmarks/
33
+
34
+ - name: Lint with ruff
35
+ run: ruff check --output-format=github .
36
+
37
+ build-test:
38
+ name: Build & Test
39
+ runs-on: ${{ matrix.os }}
40
+ strategy:
41
+ fail-fast: false
42
+ matrix:
43
+ os: [ubuntu-latest]
44
+ python-version: ['3.11', '3.12']
45
+
46
+ steps:
47
+ - uses: actions/checkout@v4
48
+ with:
49
+ submodules: recursive
50
+
51
+ - name: Set up Python ${{ matrix.python-version }}
52
+ uses: actions/setup-python@v5
53
+ with:
54
+ python-version: ${{ matrix.python-version }}
55
+
56
+ - name: Install system dependencies (Ubuntu)
57
+ if: matrix.os == 'ubuntu-latest'
58
+ run: |
59
+ sudo apt-get update
60
+ sudo apt-get install -y libcfitsio-dev wcslib-dev build-essential
61
+
62
+ - name: Install Python dependencies
63
+ run: |
64
+ python -m pip install --upgrade pip wheel setuptools
65
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
66
+ pip install numpy astropy fitsio pytest nanobind scikit-build-core
67
+ pip install pytorch-frame psutil
68
+
69
+ - name: Build package
70
+ run: |
71
+ pip install -e .
72
+
73
+ - name: Run full test suite
74
+ run: |
75
+ pytest tests/ -v --tb=short
76
+
77
+ memory-safety:
78
+ name: Memory Leak Detection
79
+ runs-on: ubuntu-latest
80
+ needs: build-test
81
+
82
+ steps:
83
+ - uses: actions/checkout@v4
84
+ with:
85
+ submodules: recursive
86
+
87
+ - name: Set up Python 3.12
88
+ uses: actions/setup-python@v5
89
+ with:
90
+ python-version: '3.12'
91
+
92
+ - name: Install system dependencies
93
+ run: |
94
+ sudo apt-get update
95
+ sudo apt-get install -y valgrind libcfitsio-dev wcslib-dev build-essential
96
+
97
+ - name: Install Python dependencies
98
+ run: |
99
+ python -m pip install --upgrade pip wheel setuptools
100
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
101
+ pip install numpy astropy fitsio pytest pybind11
102
+ pip install -e .
103
+
104
+ - name: Run memory leak tests
105
+ run: |
106
+ echo "Memory leak testing would run here with valgrind"
107
+ echo "Skipping for initial release"
108
+
109
+ performance-benchmark:
110
+ name: Performance Benchmarks
111
+ runs-on: ubuntu-latest
112
+ needs: build-test
113
+
114
+ steps:
115
+ - uses: actions/checkout@v4
116
+ with:
117
+ submodules: recursive
118
+
119
+ - name: Set up Python 3.12
120
+ uses: actions/setup-python@v5
121
+ with:
122
+ python-version: '3.12'
123
+
124
+ - name: Install system dependencies
125
+ run: |
126
+ sudo apt-get update
127
+ sudo apt-get install -y libcfitsio-dev wcslib-dev build-essential
128
+
129
+ - name: Install Python dependencies
130
+ run: |
131
+ python -m pip install --upgrade pip wheel setuptools
132
+ pip install torch --index-url https://download.pytorch.org/whl/cpu
133
+ pip install numpy astropy fitsio pytest pybind11
134
+ pip install -e .
135
+
136
+ - name: Run performance benchmarks
137
+ run: |
138
+ echo "Performance benchmarks would run here"
139
+ echo "Skipping for now - benchmark files need to be verified"
140
+
141
+ - name: Generate performance report
142
+ run: |
143
+ python -c "
144
+ import torchfits
145
+ print('=== Performance Summary ===')
146
+ print('torchfits successfully built and tested')
147
+ print('See test output above for detailed benchmarks')
148
+ "
149
+
150
+ documentation:
151
+ name: Documentation Build
152
+ runs-on: ubuntu-latest
153
+
154
+ steps:
155
+ - uses: actions/checkout@v4
156
+
157
+ - name: Set up Python 3.12
158
+ uses: actions/setup-python@v5
159
+ with:
160
+ python-version: '3.12'
161
+
162
+ - name: Install dependencies
163
+ run: |
164
+ python -m pip install --upgrade pip
165
+ pip install sphinx sphinx-rtd-theme
166
+
167
+ - name: Build documentation
168
+ run: |
169
+ # Add when docs/ directory exists
170
+ echo "Documentation build would go here"
171
+ echo "README.md exists: $(ls -la README.md)"
172
+
173
+ publish:
174
+ name: Publish to PyPI
175
+ runs-on: ubuntu-latest
176
+ needs: [code-quality, build-test, memory-safety]
177
+ if: github.event_name == 'release' && github.event.action == 'published'
178
+
179
+ steps:
180
+ - uses: actions/checkout@v4
181
+ with:
182
+ submodules: recursive
183
+
184
+ - name: Set up Python 3.12
185
+ uses: actions/setup-python@v5
186
+ with:
187
+ python-version: '3.12'
188
+
189
+ - name: Install dependencies
190
+ run: |
191
+ python -m pip install --upgrade pip
192
+ pip install build twine
193
+
194
+ - name: Build package
195
+ run: |
196
+ python -m build
197
+
198
+ - name: Publish to PyPI
199
+ env:
200
+ TWINE_USERNAME: __token__
201
+ TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
202
+ run: |
203
+ twine upload dist/*
@@ -0,0 +1,118 @@
1
+ name: Memory Leak Tests
2
+
3
+ on:
4
+ push:
5
+ branches: [ main ]
6
+ pull_request:
7
+ branches: [ main ]
8
+
9
+ jobs:
10
+ basic-tests:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - uses: actions/checkout@v4
15
+
16
+ - name: Set up Python
17
+ uses: actions/setup-python@v5
18
+ with:
19
+ python-version: '3.9'
20
+
21
+ - name: Install Python dependencies
22
+ run: |
23
+ python -m pip install --upgrade pip
24
+ pip install pytest torch numpy astropy pybind11
25
+
26
+ - name: Test installation
27
+ run: |
28
+ pip install -e .
29
+
30
+ - name: Run basic functionality tests
31
+ run: |
32
+ python -c "
33
+ import torchfits
34
+ import torch
35
+ print('TorchFits imported successfully')
36
+
37
+ # Test basic file reading
38
+ data = torchfits.read('examples/basic_example.fits')
39
+ print(f'Read data shape: {data.shape}')
40
+
41
+ # Test table reading
42
+ table_data = torchfits.read('examples/table_example.fits', hdu=1)
43
+ print(f'Table has {len(table_data)} columns')
44
+
45
+ print('Basic tests passed!')
46
+ "
47
+
48
+ memory-tests:
49
+ runs-on: ubuntu-latest
50
+ needs: basic-tests
51
+
52
+ steps:
53
+ - uses: actions/checkout@v4
54
+
55
+ - name: Set up Python
56
+ uses: actions/setup-python@v5
57
+ with:
58
+ python-version: '3.9'
59
+
60
+ - name: Install system dependencies
61
+ run: |
62
+ sudo apt-get update
63
+ sudo apt-get install -y valgrind build-essential
64
+
65
+ - name: Install Python dependencies
66
+ run: |
67
+ python -m pip install --upgrade pip
68
+ pip install pytest torch numpy astropy pybind11
69
+ pip install -e .
70
+
71
+
72
+ - name: Run memory tests
73
+ run: |
74
+ # Create memory test script
75
+ cat > memory_test.py << 'EOF'
76
+ import torchfits
77
+ import torch
78
+ import os
79
+
80
+ # Test basic file reading with existing example file
81
+ print("Testing basic FITS reading...")
82
+ data = torchfits.read("examples/basic_example.fits")
83
+ print(f"Read data shape: {data.shape}")
84
+
85
+ # Test table reading
86
+ print("Testing table reading...")
87
+ table_data = torchfits.read("examples/table_example.fits", hdu=1)
88
+ print(f"Table columns: {list(table_data.keys())}")
89
+
90
+ # Test header reading
91
+ print("Testing header reading...")
92
+ header = torchfits.get_header("examples/basic_example.fits")
93
+ print(f"Header keys: {len(header)} entries")
94
+
95
+ # Test WCS if header has WCS info
96
+ try:
97
+ coords = torch.tensor([[10.0, 10.0]], dtype=torch.float64)
98
+ if any(key.startswith('CTYPE') for key in header.keys()):
99
+ world_coords = torchfits.pixel_to_world(coords, header)
100
+ pixel_coords = torchfits.world_to_pixel(world_coords, header)
101
+ print("WCS transformations successful")
102
+ else:
103
+ print("No WCS info in header, skipping WCS tests")
104
+ except Exception as e:
105
+ print(f"WCS test failed (expected for basic example): {e}")
106
+
107
+ # Test cache clearing
108
+ try:
109
+ torchfits._clear_cache()
110
+ print("Cache cleared successfully")
111
+ except Exception as e:
112
+ print(f"Cache clearing failed: {e}")
113
+
114
+ print("All tests completed successfully!")
115
+ EOF
116
+
117
+ # Run with valgrind to check for memory leaks
118
+ valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=1 python memory_test.py
@@ -0,0 +1,142 @@
1
+ # Ignore environment/lock artifacts
2
+ pixi.lock
3
+ # .gitignore for torchfits
4
+
5
+ # General Python ignores
6
+ __pycache__/
7
+ *.pyc
8
+ *.pyo
9
+ *.pyd
10
+ *.egg-info/
11
+ *.egg
12
+ build/
13
+ dist/
14
+
15
+ # C++ build artifacts
16
+ *.o
17
+ *.os
18
+ *.obj
19
+ *.dll
20
+ *.lib
21
+ *.a
22
+ *.exe
23
+
24
+ # Compiled dynamic libraries
25
+ *.so
26
+ *.so.*
27
+ *.dylib
28
+ *.pyd
29
+
30
+ # Jupyter Notebooks
31
+ .ipynb_checkpoints/
32
+
33
+ # IDE and Editor files
34
+ .vscode/
35
+ *~
36
+ \#*\#
37
+ .\#*
38
+ .dir-locals.el
39
+ *.swp
40
+ *.swo
41
+ *.swn
42
+ *.swx
43
+ *.un~
44
+ [._]*.s[a-v][a-z]
45
+ [._]*.sw[a-z]
46
+ Session.vim
47
+ tags
48
+
49
+ # OS files
50
+ .DS_Store
51
+ Thumbs.db
52
+ Desktop.ini
53
+
54
+ # External dependencies (built locally)
55
+ fitsio/
56
+
57
+ # Distribution / packaging
58
+ .Python
59
+ develop-eggs/
60
+ downloads/
61
+ eggs/
62
+ lib/
63
+ lib64/
64
+ parts/
65
+ sdist/
66
+ var/
67
+ wheels/
68
+ .installed.cfg
69
+ MANIFEST
70
+
71
+ # Virtual environments
72
+ .env
73
+ .venv
74
+ env/
75
+ venv/
76
+ ENV/
77
+ env.bak/
78
+ venv.bak/
79
+
80
+ # Testing and coverage
81
+ .coverage
82
+ .pytest_cache/
83
+ htmlcov/
84
+ .tox/
85
+
86
+ # Test data and debugging files
87
+ test_data/
88
+ debug_*
89
+ check_*
90
+ test_*.py # Exclude ad-hoc test files (but not tests/ directory)
91
+ !/tests/test_*.py # But keep official test files
92
+
93
+
94
+ # pixi environments
95
+ .pixi/
96
+
97
+ # Temporary and cache files
98
+ .cache/
99
+ *.tmp
100
+ *.temp
101
+
102
+ # Build artifacts and compiled extensions
103
+ *.cpython-*.so
104
+ *.cpython-*.pyd
105
+
106
+ # Log files
107
+ *.log
108
+
109
+ # Backup files
110
+ *~
111
+ *.bak
112
+ *.orig
113
+
114
+ # CMake build files
115
+ CMakeCache.txt
116
+ CMakeFiles/
117
+ cmake_install.cmake
118
+ Makefile
119
+
120
+ # Additional Python artifacts
121
+ *.pyi
122
+ .mypy_cache/
123
+
124
+
125
+ # pixi environments
126
+ .pixi/*
127
+ !.pixi/config.toml
128
+
129
+ # Benchmark outputs
130
+ benchmark_results/
131
+ torchfits_exhaustive_*/
132
+ *.csv
133
+ *.png
134
+ *.pdf
135
+ *.json
136
+ *.fits
137
+
138
+ # Example-generated files
139
+ examples/data_*/
140
+ examples/mnist_data/
141
+ examples/sdss_data/
142
+ examples/test_examples.py
@@ -0,0 +1,3 @@
1
+ [submodule "extern/cfitsio"]
2
+ path = extern/cfitsio
3
+ url = https://github.com/HEASARC/cfitsio.git
@@ -0,0 +1,35 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.4.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-added-large-files
9
+ - id: check-merge-conflict
10
+
11
+ - repo: https://github.com/psf/black
12
+ rev: 23.9.1
13
+ hooks:
14
+ - id: black
15
+ language_version: python3
16
+ args: [--line-length=88]
17
+
18
+ - repo: https://github.com/pycqa/isort
19
+ rev: 5.12.0
20
+ hooks:
21
+ - id: isort
22
+ args: [--profile=black]
23
+
24
+ - repo: https://github.com/pycqa/flake8
25
+ rev: 6.0.0
26
+ hooks:
27
+ - id: flake8
28
+ args: [--max-line-length=88, --extend-ignore=E203,W503]
29
+
30
+ - repo: https://github.com/pre-commit/mirrors-mypy
31
+ rev: v1.5.1
32
+ hooks:
33
+ - id: mypy
34
+ additional_dependencies: [torch, numpy]
35
+ args: [--ignore-missing-imports]