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
27 changes: 27 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Unittests

on: [pull_request]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade pip setuptools wheel
python -m pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu
python -m pip install -e .
- name: Display Python version
run: python -m unittest discover -s tests/unit
3 changes: 1 addition & 2 deletions chebai/preprocessing/structures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import networkx as nx
import torch
from torch.utils.data.dataset import T_co


class XYData(torch.utils.data.Dataset):
Expand All @@ -23,7 +22,7 @@ def __init__(
self.x = x
self.y = y

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

Expand Down
Loading