Skip to content

Commit 82aadac

Browse files
committed
Initial commit
0 parents  commit 82aadac

482 files changed

Lines changed: 1390025 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/docs.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Deploy Docs
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
deploy:
12+
runs-on: ubuntu-latest
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.11"
20+
21+
- name: Install PyTorch (CPU)
22+
run: pip install torch==2.2.0 torchvision==0.17.0 --index-url https://download.pytorch.org/whl/cpu
23+
24+
- name: Install package and docs dependencies
25+
run: pip install -e ".[all,docs]"
26+
27+
- name: Deploy to GitHub Pages
28+
run: mkdocs gh-deploy --force

.github/workflows/tests.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Tests
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.10", "3.11", "3.12"]
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
28+
pip install -e ".[all]"
29+
30+
- name: Run tests with coverage
31+
run: pytest tests/ -v --cov=shortcut_detect --cov-report=xml -m "not e2e"
32+
33+
- name: Upload coverage
34+
uses: codecov/codecov-action@v4
35+
continue-on-error: true
36+
with:
37+
file: ./coverage.xml

.gitignore

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
*.egg
7+
*.egg-info/
8+
dist/
9+
build/
10+
.eggs/
11+
12+
# Virtual Environment
13+
.venv/
14+
.venv-docs/
15+
venv/
16+
ENV/
17+
env/
18+
19+
# Jupyter
20+
.ipynb_checkpoints/
21+
*.ipynb_checkpoints
22+
.jupyter/
23+
.local/
24+
25+
# IDE
26+
.vscode/
27+
.idea/
28+
*.swp
29+
*.swo
30+
*~
31+
32+
# Testing
33+
.pytest_cache/
34+
.coverage
35+
htmlcov/
36+
.tox/
37+
38+
# OS
39+
.DS_Store
40+
Thumbs.db
41+
42+
# Output files (keep structure, ignore generated reports)
43+
output/*/
44+
!output/.gitkeep
45+
!output/paper_tables/
46+
!output/paper_benchmark/
47+
48+
# Data files — large embeddings/images hosted on HuggingFace, not in git
49+
# Keep only small config/manifest files; ignore .npy, .pkl, images
50+
data/*.npy
51+
data/*.pkl
52+
data/celeba/
53+
data/celeba_real/
54+
data/chexpert_multibackbone/
55+
data/mimic_cxr/*.npy
56+
data/mimic_cxr/*_metadata.csv
57+
data/mimic_cxr/*_metadata_orig.csv
58+
data/mimic_cxr/*_metadata_dx.csv
59+
data/mimic_cxr/mimic-cxr-*.csv
60+
data/train.csv
61+
data/valid.csv
62+
data/*.xlsx
63+
64+
# Keep manifests (small, needed for reproducibility)
65+
!data/chexpert_manifest.csv
66+
!data/mimic_cxr/mimic_cxr_manifest.csv
67+
68+
# Paper drafts and roadmap (kept locally, not in repo)
69+
docs-temp/
70+
71+
# MkDocs build output
72+
site/
73+
74+
# Temporary files
75+
*.log
76+
*.tmp
77+
temp/
78+
tmp/

.pre-commit-config.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
repos:
2+
- repo: https://github.com/psf/black
3+
rev: 24.4.2
4+
hooks:
5+
- id: black
6+
7+
- repo: https://github.com/astral-sh/ruff-pre-commit
8+
rev: v0.4.4
9+
hooks:
10+
- id: ruff
11+
args: [--fix]
12+
13+
# Note: Full test suite runs in GitHub Actions CI
14+
# To run tests locally: pytest tests/ -v

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Reproducible environment for ShortKIT-ML paper benchmarks
2+
# Build: docker build -t shortcut-detect .
3+
# Run: docker run --rm -v $(pwd)/output:/app/output shortcut-detect smoke
4+
FROM python:3.10-slim
5+
6+
LABEL maintainer="ShortKIT-ML Team"
7+
LABEL description="Reproducible environment for ShortKIT-ML paper benchmarks"
8+
9+
# System dependencies required by weasyprint / PDF export and general build tools
10+
RUN apt-get update && apt-get install -y --no-install-recommends \
11+
build-essential \
12+
libpango1.0-dev \
13+
libgdk-pixbuf2.0-dev \
14+
libffi-dev \
15+
git \
16+
&& rm -rf /var/lib/apt/lists/*
17+
18+
WORKDIR /app
19+
20+
# Copy dependency manifest first for layer caching
21+
COPY pyproject.toml ./
22+
23+
# Install the package in editable mode (with all extras for reproducibility)
24+
COPY . .
25+
RUN pip install --no-cache-dir -e ".[dev]"
26+
27+
# Make the reproduce script executable
28+
RUN chmod +x scripts/reproduce_paper.sh
29+
30+
# Default entrypoint runs the reproducibility script.
31+
# Pass a profile as the CMD argument: smoke | default | full
32+
ENTRYPOINT ["scripts/reproduce_paper.sh"]
33+
CMD ["default"]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2024 ShortKIT-ML Team
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)