Skip to content

Commit 9b7cccc

Browse files
authored
Merge pull request #10
Sam2 refactor. Fully refactored classes. New CLI and updated tests and runs thanks to NAIRR Startup allocation and the Jetstream 2 GPUs.
2 parents 88814e7 + 00f6a28 commit 9b7cccc

File tree

148 files changed

+20596
-16316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

148 files changed

+20596
-16316
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
*.ipynb -linguist-detectable
1+
*.ipynb -linguist-detectable

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- sam2_refactor
7+
- main
8+
pull_request:
9+
branches:
10+
- sam2_refactor
11+
- main
12+
13+
jobs:
14+
test:
15+
name: Test Python ${{ matrix.python-version }}
16+
runs-on: ubuntu-latest
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
python-version: ["3.10", "3.11", "3.12"]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v5
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
cache: 'pip'
31+
32+
- name: Install dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install pandas>=2.2.0 numpy>=1.26.0 --only-binary :all:
36+
pip install -e .[ci]
37+
38+
- name: Run unit tests
39+
run: |
40+
pytest tests/unit -v -m "not requires_casa"
41+
42+
- name: Run integration tests
43+
run: |
44+
pytest tests/integration -v -m "not requires_casa"
45+
46+
code-quality:
47+
name: Code Quality
48+
runs-on: ubuntu-latest
49+
50+
steps:
51+
- name: Checkout code
52+
uses: actions/checkout@v4
53+
54+
- name: Set up Python
55+
uses: actions/setup-python@v5
56+
with:
57+
python-version: "3.12"
58+
cache: 'pip'
59+
60+
- name: Install dependencies
61+
run: |
62+
python -m pip install --upgrade pip
63+
pip install black==24.1.1 ruff==0.1.15 isort==5.13.2
64+
65+
- name: Check formatting with Black
66+
run: |
67+
black --check --line-length=100 src/ tests/
68+
69+
# isort check disabled - pre-commit handles this locally
70+
# - name: Check import sorting with isort
71+
# run: |
72+
# isort --check-only --profile black --line-length=100 src/ tests/
73+
74+
- name: Auto-fix with Ruff
75+
run: |
76+
ruff check --fix src/ tests/
77+
78+
- name: Report remaining Ruff issues (warning only)
79+
continue-on-error: true
80+
run: |
81+
ruff check src/ tests/

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,24 @@ cython_debug/
160160
# and can be added to the global gitignore or merged into this file. For a more nuclear
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
#.idea/
163+
164+
# SAM-RFI specific ignores
165+
# Large downloaded/generated files
166+
models/ # Auto-downloaded SAM2 weights from HuggingFace
167+
datasets/ # Generated training/validation datasets
168+
tmp/ # Temporary files from training/testing
169+
validation_results/ # GPU validation outputs
170+
171+
# Model files
172+
*.pth # PyTorch model checkpoints
173+
*.safetensors # HuggingFace model weights
174+
*.pt # PyTorch weights
175+
176+
# Dataset files
177+
*.npz # Numpy dataset files (can be large)
178+
179+
# CASA logs
180+
casa-*.log
181+
182+
# Archive (keep structure but ignore if regenerated)
183+
archive/

.pre-commit-config.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Pre-commit hooks for SAM-RFI
2+
# Install: pip install pre-commit && pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
5+
repos:
6+
# Black - Python code formatter
7+
- repo: https://github.com/psf/black
8+
rev: 24.1.1
9+
hooks:
10+
- id: black
11+
language_version: python3.12
12+
args: [--line-length=100]
13+
14+
# isort - Import sorting
15+
- repo: https://github.com/pycqa/isort
16+
rev: 5.13.2
17+
hooks:
18+
- id: isort
19+
args: [--profile=black, --line-length=100]
20+
21+
# Ruff - Fast Python linter
22+
- repo: https://github.com/astral-sh/ruff-pre-commit
23+
rev: v0.1.15
24+
hooks:
25+
- id: ruff
26+
args: [--fix, --exit-non-zero-on-fix]
27+
28+
# Basic file checks
29+
- repo: https://github.com/pre-commit/pre-commit-hooks
30+
rev: v4.5.0
31+
hooks:
32+
- id: trailing-whitespace
33+
- id: end-of-file-fixer
34+
- id: check-yaml
35+
- id: check-added-large-files
36+
args: [--maxkb=5000]
37+
- id: check-json
38+
- id: check-toml
39+
- id: mixed-line-ending
40+
41+
# MyPy - Static type checking (optional, can be slow)
42+
# Uncomment if you want type checking on commit
43+
# - repo: https://github.com/pre-commit/mirrors-mypy
44+
# rev: v1.8.0
45+
# hooks:
46+
# - id: mypy
47+
# additional_dependencies: [types-pyyaml, types-tqdm]
48+
# args: [--ignore-missing-imports]

.readthedocs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ sphinx:
3232
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
3333
python:
3434
install:
35-
- requirements: docs/requirements.txt
35+
- requirements: docs/requirements.txt

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

0 commit comments

Comments
 (0)