Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Version 0.1.0a1

#### New Features

* Initial release of `kalelinear`: knowledge-aware linear and kernel methods for multi-source/multi-view learning, including transfer learning, domain adaptation, manifold regularization, and group-aware estimators and transformers.
31 changes: 31 additions & 0 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# This workflow will generate a log of changes automatically upon a new release.
# See https://github.com/marketplace/actions/changelog-ci

name: changelog

on:
pull_request:
types: [opened]

jobs:
log-changes:
name: Log changes
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
# Keep checkout shallow; changelog-ci handles unshallow internally.
# Using fetch-depth: 0 causes changelog-ci to fail with:
# "fatal: --unshallow on a complete repository does not make sense"
fetch-depth: 1
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run changelog
uses: saadmk11/changelog-ci@v1.2.0
with:
changelog_filename: .github/CHANGELOG.md
config_file: .github/changelog-ci-config.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70 changes: 70 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: codeql-analysis

on:
push:
branches: [ main ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ main ]
schedule:
- cron: '15 18 * * 5'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'python' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://git.io/codeql-language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
28 changes: 28 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# This workflow will run lint and many other pre-commit hooks.
# https://pre-commit.com/

name: pre-commit-check

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
pre-commit-check:
name: Pre-commit checks including linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
pip install pre-commit isort
pre-commit install
- name: Run pre-commit checks including linting
run: |
pre-commit run --all-files
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# This workflow will release a package on PyPI automatically when it is tagged/released.
# https://packaging.python.org/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/

name: release

on:
release:
types: [created]

jobs:
build-n-publish:
name: Release on PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution to Test PyPI
if: github.event.release.prerelease
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish distribution to PyPI
if: ${{ !github.event.release.prerelease }}
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
95 changes: 95 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# This workflow will install Python dependencies, run tests, and report the coverage with a variety of Python versions and OSs.
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: test

on:
push:
branches: [main]
pull_request:
branches: [main]
schedule:
# * is a special character in YAML, so you have to quote this string
- cron: "0 0 * * *" # every midnight

jobs:
test:
name: Test (${{ matrix.os }}, python version ${{ matrix.python-version }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12"] # list of Python versions to test
# exclude:
# - os: windows-latest
# python-version: "3.10"
include:
- os: ubuntu-latest
path: ~/.cache/pip
# - os: windows-latest
# path: ~\AppData\Local\pip\Cache

steps:
- uses: actions/checkout@v4
- name: Set up Python using Miniconda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
miniconda-version: latest

- name: Cache pip dependencies
id: cache_pip
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-python${{ matrix.python-version }}-pip-20250302-${{ hashFiles('**/setup.py') }}
restore-keys: |
${{ runner.os }}-python${{ matrix.python-version }}-pip-20250302-
# We have used a softer matching strategy for the full hash of setup.py, as recommended by GitHub.
# See: https://github.com/davronaliyev/Cache-dependencies-in-GitHub-Actions/blob/main/examples.md#python---pip
# This restores the cache first and then downloads any changed packages to avoid updating the cache with
# every change to the setup.py file, thus reducing the storage requirements of GitHub Action.
# We set a date tag to the cache key to show the updated date of the cache. We can update this date tag to
# generate new cache after every major changes in setup.py.

- name: Install project and dev dependencies
run: |
pip install --no-build-isolation -e .[dev]
shell: bash -l {0}

- name: Cache downloaded test data
id: cache_data
uses: actions/cache@v4
with:
path: tests/test_data
key: ${{ runner.os }}-python${{ matrix.python-version }}-data-${{ hashFiles('tests/download_test_data.py') }}
restore-keys: |
${{ runner.os }}-python${{ matrix.python-version }}-data-${{ hashFiles('tests/download_test_data.py') }}
# Use strict matching for the hash of download_test_data.py, as we want to update the cache whenever the file changes.

- name: Download test data
if: steps.cache_data.outputs.cache-hit != 'true'
run: |
python tests/download_test_data.py
shell: bash -l {0}

- name: Run tests with thread limits
id: run_tests
run: |
export OMP_NUM_THREADS=1
export MKL_NUM_THREADS=1
export NUMEXPR_NUM_THREADS=1
pytest --nbmake --nbmake-timeout=3000 --cov=kalelinear
shell: bash -l {0}

- name: Determine coverage
run: |
coverage xml
shell: bash -l {0}

- name: Report coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
Loading
Loading