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.
- torchfits-0.1.1/.gitattributes +2 -0
- torchfits-0.1.1/.github/workflows/README.md +48 -0
- torchfits-0.1.1/.github/workflows/ci.yml +203 -0
- torchfits-0.1.1/.github/workflows/memory_tests.yml.backup +118 -0
- torchfits-0.1.1/.gitignore +142 -0
- torchfits-0.1.1/.gitmodules +3 -0
- torchfits-0.1.1/.pre-commit-config.yaml +35 -0
- torchfits-0.1.1/API.md +915 -0
- torchfits-0.1.1/CHANGELOG.md +114 -0
- torchfits-0.1.1/CMakeLists.txt +5 -0
- torchfits-0.1.1/LICENSE +339 -0
- torchfits-0.1.1/MANIFEST.in +33 -0
- torchfits-0.1.1/PKG-INFO +264 -0
- torchfits-0.1.1/README.md +216 -0
- torchfits-0.1.1/RELEASE_NOTES_v0.1.1.md +164 -0
- torchfits-0.1.1/benchmarks/benchmark_all.py +1465 -0
- torchfits-0.1.1/benchmarks/benchmark_buffer.py +320 -0
- torchfits-0.1.1/benchmarks/benchmark_cache.py +321 -0
- torchfits-0.1.1/benchmarks/benchmark_cpp_backend.py +365 -0
- torchfits-0.1.1/benchmarks/benchmark_float64.py +51 -0
- torchfits-0.1.1/benchmarks/benchmark_gpu_memory.py +352 -0
- torchfits-0.1.1/benchmarks/benchmark_mmap.py +71 -0
- torchfits-0.1.1/benchmarks/benchmark_mps.py +142 -0
- torchfits-0.1.1/benchmarks/benchmark_parallel.py +77 -0
- torchfits-0.1.1/benchmarks/benchmark_scaled.py +62 -0
- torchfits-0.1.1/benchmarks/benchmark_table.py +330 -0
- torchfits-0.1.1/benchmarks/benchmark_table_comprehensive.py +518 -0
- torchfits-0.1.1/benchmarks/benchmark_transforms.py +190 -0
- torchfits-0.1.1/benchmarks/benchmark_vertical_slice.py +93 -0
- torchfits-0.1.1/examples/README.md +124 -0
- torchfits-0.1.1/examples/example_basic_reading.py +73 -0
- torchfits-0.1.1/examples/example_comprehensive_ml_pipeline.py +461 -0
- torchfits-0.1.1/examples/example_cutouts.py +89 -0
- torchfits-0.1.1/examples/example_datacube.py +95 -0
- torchfits-0.1.1/examples/example_dataset.py +130 -0
- torchfits-0.1.1/examples/example_frame.py +204 -0
- torchfits-0.1.1/examples/example_mef.py +91 -0
- torchfits-0.1.1/examples/example_ml_pipeline.py +362 -0
- torchfits-0.1.1/examples/example_mnist.py +279 -0
- torchfits-0.1.1/examples/example_phase2_features.py +362 -0
- torchfits-0.1.1/examples/example_sdss_classification.py +401 -0
- torchfits-0.1.1/examples/example_tables.py +114 -0
- torchfits-0.1.1/examples/example_wcs.py +124 -0
- torchfits-0.1.1/extern/cfitsio/.gitattributes +0 -0
- torchfits-0.1.1/extern/cfitsio/.github/workflows/ci.yml +76 -0
- torchfits-0.1.1/extern/cfitsio/.github/workflows/codeql.yml +72 -0
- torchfits-0.1.1/extern/cfitsio/.gitignore +93 -0
- torchfits-0.1.1/extern/cfitsio/CMakeLists.txt +426 -0
- torchfits-0.1.1/extern/cfitsio/ChangeLog +4892 -0
- torchfits-0.1.1/extern/cfitsio/INSTALL +368 -0
- torchfits-0.1.1/extern/cfitsio/Makefile.am +214 -0
- torchfits-0.1.1/extern/cfitsio/Makefile.in +2228 -0
- torchfits-0.1.1/extern/cfitsio/README.MacOS +69 -0
- torchfits-0.1.1/extern/cfitsio/README.md +102 -0
- torchfits-0.1.1/extern/cfitsio/README.win +211 -0
- torchfits-0.1.1/extern/cfitsio/README_OLD.win +83 -0
- torchfits-0.1.1/extern/cfitsio/aclocal.m4 +1348 -0
- torchfits-0.1.1/extern/cfitsio/buffers.c +1377 -0
- torchfits-0.1.1/extern/cfitsio/cfileio.c +8086 -0
- torchfits-0.1.1/extern/cfitsio/cfitsio.pc.cmake +12 -0
- torchfits-0.1.1/extern/cfitsio/cfitsio.pc.in +12 -0
- torchfits-0.1.1/extern/cfitsio/cfitsio.spec +152 -0
- torchfits-0.1.1/extern/cfitsio/cfitsio.xcodeproj/project.pbxproj +120 -0
- torchfits-0.1.1/extern/cfitsio/cfortran.h +2599 -0
- torchfits-0.1.1/extern/cfitsio/checksum.c +508 -0
- torchfits-0.1.1/extern/cfitsio/cmake/cfitsioConfig.cmake +1 -0
- torchfits-0.1.1/extern/cfitsio/cmake/portfile.cmake +68 -0
- torchfits-0.1.1/extern/cfitsio/config/compile +351 -0
- torchfits-0.1.1/extern/cfitsio/config/config.guess +1812 -0
- torchfits-0.1.1/extern/cfitsio/config/config.sub +1971 -0
- torchfits-0.1.1/extern/cfitsio/config/depcomp +792 -0
- torchfits-0.1.1/extern/cfitsio/config/install-sh +541 -0
- torchfits-0.1.1/extern/cfitsio/config/ltmain.sh +11524 -0
- torchfits-0.1.1/extern/cfitsio/config/missing +236 -0
- torchfits-0.1.1/extern/cfitsio/configure +25213 -0
- torchfits-0.1.1/extern/cfitsio/configure.ac +639 -0
- torchfits-0.1.1/extern/cfitsio/docs/cfitsio.ps +18813 -0
- torchfits-0.1.1/extern/cfitsio/docs/cfitsio.tex +11414 -0
- torchfits-0.1.1/extern/cfitsio/docs/cfitsio.toc +127 -0
- torchfits-0.1.1/extern/cfitsio/docs/cfortran.doc +2088 -0
- torchfits-0.1.1/extern/cfitsio/docs/fitsio.ps +14045 -0
- torchfits-0.1.1/extern/cfitsio/docs/fitsio.tex +7935 -0
- torchfits-0.1.1/extern/cfitsio/docs/fitsio.toc +95 -0
- torchfits-0.1.1/extern/cfitsio/docs/fpackguide.odt +0 -0
- torchfits-0.1.1/extern/cfitsio/docs/quick.ps +5291 -0
- torchfits-0.1.1/extern/cfitsio/docs/quick.tex +2157 -0
- torchfits-0.1.1/extern/cfitsio/docs/quick.toc +25 -0
- torchfits-0.1.1/extern/cfitsio/drvrfile.c +1140 -0
- torchfits-0.1.1/extern/cfitsio/drvrgsiftp.c +538 -0
- torchfits-0.1.1/extern/cfitsio/drvrgsiftp.h +21 -0
- torchfits-0.1.1/extern/cfitsio/drvrmem.c +1343 -0
- torchfits-0.1.1/extern/cfitsio/drvrnet.c +4511 -0
- torchfits-0.1.1/extern/cfitsio/drvrsmem.c +974 -0
- torchfits-0.1.1/extern/cfitsio/drvrsmem.h +179 -0
- torchfits-0.1.1/extern/cfitsio/editcol.c +3226 -0
- torchfits-0.1.1/extern/cfitsio/edithdu.c +924 -0
- torchfits-0.1.1/extern/cfitsio/eval.l +559 -0
- torchfits-0.1.1/extern/cfitsio/eval.y +6401 -0
- torchfits-0.1.1/extern/cfitsio/eval_defs.h +208 -0
- torchfits-0.1.1/extern/cfitsio/eval_f.c +2955 -0
- torchfits-0.1.1/extern/cfitsio/eval_l.c +2962 -0
- torchfits-0.1.1/extern/cfitsio/eval_tab.h +130 -0
- torchfits-0.1.1/extern/cfitsio/eval_y.c +8639 -0
- torchfits-0.1.1/extern/cfitsio/f77.inc +31 -0
- torchfits-0.1.1/extern/cfitsio/f77_wrap.h +289 -0
- torchfits-0.1.1/extern/cfitsio/f77_wrap1.c +362 -0
- torchfits-0.1.1/extern/cfitsio/f77_wrap2.c +734 -0
- torchfits-0.1.1/extern/cfitsio/f77_wrap3.c +860 -0
- torchfits-0.1.1/extern/cfitsio/f77_wrap4.c +572 -0
- torchfits-0.1.1/extern/cfitsio/fits_hcompress.c +1872 -0
- torchfits-0.1.1/extern/cfitsio/fits_hdecompress.c +2616 -0
- torchfits-0.1.1/extern/cfitsio/fitscore.c +9931 -0
- torchfits-0.1.1/extern/cfitsio/fitsio.h +2086 -0
- torchfits-0.1.1/extern/cfitsio/fitsio2.h +1349 -0
- torchfits-0.1.1/extern/cfitsio/getcol.c +1221 -0
- torchfits-0.1.1/extern/cfitsio/getcolb.c +2046 -0
- torchfits-0.1.1/extern/cfitsio/getcold.c +1721 -0
- torchfits-0.1.1/extern/cfitsio/getcole.c +1789 -0
- torchfits-0.1.1/extern/cfitsio/getcoli.c +1962 -0
- torchfits-0.1.1/extern/cfitsio/getcolj.c +3855 -0
- torchfits-0.1.1/extern/cfitsio/getcolk.c +1955 -0
- torchfits-0.1.1/extern/cfitsio/getcoll.c +621 -0
- torchfits-0.1.1/extern/cfitsio/getcols.c +992 -0
- torchfits-0.1.1/extern/cfitsio/getcolsb.c +2045 -0
- torchfits-0.1.1/extern/cfitsio/getcolui.c +1967 -0
- torchfits-0.1.1/extern/cfitsio/getcoluj.c +3882 -0
- torchfits-0.1.1/extern/cfitsio/getcoluk.c +1975 -0
- torchfits-0.1.1/extern/cfitsio/getkey.c +3745 -0
- torchfits-0.1.1/extern/cfitsio/group.c +6749 -0
- torchfits-0.1.1/extern/cfitsio/group.h +68 -0
- torchfits-0.1.1/extern/cfitsio/grparser.c +1357 -0
- torchfits-0.1.1/extern/cfitsio/grparser.h +183 -0
- torchfits-0.1.1/extern/cfitsio/histo.c +3252 -0
- torchfits-0.1.1/extern/cfitsio/imcompress.c +9928 -0
- torchfits-0.1.1/extern/cfitsio/iraffits.c +2098 -0
- torchfits-0.1.1/extern/cfitsio/iter_a.c +147 -0
- torchfits-0.1.1/extern/cfitsio/iter_a.f +224 -0
- torchfits-0.1.1/extern/cfitsio/iter_a.fit +1111 -0
- torchfits-0.1.1/extern/cfitsio/iter_b.c +114 -0
- torchfits-0.1.1/extern/cfitsio/iter_b.f +193 -0
- torchfits-0.1.1/extern/cfitsio/iter_b.fit +0 -0
- torchfits-0.1.1/extern/cfitsio/iter_c.c +171 -0
- torchfits-0.1.1/extern/cfitsio/iter_c.f +347 -0
- torchfits-0.1.1/extern/cfitsio/iter_c.fit +708 -6
- torchfits-0.1.1/extern/cfitsio/iter_image.fit +1 -0
- torchfits-0.1.1/extern/cfitsio/licenses/License.txt +25 -0
- torchfits-0.1.1/extern/cfitsio/longnam.h +631 -0
- torchfits-0.1.1/extern/cfitsio/m4/ax_cfitsio.m4 +156 -0
- torchfits-0.1.1/extern/cfitsio/m4/libtool.m4 +8488 -0
- torchfits-0.1.1/extern/cfitsio/m4/ltoptions.m4 +467 -0
- torchfits-0.1.1/extern/cfitsio/m4/ltsugar.m4 +124 -0
- torchfits-0.1.1/extern/cfitsio/m4/ltversion.m4 +24 -0
- torchfits-0.1.1/extern/cfitsio/m4/lt~obsolete.m4 +99 -0
- torchfits-0.1.1/extern/cfitsio/modkey.c +1828 -0
- torchfits-0.1.1/extern/cfitsio/pliocomp.c +331 -0
- torchfits-0.1.1/extern/cfitsio/putcol.c +2187 -0
- torchfits-0.1.1/extern/cfitsio/putcolb.c +1045 -0
- torchfits-0.1.1/extern/cfitsio/putcold.c +1089 -0
- torchfits-0.1.1/extern/cfitsio/putcole.c +1102 -0
- torchfits-0.1.1/extern/cfitsio/putcoli.c +1007 -0
- torchfits-0.1.1/extern/cfitsio/putcolj.c +2038 -0
- torchfits-0.1.1/extern/cfitsio/putcolk.c +1038 -0
- torchfits-0.1.1/extern/cfitsio/putcoll.c +372 -0
- torchfits-0.1.1/extern/cfitsio/putcols.c +304 -0
- torchfits-0.1.1/extern/cfitsio/putcolsb.c +994 -0
- torchfits-0.1.1/extern/cfitsio/putcolu.c +629 -0
- torchfits-0.1.1/extern/cfitsio/putcolui.c +987 -0
- torchfits-0.1.1/extern/cfitsio/putcoluj.c +1974 -0
- torchfits-0.1.1/extern/cfitsio/putcoluk.c +1012 -0
- torchfits-0.1.1/extern/cfitsio/putkey.c +3482 -0
- torchfits-0.1.1/extern/cfitsio/quantize.c +3945 -0
- torchfits-0.1.1/extern/cfitsio/region.c +1809 -0
- torchfits-0.1.1/extern/cfitsio/region.h +82 -0
- torchfits-0.1.1/extern/cfitsio/ricecomp.c +1366 -0
- torchfits-0.1.1/extern/cfitsio/sample.tpl +121 -0
- torchfits-0.1.1/extern/cfitsio/scalnull.c +229 -0
- torchfits-0.1.1/extern/cfitsio/simplerng.c +461 -0
- torchfits-0.1.1/extern/cfitsio/simplerng.h +27 -0
- torchfits-0.1.1/extern/cfitsio/swapproc.c +247 -0
- torchfits-0.1.1/extern/cfitsio/testf77.std +0 -0
- torchfits-0.1.1/extern/cfitsio/testprog.std +48 -0
- torchfits-0.1.1/extern/cfitsio/testprog.tpt +12 -0
- torchfits-0.1.1/extern/cfitsio/utilities/cookbook.c +573 -0
- torchfits-0.1.1/extern/cfitsio/utilities/cookbook.f +772 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fitscopy.c +60 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fitsverify.c +267 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fpack.c +453 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fpack.h +189 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fpackutil.c +2431 -0
- torchfits-0.1.1/extern/cfitsio/utilities/ftverify.c +466 -0
- torchfits-0.1.1/extern/cfitsio/utilities/funpack.c +174 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fverify.h +214 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fvrf_data.c +890 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fvrf_file.c +289 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fvrf_head.c +3347 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fvrf_key.c +730 -0
- torchfits-0.1.1/extern/cfitsio/utilities/fvrf_misc.c +337 -0
- torchfits-0.1.1/extern/cfitsio/utilities/imcopy.c +233 -0
- torchfits-0.1.1/extern/cfitsio/utilities/iter_image.c +85 -0
- torchfits-0.1.1/extern/cfitsio/utilities/iter_var.c +93 -0
- torchfits-0.1.1/extern/cfitsio/utilities/smem.c +77 -0
- torchfits-0.1.1/extern/cfitsio/utilities/speed.c +590 -0
- torchfits-0.1.1/extern/cfitsio/utilities/testf77.f +2488 -0
- torchfits-0.1.1/extern/cfitsio/utilities/testprog.c +2589 -0
- torchfits-0.1.1/extern/cfitsio/vmsieee.c +130 -0
- torchfits-0.1.1/extern/cfitsio/wcssub.c +1043 -0
- torchfits-0.1.1/extern/cfitsio/wcsutil.c +502 -0
- torchfits-0.1.1/extern/cfitsio/winDumpExts.mak +191 -0
- torchfits-0.1.1/extern/cfitsio/windumpexts.c +504 -0
- torchfits-0.1.1/extern/cfitsio/zcompress.c +549 -0
- torchfits-0.1.1/extern/cfitsio/zuncompress.c +603 -0
- torchfits-0.1.1/pixi.toml +128 -0
- torchfits-0.1.1/pyproject.toml +89 -0
- torchfits-0.1.1/src/torchfits/__init__.py +641 -0
- torchfits-0.1.1/src/torchfits/buffer.py +362 -0
- torchfits-0.1.1/src/torchfits/cache.py +239 -0
- torchfits-0.1.1/src/torchfits/core.py +231 -0
- torchfits-0.1.1/src/torchfits/cpp_src/CMakeLists.txt +186 -0
- torchfits-0.1.1/src/torchfits/cpp_src/bindings.cpp +313 -0
- torchfits-0.1.1/src/torchfits/cpp_src/cache.cpp +107 -0
- torchfits-0.1.1/src/torchfits/cpp_src/cache.h +31 -0
- torchfits-0.1.1/src/torchfits/cpp_src/fast_io.cpp +228 -0
- torchfits-0.1.1/src/torchfits/cpp_src/fits.cpp +737 -0
- torchfits-0.1.1/src/torchfits/cpp_src/hardware.cpp +161 -0
- torchfits-0.1.1/src/torchfits/cpp_src/hardware.h +85 -0
- torchfits-0.1.1/src/torchfits/cpp_src/table.cpp +1189 -0
- torchfits-0.1.1/src/torchfits/cpp_src/table.h +43 -0
- torchfits-0.1.1/src/torchfits/cpp_src/torch_compat.h +52 -0
- torchfits-0.1.1/src/torchfits/cpp_src/types.h +14 -0
- torchfits-0.1.1/src/torchfits/cpp_src/wcs.cpp +466 -0
- torchfits-0.1.1/src/torchfits/cpp_src/wcs.h +89 -0
- torchfits-0.1.1/src/torchfits/dataloader.py +338 -0
- torchfits-0.1.1/src/torchfits/datasets.py +178 -0
- torchfits-0.1.1/src/torchfits/frame.py +163 -0
- torchfits-0.1.1/src/torchfits/hdu.py +594 -0
- torchfits-0.1.1/src/torchfits/header_parser.py +341 -0
- torchfits-0.1.1/src/torchfits/interop.py +87 -0
- torchfits-0.1.1/src/torchfits/logging.py +95 -0
- torchfits-0.1.1/src/torchfits/spectral.py +425 -0
- torchfits-0.1.1/src/torchfits/transforms.py +621 -0
- torchfits-0.1.1/src/torchfits/wcs.py +321 -0
- torchfits-0.1.1/tests/test_api.py +207 -0
- torchfits-0.1.1/tests/test_ascii_table.py +80 -0
- torchfits-0.1.1/tests/test_astro_transforms.py +65 -0
- torchfits-0.1.1/tests/test_buffer.py +493 -0
- torchfits-0.1.1/tests/test_cache.py +106 -0
- torchfits-0.1.1/tests/test_complex_header.py +70 -0
- torchfits-0.1.1/tests/test_compression.py +203 -0
- torchfits-0.1.1/tests/test_core.py +55 -0
- torchfits-0.1.1/tests/test_dataloader.py +329 -0
- torchfits-0.1.1/tests/test_dlpack_roundtrip.py +11 -0
- torchfits-0.1.1/tests/test_frame.py +52 -0
- torchfits-0.1.1/tests/test_get_header.py +36 -0
- torchfits-0.1.1/tests/test_hdu.py +52 -0
- torchfits-0.1.1/tests/test_integration.py +337 -0
- torchfits-0.1.1/tests/test_performance.py +273 -0
- torchfits-0.1.1/tests/test_spectral.py +318 -0
- torchfits-0.1.1/tests/test_table.py +220 -0
- torchfits-0.1.1/tests/test_transforms.py +290 -0
- torchfits-0.1.1/tests/test_validation.py +25 -0
- torchfits-0.1.1/tests/test_wcs.py +64 -0
- torchfits-0.1.1/tests/test_wcs_projections.py +89 -0
- torchfits-0.1.1/tests/test_wcs_spectral.py +72 -0
- torchfits-0.1.1/tests/test_writing.py +53 -0
|
@@ -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,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]
|