diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..b0792c99 --- /dev/null +++ b/.github/workflows/test.yml @@ -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 diff --git a/chebai/preprocessing/structures.py b/chebai/preprocessing/structures.py index 1e384598..1fb3711a 100644 --- a/chebai/preprocessing/structures.py +++ b/chebai/preprocessing/structures.py @@ -2,7 +2,6 @@ import networkx as nx import torch -from torch.utils.data.dataset import T_co class XYData(torch.utils.data.Dataset): @@ -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]