hats-rs 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.
- hats_rs-0.1.0/.github/workflows/cargo.yml +46 -0
- hats_rs-0.1.0/.github/workflows/lint.yml +45 -0
- hats_rs-0.1.0/.github/workflows/release.yml +134 -0
- hats_rs-0.1.0/.github/workflows/test.yml +59 -0
- hats_rs-0.1.0/.gitignore +238 -0
- hats_rs-0.1.0/AGENTS.md +87 -0
- hats_rs-0.1.0/CHANGELOG.md +11 -0
- hats_rs-0.1.0/CLAUDE.md +3 -0
- hats_rs-0.1.0/CODEOWNERS +39 -0
- hats_rs-0.1.0/Cargo.lock +4284 -0
- hats_rs-0.1.0/Cargo.toml +44 -0
- hats_rs-0.1.0/LICENSE +28 -0
- hats_rs-0.1.0/PKG-INFO +71 -0
- hats_rs-0.1.0/README.md +44 -0
- hats_rs-0.1.0/noxfile.py +49 -0
- hats_rs-0.1.0/pyproject.toml +118 -0
- hats_rs-0.1.0/python/hats_rs/__init__.py +33 -0
- hats_rs-0.1.0/python/hats_rs/_hats_rs_lib/hats.pyi +221 -0
- hats_rs-0.1.0/python/hats_rs/_hats_rs_lib/healpix.pyi +31 -0
- hats_rs-0.1.0/python/hats_rs/cli.py +851 -0
- hats_rs-0.1.0/python/hats_rs/convert/__init__.py +15 -0
- hats_rs-0.1.0/python/hats_rs/convert/astropy.py +307 -0
- hats_rs-0.1.0/python/hats_rs/convert/callbacks.py +35 -0
- hats_rs-0.1.0/python/hats_rs/convert/convert.py +532 -0
- hats_rs-0.1.0/python/hats_rs/convert/csv.py +260 -0
- hats_rs-0.1.0/python/hats_rs/convert/fits.py +345 -0
- hats_rs-0.1.0/python/hats_rs/database/__init__.py +13 -0
- hats_rs-0.1.0/python/hats_rs/database/load.py +440 -0
- hats_rs-0.1.0/python/hats_rs/database/tools.py +1348 -0
- hats_rs-0.1.0/python/hats_rs/expressions.py +38 -0
- hats_rs-0.1.0/python/hats_rs/file_providers.py +114 -0
- hats_rs-0.1.0/python/hats_rs/hats/__init__.py +13 -0
- hats_rs-0.1.0/python/hats_rs/hats/hats.py +1050 -0
- hats_rs-0.1.0/python/hats_rs/hats/index.py +109 -0
- hats_rs-0.1.0/python/hats_rs/hats/margin.py +183 -0
- hats_rs-0.1.0/python/hats_rs/hats/metadata.py +280 -0
- hats_rs-0.1.0/python/hats_rs/hats/models.py +569 -0
- hats_rs-0.1.0/python/hats_rs/hats/object.py +1009 -0
- hats_rs-0.1.0/python/hats_rs/hats/tools.py +324 -0
- hats_rs-0.1.0/python/hats_rs/schema/__init__.py +12 -0
- hats_rs-0.1.0/python/hats_rs/schema/generate.py +568 -0
- hats_rs-0.1.0/python/hats_rs/schema/schema.py +652 -0
- hats_rs-0.1.0/python/hats_rs/tools.py +330 -0
- hats_rs-0.1.0/python/hats_rs/types.py +26 -0
- hats_rs-0.1.0/readthedocs.yml +18 -0
- hats_rs-0.1.0/src/hats/dataset.rs +592 -0
- hats_rs-0.1.0/src/hats/index.rs +321 -0
- hats_rs-0.1.0/src/hats/margin.rs +498 -0
- hats_rs-0.1.0/src/hats/mod.rs +15 -0
- hats_rs-0.1.0/src/hats/path_providers.rs +75 -0
- hats_rs-0.1.0/src/hats/rechunk.rs +118 -0
- hats_rs-0.1.0/src/hats/repartition.rs +430 -0
- hats_rs-0.1.0/src/hats/tools.rs +312 -0
- hats_rs-0.1.0/src/healpix.rs +52 -0
- hats_rs-0.1.0/src/lib.rs +13 -0
- hats_rs-0.1.0/src/polars_expressions.rs +36 -0
- hats_rs-0.1.0/src/python/hats.rs +198 -0
- hats_rs-0.1.0/src/python/healpix.rs +36 -0
- hats_rs-0.1.0/src/python/mod.rs +42 -0
- hats_rs-0.1.0/src/tools.rs +45 -0
- hats_rs-0.1.0/tests/__init__.py +0 -0
- hats_rs-0.1.0/tests/conftest.py +121 -0
- hats_rs-0.1.0/tests/test_database.py +326 -0
- hats_rs-0.1.0/tests/test_hats_rs.py +15 -0
- hats_rs-0.1.0/tests/test_hats_tools.py +188 -0
- hats_rs-0.1.0/tests/test_memory_python.py +215 -0
- hats_rs-0.1.0/uv.lock +2712 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: Cargo test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths-ignore:
|
|
6
|
+
- 'docs/**'
|
|
7
|
+
- 'CHANGELOG.md'
|
|
8
|
+
- 'README.md'
|
|
9
|
+
pull_request:
|
|
10
|
+
paths-ignore:
|
|
11
|
+
- 'docs/**'
|
|
12
|
+
- 'CHANGELOG.md'
|
|
13
|
+
- 'README.md'
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
cargo-test:
|
|
17
|
+
name: Cargo test
|
|
18
|
+
|
|
19
|
+
runs-on: ubuntu-24.04
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v6
|
|
26
|
+
with:
|
|
27
|
+
python-version: '3.14'
|
|
28
|
+
|
|
29
|
+
- name: Set up Rust
|
|
30
|
+
uses: dtolnay/rust-toolchain@stable
|
|
31
|
+
|
|
32
|
+
- name: Cache Cargo
|
|
33
|
+
uses: Swatinem/rust-cache@v2
|
|
34
|
+
|
|
35
|
+
# The crate is a PyO3 extension module, which does not link libpython. The test
|
|
36
|
+
# binary needs it, so link it explicitly.
|
|
37
|
+
- name: Configure libpython
|
|
38
|
+
run: |
|
|
39
|
+
LIBDIR=$(python -c "import sysconfig; print(sysconfig.get_config_var('LIBDIR'))")
|
|
40
|
+
VERSION=$(python -c "import sysconfig; print(sysconfig.get_python_version())")
|
|
41
|
+
echo "RUSTFLAGS=-L $LIBDIR -lpython$VERSION" >> "$GITHUB_ENV"
|
|
42
|
+
echo "LD_LIBRARY_PATH=$LIBDIR" >> "$GITHUB_ENV"
|
|
43
|
+
echo "PYO3_PYTHON=$(which python)" >> "$GITHUB_ENV"
|
|
44
|
+
|
|
45
|
+
- name: Run cargo test
|
|
46
|
+
run: cargo test --lib
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Lint
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths-ignore:
|
|
6
|
+
- 'docs/**'
|
|
7
|
+
- 'CHANGELOG.md'
|
|
8
|
+
- 'README.md'
|
|
9
|
+
pull_request:
|
|
10
|
+
paths-ignore:
|
|
11
|
+
- 'docs/**'
|
|
12
|
+
- 'CHANGELOG.md'
|
|
13
|
+
- 'README.md'
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
name: Lint
|
|
18
|
+
|
|
19
|
+
runs-on: ubuntu-24.04
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v6
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@v7
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@v6
|
|
31
|
+
with:
|
|
32
|
+
python-version: '3.14'
|
|
33
|
+
|
|
34
|
+
- name: Lint with ruff
|
|
35
|
+
run: |
|
|
36
|
+
uv tool install ruff
|
|
37
|
+
ruff check python/ tests/
|
|
38
|
+
ruff format --check python/ tests/
|
|
39
|
+
|
|
40
|
+
# The project is not installed (package = false) and the Rust extension has
|
|
41
|
+
# .pyi stubs, so ty only needs the Python dependencies, not a Rust build.
|
|
42
|
+
- name: Type check with ty
|
|
43
|
+
run: |
|
|
44
|
+
uv sync --locked --all-extras
|
|
45
|
+
uv run --no-sync ty check
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
on:
|
|
2
|
+
push:
|
|
3
|
+
tags:
|
|
4
|
+
- '*'
|
|
5
|
+
|
|
6
|
+
name: Create Release
|
|
7
|
+
|
|
8
|
+
env:
|
|
9
|
+
CARGO_TERM_COLOR: always
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
linux:
|
|
13
|
+
name: Wheels (linux ${{ matrix.target }})
|
|
14
|
+
|
|
15
|
+
runs-on: ${{ matrix.runner }}
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
fail-fast: false
|
|
19
|
+
matrix:
|
|
20
|
+
include:
|
|
21
|
+
- runner: ubuntu-24.04
|
|
22
|
+
target: x86_64
|
|
23
|
+
- runner: ubuntu-24.04-arm
|
|
24
|
+
target: aarch64
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v6
|
|
28
|
+
|
|
29
|
+
- name: Build wheels
|
|
30
|
+
uses: PyO3/maturin-action@v1
|
|
31
|
+
with:
|
|
32
|
+
target: ${{ matrix.target }}
|
|
33
|
+
manylinux: auto
|
|
34
|
+
args: --profile optimised --features performant --out dist -i python3.12 python3.13 python3.14 python3.15
|
|
35
|
+
sccache: true
|
|
36
|
+
|
|
37
|
+
- name: Upload wheels
|
|
38
|
+
uses: actions/upload-artifact@v6
|
|
39
|
+
with:
|
|
40
|
+
name: wheels-linux-${{ matrix.target }}
|
|
41
|
+
path: dist
|
|
42
|
+
if-no-files-found: error
|
|
43
|
+
|
|
44
|
+
macos:
|
|
45
|
+
name: Wheels (macos ${{ matrix.target }})
|
|
46
|
+
|
|
47
|
+
runs-on: ${{ matrix.runner }}
|
|
48
|
+
|
|
49
|
+
strategy:
|
|
50
|
+
fail-fast: false
|
|
51
|
+
matrix:
|
|
52
|
+
include:
|
|
53
|
+
- runner: macos-15-intel
|
|
54
|
+
target: x86_64
|
|
55
|
+
- runner: macos-15
|
|
56
|
+
target: aarch64
|
|
57
|
+
|
|
58
|
+
steps:
|
|
59
|
+
- uses: actions/checkout@v6
|
|
60
|
+
|
|
61
|
+
- name: Set up Python
|
|
62
|
+
uses: actions/setup-python@v6
|
|
63
|
+
with:
|
|
64
|
+
python-version: |
|
|
65
|
+
3.12
|
|
66
|
+
3.13
|
|
67
|
+
3.14
|
|
68
|
+
3.15
|
|
69
|
+
|
|
70
|
+
- name: Build wheels
|
|
71
|
+
uses: PyO3/maturin-action@v1
|
|
72
|
+
with:
|
|
73
|
+
target: ${{ matrix.target }}
|
|
74
|
+
args: --profile optimised --features performant --out dist -i python3.12 python3.13 python3.14 python3.15
|
|
75
|
+
sccache: true
|
|
76
|
+
|
|
77
|
+
- name: Upload wheels
|
|
78
|
+
uses: actions/upload-artifact@v6
|
|
79
|
+
with:
|
|
80
|
+
name: wheels-macos-${{ matrix.target }}
|
|
81
|
+
path: dist
|
|
82
|
+
if-no-files-found: error
|
|
83
|
+
|
|
84
|
+
sdist:
|
|
85
|
+
name: Source distribution
|
|
86
|
+
|
|
87
|
+
runs-on: ubuntu-24.04
|
|
88
|
+
|
|
89
|
+
steps:
|
|
90
|
+
- uses: actions/checkout@v6
|
|
91
|
+
|
|
92
|
+
- name: Build sdist
|
|
93
|
+
uses: PyO3/maturin-action@v1
|
|
94
|
+
with:
|
|
95
|
+
command: sdist
|
|
96
|
+
args: --out dist
|
|
97
|
+
|
|
98
|
+
- name: Upload sdist
|
|
99
|
+
uses: actions/upload-artifact@v6
|
|
100
|
+
with:
|
|
101
|
+
name: sdist
|
|
102
|
+
path: dist
|
|
103
|
+
if-no-files-found: error
|
|
104
|
+
|
|
105
|
+
release:
|
|
106
|
+
name: Release and publish
|
|
107
|
+
|
|
108
|
+
needs: [linux, macos, sdist]
|
|
109
|
+
|
|
110
|
+
runs-on: ubuntu-24.04
|
|
111
|
+
|
|
112
|
+
permissions:
|
|
113
|
+
contents: write
|
|
114
|
+
id-token: write
|
|
115
|
+
|
|
116
|
+
steps:
|
|
117
|
+
- name: Checkout code
|
|
118
|
+
uses: actions/checkout@v6
|
|
119
|
+
|
|
120
|
+
- name: Create release
|
|
121
|
+
uses: taiki-e/create-gh-release-action@v1
|
|
122
|
+
with:
|
|
123
|
+
title: hats-rs $version
|
|
124
|
+
changelog: CHANGELOG.md
|
|
125
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
|
126
|
+
|
|
127
|
+
- name: Download distributions
|
|
128
|
+
uses: actions/download-artifact@v6
|
|
129
|
+
with:
|
|
130
|
+
path: dist
|
|
131
|
+
merge-multiple: true
|
|
132
|
+
|
|
133
|
+
- name: Publish package distributions to PyPI
|
|
134
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: Test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
paths-ignore:
|
|
6
|
+
- 'docs/**'
|
|
7
|
+
- 'CHANGELOG.md'
|
|
8
|
+
- 'README.md'
|
|
9
|
+
pull_request:
|
|
10
|
+
paths-ignore:
|
|
11
|
+
- 'docs/**'
|
|
12
|
+
- 'CHANGELOG.md'
|
|
13
|
+
- 'README.md'
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
name: Test
|
|
18
|
+
|
|
19
|
+
runs-on: ubuntu-24.04
|
|
20
|
+
|
|
21
|
+
strategy:
|
|
22
|
+
fail-fast: false
|
|
23
|
+
matrix:
|
|
24
|
+
python-version: ['3.14']
|
|
25
|
+
|
|
26
|
+
steps:
|
|
27
|
+
- uses: actions/checkout@v6
|
|
28
|
+
|
|
29
|
+
- name: Set up Python
|
|
30
|
+
uses: actions/setup-python@v6
|
|
31
|
+
with:
|
|
32
|
+
python-version: ${{ matrix.python-version }}
|
|
33
|
+
|
|
34
|
+
- name: Install uv
|
|
35
|
+
uses: astral-sh/setup-uv@v8.1.0
|
|
36
|
+
with:
|
|
37
|
+
enable-cache: true
|
|
38
|
+
|
|
39
|
+
- name: Create virtual environment
|
|
40
|
+
run: |
|
|
41
|
+
uv venv --python ${{ matrix.python-version }}
|
|
42
|
+
source .venv/bin/activate
|
|
43
|
+
|
|
44
|
+
- name: Build with maturin
|
|
45
|
+
uses: PyO3/maturin-action@v1
|
|
46
|
+
with:
|
|
47
|
+
command: develop
|
|
48
|
+
args: --release --uv --group test --extras db
|
|
49
|
+
sccache: true
|
|
50
|
+
|
|
51
|
+
- name: Test with pytest
|
|
52
|
+
run: |
|
|
53
|
+
uv run --no-sync pytest
|
|
54
|
+
|
|
55
|
+
# - name: Upload coverage to Codecov
|
|
56
|
+
# uses: codecov/codecov-action@v5
|
|
57
|
+
# with:
|
|
58
|
+
# token: {{ secrets.CODECOV_TOKEN }}
|
|
59
|
+
# files: ./coverage.xml
|
hats_rs-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# File created using '.gitignore Generator' for Visual Studio Code: https://bit.ly/vscode-gig
|
|
2
|
+
# Created by https://www.toptal.com/developers/gitignore/api/macos,python,rust
|
|
3
|
+
# Edit at https://www.toptal.com/developers/gitignore?templates=macos,python,rust
|
|
4
|
+
|
|
5
|
+
### macOS ###
|
|
6
|
+
# General
|
|
7
|
+
.DS_Store
|
|
8
|
+
.AppleDouble
|
|
9
|
+
.LSOverride
|
|
10
|
+
|
|
11
|
+
# Icon must end with two \r
|
|
12
|
+
Icon
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Thumbnails
|
|
16
|
+
._*
|
|
17
|
+
|
|
18
|
+
# Files that might appear in the root of a volume
|
|
19
|
+
.DocumentRevisions-V100
|
|
20
|
+
.fseventsd
|
|
21
|
+
.Spotlight-V100
|
|
22
|
+
.TemporaryItems
|
|
23
|
+
.Trashes
|
|
24
|
+
.VolumeIcon.icns
|
|
25
|
+
.com.apple.timemachine.donotpresent
|
|
26
|
+
|
|
27
|
+
# Directories potentially created on remote AFP share
|
|
28
|
+
.AppleDB
|
|
29
|
+
.AppleDesktop
|
|
30
|
+
Network Trash Folder
|
|
31
|
+
Temporary Items
|
|
32
|
+
.apdisk
|
|
33
|
+
|
|
34
|
+
### macOS Patch ###
|
|
35
|
+
# iCloud generated files
|
|
36
|
+
*.icloud
|
|
37
|
+
|
|
38
|
+
### Python ###
|
|
39
|
+
# Byte-compiled / optimized / DLL files
|
|
40
|
+
__pycache__/
|
|
41
|
+
*.py[cod]
|
|
42
|
+
*$py.class
|
|
43
|
+
|
|
44
|
+
# C extensions
|
|
45
|
+
*.so
|
|
46
|
+
|
|
47
|
+
# Distribution / packaging
|
|
48
|
+
.Python
|
|
49
|
+
build/
|
|
50
|
+
develop-eggs/
|
|
51
|
+
dist/
|
|
52
|
+
downloads/
|
|
53
|
+
eggs/
|
|
54
|
+
.eggs/
|
|
55
|
+
lib/
|
|
56
|
+
lib64/
|
|
57
|
+
parts/
|
|
58
|
+
sdist/
|
|
59
|
+
var/
|
|
60
|
+
wheels/
|
|
61
|
+
share/python-wheels/
|
|
62
|
+
*.egg-info/
|
|
63
|
+
.installed.cfg
|
|
64
|
+
*.egg
|
|
65
|
+
MANIFEST
|
|
66
|
+
|
|
67
|
+
# PyInstaller
|
|
68
|
+
# Usually these files are written by a python script from a template
|
|
69
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
70
|
+
*.manifest
|
|
71
|
+
*.spec
|
|
72
|
+
|
|
73
|
+
# Installer logs
|
|
74
|
+
pip-log.txt
|
|
75
|
+
pip-delete-this-directory.txt
|
|
76
|
+
|
|
77
|
+
# Unit test / coverage reports
|
|
78
|
+
htmlcov/
|
|
79
|
+
.tox/
|
|
80
|
+
.nox/
|
|
81
|
+
.coverage
|
|
82
|
+
.coverage.*
|
|
83
|
+
.cache
|
|
84
|
+
nosetests.xml
|
|
85
|
+
coverage.xml
|
|
86
|
+
*.cover
|
|
87
|
+
*.py,cover
|
|
88
|
+
.hypothesis/
|
|
89
|
+
.pytest_cache/
|
|
90
|
+
cover/
|
|
91
|
+
|
|
92
|
+
# Translations
|
|
93
|
+
*.mo
|
|
94
|
+
*.pot
|
|
95
|
+
|
|
96
|
+
# Django stuff:
|
|
97
|
+
*.log
|
|
98
|
+
local_settings.py
|
|
99
|
+
db.sqlite3
|
|
100
|
+
db.sqlite3-journal
|
|
101
|
+
|
|
102
|
+
# Flask stuff:
|
|
103
|
+
instance/
|
|
104
|
+
.webassets-cache
|
|
105
|
+
|
|
106
|
+
# Scrapy stuff:
|
|
107
|
+
.scrapy
|
|
108
|
+
|
|
109
|
+
# Sphinx documentation
|
|
110
|
+
docs/_build/
|
|
111
|
+
|
|
112
|
+
# PyBuilder
|
|
113
|
+
.pybuilder/
|
|
114
|
+
target/
|
|
115
|
+
target-maturin/
|
|
116
|
+
|
|
117
|
+
# Jupyter Notebook
|
|
118
|
+
.ipynb_checkpoints
|
|
119
|
+
|
|
120
|
+
# IPython
|
|
121
|
+
profile_default/
|
|
122
|
+
ipython_config.py
|
|
123
|
+
|
|
124
|
+
# pyenv
|
|
125
|
+
# For a library or package, you might want to ignore these files since the code is
|
|
126
|
+
# intended to run in multiple environments; otherwise, check them in:
|
|
127
|
+
# .python-version
|
|
128
|
+
|
|
129
|
+
# pipenv
|
|
130
|
+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
|
|
131
|
+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
|
|
132
|
+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
|
|
133
|
+
# install all needed dependencies.
|
|
134
|
+
#Pipfile.lock
|
|
135
|
+
|
|
136
|
+
# poetry
|
|
137
|
+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
|
|
138
|
+
# This is especially recommended for binary packages to ensure reproducibility, and is more
|
|
139
|
+
# commonly ignored for libraries.
|
|
140
|
+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
|
|
141
|
+
#poetry.lock
|
|
142
|
+
|
|
143
|
+
# pdm
|
|
144
|
+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
|
|
145
|
+
#pdm.lock
|
|
146
|
+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
|
|
147
|
+
# in version control.
|
|
148
|
+
# https://pdm.fming.dev/#use-with-ide
|
|
149
|
+
.pdm.toml
|
|
150
|
+
|
|
151
|
+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
|
|
152
|
+
__pypackages__/
|
|
153
|
+
|
|
154
|
+
# Celery stuff
|
|
155
|
+
celerybeat-schedule
|
|
156
|
+
celerybeat.pid
|
|
157
|
+
|
|
158
|
+
# SageMath parsed files
|
|
159
|
+
*.sage.py
|
|
160
|
+
|
|
161
|
+
# Environments
|
|
162
|
+
.env
|
|
163
|
+
.venv
|
|
164
|
+
env/
|
|
165
|
+
venv/
|
|
166
|
+
ENV/
|
|
167
|
+
env.bak/
|
|
168
|
+
venv.bak/
|
|
169
|
+
|
|
170
|
+
# Spyder project settings
|
|
171
|
+
.spyderproject
|
|
172
|
+
.spyproject
|
|
173
|
+
|
|
174
|
+
# Rope project settings
|
|
175
|
+
.ropeproject
|
|
176
|
+
|
|
177
|
+
# mkdocs documentation
|
|
178
|
+
/site
|
|
179
|
+
|
|
180
|
+
# mypy
|
|
181
|
+
.mypy_cache/
|
|
182
|
+
.dmypy.json
|
|
183
|
+
dmypy.json
|
|
184
|
+
|
|
185
|
+
# Pyre type checker
|
|
186
|
+
.pyre/
|
|
187
|
+
|
|
188
|
+
# pytype static type analyzer
|
|
189
|
+
.pytype/
|
|
190
|
+
|
|
191
|
+
# Cython debug symbols
|
|
192
|
+
cython_debug/
|
|
193
|
+
|
|
194
|
+
# PyCharm
|
|
195
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
196
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
197
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
198
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
199
|
+
#.idea/
|
|
200
|
+
|
|
201
|
+
### Python Patch ###
|
|
202
|
+
# Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
|
|
203
|
+
poetry.toml
|
|
204
|
+
|
|
205
|
+
# ruff
|
|
206
|
+
.ruff_cache/
|
|
207
|
+
|
|
208
|
+
# LSP config files
|
|
209
|
+
pyrightconfig.json
|
|
210
|
+
|
|
211
|
+
### Rust ###
|
|
212
|
+
# Generated by Cargo
|
|
213
|
+
# will have compiled files and executables
|
|
214
|
+
debug/
|
|
215
|
+
|
|
216
|
+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
|
|
217
|
+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
|
|
218
|
+
# Cargo.lock
|
|
219
|
+
|
|
220
|
+
# These are backup files generated by rustfmt
|
|
221
|
+
**/*.rs.bk
|
|
222
|
+
|
|
223
|
+
# MSVC Windows builds of rustc generate these, which store debugging information
|
|
224
|
+
*.pdb
|
|
225
|
+
|
|
226
|
+
# Generated by cargo mutants
|
|
227
|
+
# Contains mutation testing data
|
|
228
|
+
**/mutants.out*/
|
|
229
|
+
|
|
230
|
+
# RustRover
|
|
231
|
+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
|
|
232
|
+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
|
|
233
|
+
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
|
234
|
+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
|
235
|
+
#.idea/
|
|
236
|
+
# End of https://www.toptal.com/developers/gitignore/api/macos,python,rust
|
|
237
|
+
|
|
238
|
+
# Custom rules (everything added below won't be overriden by 'Generate .gitignore File' if you use 'Update' option)
|
hats_rs-0.1.0/AGENTS.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# AGENTS.md
|
|
2
|
+
|
|
3
|
+
## Mission
|
|
4
|
+
|
|
5
|
+
This repository implements tools to convert astronomical catalogues from different types of files (Parquet, FITS, CSV) to the [HATS](https://www.ivoa.net/documents/Notes/HATS/20250822/NOTE-hats-ivoa-1.0-20250822.html) format and to handle HATS collections (indices, margin caches, catalogue schemas, loading them into PostgreSQL), with a high-performance Rust core and a Python interface. The cross-matching engine and the tools to load cross-match products into the database live in the separate, Rust-only `xmatch-rs` project.
|
|
6
|
+
|
|
7
|
+
Overall, user-facing functionality is provided through the Python interface and CLI, while performance-critical operations are handled by the Rust core.
|
|
8
|
+
|
|
9
|
+
Keep changes small, correct, and consistent with the existing architecture. Prefer the least invasive fix that preserves the public API and behaviour of the library.
|
|
10
|
+
|
|
11
|
+
## Project structure
|
|
12
|
+
|
|
13
|
+
- `src/` — Rust implementation of the HATS routines (repartitioning, rechunking, indices, margins) and HEALPix utilities.
|
|
14
|
+
- `python/hats_rs/` — Python package, CLI, conversion utilities, and schema helpers.
|
|
15
|
+
- `python/hats_rs/convert/` — Tools to convert from different file formats (Parquet, FITS, CSV) to Parquet.
|
|
16
|
+
- `python/hats_rs/hats/` — Tools and utilities related to the HATS format, including converting datasets to HATS collections.
|
|
17
|
+
- `python/hats_rs/schema/` — Catalogue schema models, validation, and generation.
|
|
18
|
+
- `python/hats_rs/database/` — Loading HATS collections into PostgreSQL, and downloading and copying tables.
|
|
19
|
+
- `python/hats_rs/cli.py` — Command-line interface for interacting with the package.
|
|
20
|
+
- `tests/` — regression tests for Python-facing functionality.
|
|
21
|
+
- `docs/sphinx/` — Sphinx documentation.
|
|
22
|
+
- `Cargo.toml` and `pyproject.toml` — Rust and Python configuration.
|
|
23
|
+
|
|
24
|
+
## Working rules
|
|
25
|
+
|
|
26
|
+
- Prefer Rust for performance-critical or computationally heavy logic.
|
|
27
|
+
- Prefer Python for CLI glue, user-facing configuration, schema validation, and convenience wrappers.
|
|
28
|
+
- Preserve backwards compatibility unless a task explicitly requires a breaking change.
|
|
29
|
+
- Keep public interfaces and CLI behaviour stable unless the issue requires otherwise.
|
|
30
|
+
- Avoid unrelated refactors or broad cleanup in the same patch.
|
|
31
|
+
- Add or update tests for any bug fix or feature change that affects runtime behaviour.
|
|
32
|
+
- Match the surrounding style and naming conventions of the file being edited.
|
|
33
|
+
|
|
34
|
+
### Maintaining the CHANGELOG.md file
|
|
35
|
+
|
|
36
|
+
- The CHANGELOG file is a Markdown file in which the second level header is the release version, in the format `## <tag-without-v> - <release-date>`. Possible subsections are:
|
|
37
|
+
- `### 🚀 New` for new features.
|
|
38
|
+
- `### ✨ Improved` for improvements on existing features.
|
|
39
|
+
- `### 🔧 Fixed` for bug fixes.
|
|
40
|
+
- `### 💥 Breaking changes` for breaking changes.
|
|
41
|
+
- `### ⚙️ Engineering` for behind-the-scenes changes that do not affect the user (packaging, linting, build system, etc.)
|
|
42
|
+
- Changes to the currently untagged version go under `## Next release`.
|
|
43
|
+
- When opening a PR for a change, the change must be preceded by a link to the PR in the format `- #<PR-number>: <text describing the change>`.
|
|
44
|
+
- Keep items with PR numbers on top and ordered by PR.
|
|
45
|
+
- Always keep the Markdown files properly formatted and linted.
|
|
46
|
+
|
|
47
|
+
### Tagging
|
|
48
|
+
|
|
49
|
+
- When asked to task, always confirm with the user if you do not receive a tag version or a semantic part to update (for example `Tag a new minor version`). The tag name should be NOT prefixed by a `v`. Update the `CHANGELOG.md` by converting the `Next release` section to the released format.
|
|
50
|
+
- After tagging and pushing, bump the version to the next alpha release (e.g., from `0.2.3` bump to `0.2.4-alpha.1`). Do not add the `Next release` header in the `CHANGELOG` until the first change.
|
|
51
|
+
|
|
52
|
+
## Dependencies and tooling
|
|
53
|
+
|
|
54
|
+
This project is configured for modern Python and Rust tooling:
|
|
55
|
+
|
|
56
|
+
- Python: >= 3.12
|
|
57
|
+
- Rust: standard project toolchain via Cargo
|
|
58
|
+
- Python package management: `uv` is the preferred workflow for dev/test commands
|
|
59
|
+
- Linting: `ruff`
|
|
60
|
+
- Type checking: `ty`
|
|
61
|
+
- Testing: `pytest`
|
|
62
|
+
- Build for Python bindings: `maturin`
|
|
63
|
+
|
|
64
|
+
## Validation commands
|
|
65
|
+
|
|
66
|
+
Run the smallest relevant validation for the scope of the change. Typical commands:
|
|
67
|
+
|
|
68
|
+
- `uv run pytest`
|
|
69
|
+
- `uv run ruff check .`
|
|
70
|
+
- `uv run ty check` (needs the optional extras installed, e.g. `uv sync --all-extras`, so that imports such as `psycopg` resolve)
|
|
71
|
+
- `cargo test`
|
|
72
|
+
- `uv run maturin develop` when the Rust/Python extension needs to be rebuilt locally
|
|
73
|
+
- `uv run sphinx-build -b html docs/sphinx docs/sphinx/_build/html` for documentation changes
|
|
74
|
+
|
|
75
|
+
## Before finishing
|
|
76
|
+
|
|
77
|
+
- Verify the relevant checks pass before claiming completion.
|
|
78
|
+
- Always run `uv run ty check` after changing Python code (including tests) and fix the reported problems. When a diagnostic cannot reasonably be fixed (e.g. a false positive or a deliberate duck-typed stand-in in a test), silence it on that line with `# ty: ignore[<rule>]` plus a short comment explaining why. Do not leave ty errors unaddressed.
|
|
79
|
+
- If the change touches both Rust and Python surfaces, run the appropriate Rust and Python validation.
|
|
80
|
+
- Summarise the verification commands and outcomes in the final response.
|
|
81
|
+
- Keep commit messages and PR summaries focused on the behaviour that changed.
|
|
82
|
+
|
|
83
|
+
## Communication expectations
|
|
84
|
+
|
|
85
|
+
- Be explicit about assumptions when something is ambiguous.
|
|
86
|
+
- Call out risk or edge cases when a fix changes observable behaviour.
|
|
87
|
+
- If a task is blocked by missing context, ask for the required information instead of guessing.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Change Log
|
|
2
|
+
|
|
3
|
+
This document records the main changes to the `hats-rs` code.
|
|
4
|
+
|
|
5
|
+
## 0.1.0 - 2026-12-05
|
|
6
|
+
|
|
7
|
+
### 🚀 New
|
|
8
|
+
|
|
9
|
+
* Initial release. The HATS conversion and handling tools (`convert`, `create-index`, `create-margin`, and the catalogue schema tools) were split from `xmatch-rs` 0.1.0. The Python package is now `hats_rs` and the command line interface is `hats-rs`, with the HATS commands at the top level (e.g., `hats-rs convert` instead of `xmatch-rs hats convert`).
|
|
10
|
+
* Loading a HATS collection into the database moved here from `xmatch-rs database load-hats`: use `hats-rs load-hats` or `HATS.write_to_database()`, with the new `db` extra (`pip install hats-rs[db]`). The table is created from the columns of the Parquet files in the collection, renamed to the `database_name` of the schema columns, so that it includes the `healpix_29` and `hats_*` columns (use `--no-hats-columns` to skip them).
|
|
11
|
+
* Added the `hats-rs download-table` and `hats-rs copy-table` commands (and `hats_rs.database.tools`), restored from the Python database tools of `xmatch-rs` 0.1.0. They also require the `db` extra. With `--use-copy`, the COPY output is now split into chunks in Python, keeping quoted fields with line breaks in a single chunk, so the GNU `split` (`gsplit`) command is no longer needed.
|
hats_rs-0.1.0/CLAUDE.md
ADDED
hats_rs-0.1.0/CODEOWNERS
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# This is a comment.
|
|
2
|
+
# Each line is a file pattern followed by one or more owners.
|
|
3
|
+
|
|
4
|
+
# These owners will be the default owners for everything in
|
|
5
|
+
# the repo. Unless a later match takes precedence,
|
|
6
|
+
# @global-owner1 and @global-owner2 will be requested for
|
|
7
|
+
# review when someone opens a pull request.
|
|
8
|
+
* @albireox
|
|
9
|
+
* @sdss
|
|
10
|
+
* gallegoj@uw.edu
|
|
11
|
+
|
|
12
|
+
# Order is important; the last matching pattern takes the most
|
|
13
|
+
# precedence. When someone opens a pull request that only
|
|
14
|
+
# modifies JS files, only @js-owner and not the global
|
|
15
|
+
# owner(s) will be requested for a review.
|
|
16
|
+
*.js @js-owner
|
|
17
|
+
|
|
18
|
+
# You can also use email addresses if you prefer. They'll be
|
|
19
|
+
# used to look up users just like we do for commit author
|
|
20
|
+
# emails.
|
|
21
|
+
*.go docs@example.com
|
|
22
|
+
|
|
23
|
+
# In this example, @doctocat owns any files in the build/logs
|
|
24
|
+
# directory at the root of the repository and any of its
|
|
25
|
+
# subdirectories.
|
|
26
|
+
/build/logs/ @doctocat
|
|
27
|
+
|
|
28
|
+
# The `docs/*` pattern will match files like
|
|
29
|
+
# `docs/getting-started.md` but not further nested files like
|
|
30
|
+
# `docs/build-app/troubleshooting.md`.
|
|
31
|
+
docs/* docs@example.com
|
|
32
|
+
|
|
33
|
+
# In this example, @octocat owns any file in an apps directory
|
|
34
|
+
# anywhere in your repository.
|
|
35
|
+
apps/ @octocat
|
|
36
|
+
|
|
37
|
+
# In this example, @doctocat owns any file in the `/docs`
|
|
38
|
+
# directory in the root of your repository.
|
|
39
|
+
/docs/ @doctocat
|