Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated namings and added release workflow. #2

Merged
merged 4 commits into from
Feb 11, 2025
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
4 changes: 2 additions & 2 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ runs:
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.12'
python-version: '3.13'

- name: Install dependencies
run: |
Expand Down Expand Up @@ -40,7 +40,7 @@ runs:
shell: bash

- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
14 changes: 0 additions & 14 deletions .github/actions/publish/action.yml

This file was deleted.

43 changes: 43 additions & 0 deletions .github/actions/release/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Release
description: Create a GitHub release

runs:
using: "composite"
steps:
- name: Extract version from pyproject.toml
id: get_version
run: |
version=$(grep -o 'version = "[^"]*"' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
echo "VERSION=$version" >> $GITHUB_ENV
shell: bash
- name: Download all the dists
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
- name: Sign the dists with Sigstore
uses: sigstore/[email protected]
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
run: >-
gh release create
"v${{ env.VERSION }}"
--repo "$GITHUB_REPOSITORY"
--notes ""
shell: bash
- name: Upload artifact signatures to GitHub Release
env:
GITHUB_TOKEN: ${{ github.token }}
# Upload to GitHub Release using the `gh` CLI.
# `dist/` contains the built packages, and the
# sigstore-produced signatures and certificates.
run: >-
gh release upload
"v${{ env.VERSION }}" dist/**
--repo "$GITHUB_REPOSITORY"
shell: bash
18 changes: 16 additions & 2 deletions .github/workflows/package_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,23 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/publish
- uses: actions/download-artifact@v3
with:
name: python-package-distributions
path: dist/
- uses: pypa/gh-action-pypi-publish@release/v1
permissions:
id-token: write
environment:
name: pypi
url: https://pypi.org/p/ikpls
url: https://pypi.org/p/ikpls

github_release:
needs: publish_package
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/release
5 changes: 4 additions & 1 deletion .github/workflows/pull_request_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- os: windows-latest
python-version: "3.13"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
exclude:
- os: windows-latest
python-version: "3.13"
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/test
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ For an implementation of the fast cross-validation algorithms combined with Impr
>
> X = np.random.uniform(size=(N, K)) # Random X data
> Y = np.random.uniform(size=(N, M)) # Random Y data
> cv_splits = np.arange(100) % 5 # 5-fold cross-validation
> folds = np.arange(100) % 5 # 5-fold cross-validation
>
> # Instantiate CVMatrix
> cvm = CVMatrix(
> cv_splits=cv_splits,
> folds=folds,
> center_X=True,
> center_Y=True,
> scale_X=True,
Expand All @@ -57,13 +57,13 @@ For an implementation of the fast cross-validation algorithms combined with Impr
> # Fit on X and Y
> cvm.fit(X=X, Y=Y)
> # Compute training set XTX and/or XTY for each fold
> for val_split in cvm.val_folds_dict.keys():
> for fold in cvm.folds_dict.keys():
> # Get both XTX and XTY
> training_XTX, training_XTY = cvm.training_XTX_XTY(val_split)
> training_XTX, training_XTY = cvm.training_XTX_XTY(fold)
> # Get only XTX
> training_XTX = cvm.training_XTX(val_split)
> training_XTX = cvm.training_XTX(fold)
> # Get only XTY
> training_XTY = cvm.training_XTY(val_split)
> training_XTY = cvm.training_XTY(fold)

### Examples
In [examples](https://github.com/Sm00thix/CVMatrix/tree/main/examples), you will find:
Expand Down
Loading