Skip to content

Commit a4c72c2

Browse files
committed
Fix tests
1 parent f6fc143 commit a4c72c2

File tree

3 files changed

+1
-12
lines changed

3 files changed

+1
-12
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ src/gcaa/.ipynb_checkpoints/
1414
*/.ipynb_checkpoints/*
1515
*/.idea/*
1616
*/.pytest_cache/*
17-
/src/gcaa/torchlogs/*
1817
*.coverage
1918
*coverage.xml
2019
report

gcaa/tools/basic.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from collections import defaultdict
22

33
import numpy as np
4-
import torch
5-
64

75
class PrettyDict(dict):
86
def __repr__(self):
@@ -15,22 +13,15 @@ def dict_factory():
1513

1614
def check_nan(data):
1715
"""
18-
>>> check_nan(torch.Tensor([1, 2, 3]))
19-
>>> check_nan(np.array([1, 2, 3]))
2016
>>> check_nan(None)
21-
>>> check_nan(torch.Tensor([1, float('nan'), 3]))
22-
Traceback (most recent call last):
23-
...
24-
RuntimeError: NaN detected in: tensor([1., nan, 3.])
17+
>>> check_nan(np.array([1, 2, 3]))
2518
>>> check_nan(np.array([1, float('nan'), 3]))
2619
Traceback (most recent call last):
2720
...
2821
RuntimeError: NaN detected in: [ 1. nan 3.]
2922
"""
3023
if data is None:
3124
return
32-
if isinstance(data, torch.Tensor) and not torch.isnan(data).any():
33-
return
3425
if isinstance(data, np.ndarray) and not np.isnan(data).any():
3526
return
3627
raise RuntimeError(f"NaN detected in: {data}")

scripts/test_mypi.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
conda create -n test python=3.12 pip -y
44
conda activate test
5-
pip install torch --index-url https://download.pytorch.org/whl/cpu
65
pip install gcaa
76
python -c "from gcaa import GCAA; GCAA().run()"
87
echo "Installation from Pypi ran a test successfully"

0 commit comments

Comments
 (0)