Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
cb65c6a
chore: update .gitignore, markdownlint configuration, and README badges
LouisTier Feb 19, 2026
8f446cd
refactor: reorganize Makefile and introduce modular makefiles for imp…
LouisTier Feb 19, 2026
0bd1bcd
chore: update pre-commit configuration, pyproject.toml, and GitHub wo…
LouisTier Feb 19, 2026
ae3c392
feat: add periodic boundary conditions and search backend options to SOM
LouisTier Feb 19, 2026
5b2c2c7
test: add unit tests for periodic boundary conditions and BMU search …
LouisTier Feb 19, 2026
d5945b8
feat: enhance documentation and user experience
LouisTier Feb 19, 2026
0c3728b
feat: enhance Makefile and documentation for development workflow
LouisTier Feb 19, 2026
9dfa27a
refactor: improve code formatting and organization across notebooks a…
LouisTier Feb 19, 2026
09070cf
refactor: reorganize imports and update type hints for improved clarity
LouisTier Feb 19, 2026
c6024ed
refactor: improve code readability and consistency in unit tests by r…
LouisTier Feb 19, 2026
8c33031
docs: add a call to action for starring the repository in the README
LouisTier Feb 19, 2026
0d45f1f
docs: fix formatting in README by adjusting closing div tag placement
LouisTier Feb 19, 2026
845e932
feat: add TODO list for future enhancements and features in the project
LouisTier Feb 28, 2026
3424f1a
feat: implement neighborhood order adjustment and retrieval modes in …
LouisTier Apr 17, 2026
fdb4e7d
docs: update documentation and figures for improved clarity and repro…
LouisTier Jun 1, 2026
0a81704
docs: remove outdated sections and streamline benchmark README for cl…
LouisTier Jun 1, 2026
fdcbb70
ci: sync deps before installing CPU torch in test workflow
LouisTier Jun 1, 2026
2fca677
test: ignore SyntaxWarning so Python 3.12 tolerates hdbscan invalid-e…
LouisTier Jun 1, 2026
759d738
ci: make SonarCloud scan non-blocking so a token 403 can't fail tests…
LouisTier Jun 1, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
212 changes: 55 additions & 157 deletions .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,171 +2,69 @@ name: Code Quality

on:
push:
branches: [ main, dev/jmlr, feature/gpu_fix ]
branches: [main]
pull_request:
branches: [ main, dev/jmlr, feature/gpu_fix ]
branches: [main]

jobs:
code-quality:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-quality-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev, security, linting]"
# pip install ruff mypy bandit safety

- name: Check code formatting with Black
run: |
black --check --diff torchsom/ tests/

- name: Check import sorting with isort
run: |
isort --check-only --diff torchsom/ tests/

- name: Lint with Ruff
run: |
ruff check torchsom/ tests/ --output-format=github

- name: Type checking with MyPy
run: |
mypy torchsom/ --ignore-missing-imports --strict
# mypy torchsom/
continue-on-error: true

- name: Check for security issues with Bandit (library code)
run: |
bandit -r torchsom/ -f json -o bandit-report-library.json --skip B101,B311,B601
continue-on-error: true

- name: Check for security issues with Bandit (tests)
run: |
bandit -r tests/ -f json -o bandit-report-tests.json --skip B101,B311,B601
continue-on-error: true

# - name: Check for known security vulnerabilities
# run: |
# safety check --json --output safety-report.json
# continue-on-error: true

- name: Upload security reports
uses: actions/upload-artifact@v4
if: always()
with:
name: security-reports
path: |
bandit-report-library.json
bandit-report-tests.json
# safety-report.json
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.12

- name: Sync dependencies
run: uv sync --extra linting

- name: Ruff format check
run: uv run ruff format --check torchsom/ tests/

- name: Ruff lint
run: uv run ruff check torchsom/ tests/ --output-format=github

- name: Type checking with mypy
run: uv run mypy torchsom/ --ignore-missing-imports
continue-on-error: true

docstring-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-quality-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev, docs]"
# pip install pydocstyle interrogate

- name: Check docstring style
run: |
pydocstyle torchsom/ --convention=google
continue-on-error: true

- name: Check docstring coverage
run: |
interrogate torchsom/ --verbose --ignore-init-method --ignore-magic --ignore-module --fail-under=80
continue-on-error: true

complexity-analysis:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-quality-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev, linting]"
# pip install radon

- name: Analyze code complexity
run: |
radon cc torchsom/ --show-complexity --min B
radon mi torchsom/ --show --min B
continue-on-error: true

check-dependencies:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.12

- name: Sync dependencies
run: uv sync --extra docs

- name: Docstring coverage
run: uv run interrogate torchsom/ --verbose --ignore-init-method --ignore-magic --ignore-module --fail-under=80
continue-on-error: true

complexity:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: "3.9"

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-quality-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-quality-
${{ runner.os }}-pip-

- name: Install pip-tools
run: |
python -m pip install --upgrade pip
pip install -e ".[security]"
# pip install pip-tools

- name: Check for dependency conflicts
run: |
pip-compile pyproject.toml --dry-run --verbose
continue-on-error: true
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
run: uv python install 3.12

- name: Sync dependencies
run: uv sync --extra linting

- name: Complexity analysis
run: |
uv run radon cc torchsom/ --show-complexity --min B
uv run radon mi torchsom/ --show --min B
continue-on-error: true
21 changes: 8 additions & 13 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,25 @@ name: Build and Deploy Docs

on:
push:
branches: [main, dev/jmlr, feature/gpu_fix]
branches: [main]

jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
run: uv python install 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e '.[dev, docs]'
# pip install -e '.[dev]'
# pip install sphinx sphinx-rtd-theme sphinx-autodoc-typehints
- name: Sync dependencies
run: uv sync --extra dev --extra docs

- name: Build docs
run: |
cd docs
make html
run: uv run sphinx-build -b html docs/source/ docs/build/html

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
108 changes: 48 additions & 60 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Release
on:
push:
tags:
- 'v*'
- "v*"

jobs:
test-before-release:
Expand All @@ -19,72 +19,60 @@ jobs:
id-token: write

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install uv
uses: astral-sh/setup-uv@v5

- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-release-${{ hashFiles('pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-release-
${{ runner.os }}-pip-
- name: Set up Python
run: uv python install 3.12

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build twine commitizen pygithub
- name: Sync release dependencies
run: uv sync --extra release

- name: Generate CHANGELOG
run: |
if git log $(git describe --tags --abbrev=0)..HEAD --oneline | grep -q .; then
cz changelog
else
echo "No new commits"
fi
- name: Generate CHANGELOG
run: |
if git log $(git describe --tags --abbrev=0)..HEAD --oneline | grep -q .; then
uv run cz changelog
else
echo "No new commits"
fi

- name: Commit updated CHANGELOG.md
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "chore: update changelog for $GITHUB_REF_NAME" || echo "No changes to commit"
git push origin HEAD:main
- name: Commit updated CHANGELOG.md
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CHANGELOG.md
git commit -m "chore: update changelog for $GITHUB_REF_NAME" || echo "No changes to commit"
git push origin HEAD:main

- name: Build package
run: |
python -m build
- name: Build package
run: uv build

- name: Check package
run: |
twine check dist/*
- name: Check package
run: uv run twine check dist/*

- name: Extract changelog
id: changelog
run: |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
sed -n '/## \['"$GITHUB_REF_NAME"'\]/,/^## \[/{/^## \[/b;p}' CHANGELOG.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Extract changelog
id: changelog
run: |
echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
sed -n '/## \['"$GITHUB_REF_NAME"'\]/,/^## \[/{/^## \[/b;p}' CHANGELOG.md >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV

- name: Create Release with changelog notes
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref }}
body: ${{ env.RELEASE_NOTES }}
draft: false
prerelease: false
- name: Create Release
uses: actions/create-release@v1.1.4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: Release ${{ github.ref }}
body: ${{ env.RELEASE_NOTES }}
draft: false
prerelease: false

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
Loading
Loading