Skip to content

Commit aa1cad9

Browse files
authored
Updated namings and added release workflow. (#2)
* Updated namings and added release workflow. * Updated lock file * Updated upload artifact action to newest version * Temporarily excluding combination of windows-latest and python3.13 due to runner segfault.
1 parent 9321365 commit aa1cad9

File tree

13 files changed

+257
-210
lines changed

13 files changed

+257
-210
lines changed

.github/actions/build/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
- name: Set up Python
1010
uses: actions/setup-python@v3
1111
with:
12-
python-version: '3.12'
12+
python-version: '3.13'
1313

1414
- name: Install dependencies
1515
run: |
@@ -40,7 +40,7 @@ runs:
4040
shell: bash
4141

4242
- name: Store the distribution packages
43-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
4444
with:
4545
name: python-package-distributions
4646
path: dist/

.github/actions/publish/action.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.

.github/actions/release/action.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Release
2+
description: Create a GitHub release
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Extract version from pyproject.toml
8+
id: get_version
9+
run: |
10+
version=$(grep -o 'version = "[^"]*"' pyproject.toml | sed -E 's/version = "(.*)"/\1/')
11+
echo "VERSION=$version" >> $GITHUB_ENV
12+
shell: bash
13+
- name: Download all the dists
14+
uses: actions/download-artifact@v4
15+
with:
16+
name: python-package-distributions
17+
path: dist/
18+
- name: Sign the dists with Sigstore
19+
uses: sigstore/gh-action-sigstore-python@v3.0.0
20+
with:
21+
inputs: >-
22+
./dist/*.tar.gz
23+
./dist/*.whl
24+
- name: Create GitHub Release
25+
env:
26+
GITHUB_TOKEN: ${{ github.token }}
27+
run: >-
28+
gh release create
29+
"v${{ env.VERSION }}"
30+
--repo "$GITHUB_REPOSITORY"
31+
--notes ""
32+
shell: bash
33+
- name: Upload artifact signatures to GitHub Release
34+
env:
35+
GITHUB_TOKEN: ${{ github.token }}
36+
# Upload to GitHub Release using the `gh` CLI.
37+
# `dist/` contains the built packages, and the
38+
# sigstore-produced signatures and certificates.
39+
run: >-
40+
gh release upload
41+
"v${{ env.VERSION }}" dist/**
42+
--repo "$GITHUB_REPOSITORY"
43+
shell: bash

.github/workflows/package_workflow.yml

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,23 @@ jobs:
1919
if: ${{ github.event.workflow_run.conclusion == 'success' }}
2020
steps:
2121
- uses: actions/checkout@v4
22-
- uses: ./.github/actions/publish
22+
- uses: actions/download-artifact@v3
23+
with:
24+
name: python-package-distributions
25+
path: dist/
26+
- uses: pypa/gh-action-pypi-publish@release/v1
2327
permissions:
2428
id-token: write
2529
environment:
2630
name: pypi
27-
url: https://pypi.org/p/ikpls
31+
url: https://pypi.org/p/ikpls
32+
33+
github_release:
34+
needs: publish_package
35+
runs-on: ubuntu-latest
36+
permissions:
37+
contents: write
38+
id-token: write
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: ./.github/actions/release

.github/workflows/pull_request_test_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, windows-latest, macos-latest]
20-
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
exclude:
22+
- os: windows-latest
23+
python-version: "3.13"
2124
steps:
2225
- uses: actions/checkout@v4
2326
- uses: ./.github/actions/test

.github/workflows/test_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os: [ubuntu-latest, windows-latest, macos-latest]
20-
python-version: ["3.9", "3.10", "3.11", "3.12"]
20+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
21+
exclude:
22+
- os: windows-latest
23+
python-version: "3.13"
2124
steps:
2225
- uses: actions/checkout@v4
2326
- uses: ./.github/actions/test

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ For an implementation of the fast cross-validation algorithms combined with Impr
4444
>
4545
> X = np.random.uniform(size=(N, K)) # Random X data
4646
> Y = np.random.uniform(size=(N, M)) # Random Y data
47-
> cv_splits = np.arange(100) % 5 # 5-fold cross-validation
47+
> folds = np.arange(100) % 5 # 5-fold cross-validation
4848
>
4949
> # Instantiate CVMatrix
5050
> cvm = CVMatrix(
51-
> cv_splits=cv_splits,
51+
> folds=folds,
5252
> center_X=True,
5353
> center_Y=True,
5454
> scale_X=True,
@@ -57,13 +57,13 @@ For an implementation of the fast cross-validation algorithms combined with Impr
5757
> # Fit on X and Y
5858
> cvm.fit(X=X, Y=Y)
5959
> # Compute training set XTX and/or XTY for each fold
60-
> for val_split in cvm.val_folds_dict.keys():
60+
> for fold in cvm.folds_dict.keys():
6161
> # Get both XTX and XTY
62-
> training_XTX, training_XTY = cvm.training_XTX_XTY(val_split)
62+
> training_XTX, training_XTY = cvm.training_XTX_XTY(fold)
6363
> # Get only XTX
64-
> training_XTX = cvm.training_XTX(val_split)
64+
> training_XTX = cvm.training_XTX(fold)
6565
> # Get only XTY
66-
> training_XTY = cvm.training_XTY(val_split)
66+
> training_XTY = cvm.training_XTY(fold)
6767
6868
### Examples
6969
In [examples](https://github.com/Sm00thix/CVMatrix/tree/main/examples), you will find:

0 commit comments

Comments
 (0)