Skip to content

Commit

Permalink
fixed tests; updated some repository files
Browse files Browse the repository at this point in the history
  • Loading branch information
FilippoAiraldi committed Feb 6, 2024
1 parent 8b1c80b commit a5602b0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ jobs:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
DISABLE_JIT: [0, 1]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand All @@ -29,12 +28,9 @@ jobs:
- name: Test with unittest
run: |
coverage run -m unittest discover ./tests 'test_*.py'
env:
NUMBA_DISABLE_JIT: ${{ matrix.DISABLE_JIT }}
# - name: Coverage with Code Climate
# uses: paambaati/codeclimate-action@v4.0.0
# # send report only when jit is disabled, and for python 3.11
# if: ${{ matrix.DISABLE_JIT == 1 }}
# env:
# CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_REPORTER_ID }}
# with:
Expand Down
10 changes: 10 additions & 0 deletions benchmarking/requirements-benchmarking.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
torch==2.1.2
botorch==0.9.5
matplotlib>=3.7.1
numpy>=1.24.4
pandas>=2.1.0
scipy>=1.11.0
joblib==1.3.2
globopt==1.0.0
gpytorch==1.11
prettytable>=3.8.0
4 changes: 2 additions & 2 deletions tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ def test_fit_and_partial_fit(self) -> None:
X = torch.as_tensor([-2.61, -1.92, -0.63, 0.38, 2], device="cpu").unsqueeze(-1)
Y = problem(X)
n = 3
mdls = [Idw(X[:n], Y[:n]), Rbf(X[:n], Y[:n], eps=0.5, eig_tol=0.0)]
mdls = [Idw(X[:n], Y[:n]), Rbf(X[:n], Y[:n], eps=0.5, svd_tol=0.0)]
for i in range(len(mdls)):
mdl = mdls[i]
if isinstance(mdl, Idw):
mdls[i] = Idw(X, Y)
else:
mdls[i] = Rbf(X, Y, mdl.eps, mdl.eig_tol, mdl.state)
mdls[i] = Rbf(X, Y, mdl.eps, mdl.svd_tol, mdl.state)
x_hat = torch.linspace(-3, 3, 100, dtype=X.dtype).view(1, -1, 1)
y_hat = torch.stack([mdl.posterior(x_hat).mean.squeeze() for mdl in mdls])
y_hat_expected = torch.as_tensor(RESULTS["y_hat"][:2], dtype=y_hat.dtype)
Expand Down

0 comments on commit a5602b0

Please sign in to comment.