Skip to content

Commit 7292c15

Browse files
authored
Merge pull request #41 from ChEB-AI/feature/unittest-actions
Add actions for unittests
2 parents 01453b4 + fdabd96 commit 7292c15

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Unittests
2+
3+
on: [pull_request]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: ["3.9", "3.10", "3.11"]
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
python -m pip install --upgrade pip setuptools wheel
24+
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
25+
python -m pip install -e .
26+
- name: Display Python version
27+
run: python -m unittest discover -s tests/unit

chebai/preprocessing/structures.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import networkx as nx
44
import torch
5-
from torch.utils.data.dataset import T_co
65

76

87
class XYData(torch.utils.data.Dataset):
@@ -23,7 +22,7 @@ def __init__(
2322
self.x = x
2423
self.y = y
2524

26-
def __getitem__(self, index: int) -> T_co:
25+
def __getitem__(self, index: int):
2726
"""Returns the data and target at the given index."""
2827
return self.x[index], self.y[index]
2928

0 commit comments

Comments
 (0)