Skip to content

Commit

Permalink
Further reduced computation time of some tests. Also added explicit t…
Browse files Browse the repository at this point in the history
…imeout for GitHub workflows.
  • Loading branch information
Ole-Christian Galbo Engstrøm committed Jan 22, 2025
1 parent 1dea235 commit 3c560f5
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 21 deletions.
1 change: 1 addition & 0 deletions .github/workflows/pull_request_test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
jobs:
test_package:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/test_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ on:

jobs:
test_package:
runs-on: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
Expand Down
40 changes: 20 additions & 20 deletions tests/test_ikpls.py
Original file line number Diff line number Diff line change
Expand Up @@ -3386,8 +3386,8 @@ def test_fast_cross_val_pls_1_loocv(self):
X = self.load_X()
Y = self.load_Y(["Protein"])
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
X = X[::100]
Y = Y[::100]
splits = np.arange(X.shape[0])
assert Y.shape[1] == 1
self.check_fast_cross_val_pls(
Expand Down Expand Up @@ -3442,8 +3442,8 @@ def test_fast_cross_val_pls_2_m_less_k_loocv(self):
]
)
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
X = X[::100]
Y = Y[::100]
splits = np.arange(X.shape[0])
assert Y.shape[1] > 1
assert Y.shape[1] < X.shape[1]
Expand Down Expand Up @@ -3487,8 +3487,8 @@ def test_fast_cross_val_pls_2_m_eq_k_loocv(self):
)

# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
X = X[::100]
Y = Y[::100]
X = X[..., :10]
splits = np.arange(X.shape[0])
assert Y.shape[1] > 1
Expand Down Expand Up @@ -3532,8 +3532,8 @@ def test_fast_cross_val_pls_2_m_greater_k_loocv(self):
]
)
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
X = X[::100]
Y = Y[::100]
X = X[..., :9]
splits = np.arange(X.shape[0])
assert Y.shape[1] > 1
Expand Down Expand Up @@ -4016,9 +4016,9 @@ def test_center_scale_combinations_pls_1(self):
Y = self.load_Y(["Protein"])
splits = self.load_Y(["split"]) # Contains 3 splits of different sizes
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
splits = splits[::50]
X = X[::100]
Y = Y[::100]
splits = splits[::100]
assert Y.shape[1] == 1
self.check_center_scale_combinations(X, Y, splits, atol=0, rtol=1e-8)

Expand Down Expand Up @@ -4069,9 +4069,9 @@ def test_center_scale_combinations_pls_2_m_less_k(self):
)
splits = self.load_Y(["split"]) # Contains 3 splits of different sizes
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
splits = splits[::50]
X = X[::100]
Y = Y[::100]
splits = splits[::100]
assert Y.shape[1] > 1
assert Y.shape[1] < X.shape[1]
self.check_center_scale_combinations(X, Y, splits, atol=0, rtol=1e-7)
Expand Down Expand Up @@ -4118,9 +4118,9 @@ def test_center_scale_combinations_pls_2_m_eq_k(self):
X = X[..., :10]
splits = self.load_Y(["split"]) # Contains 3 splits of different sizes
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
splits = splits[::50]
X = X[::100]
Y = Y[::100]
splits = splits[::100]
assert Y.shape[1] > 1
assert Y.shape[1] == X.shape[1]
self.check_center_scale_combinations(X, Y, splits, atol=0, rtol=3e-8)
Expand Down Expand Up @@ -4167,9 +4167,9 @@ def test_center_scale_combinations_pls_2_m_greater_k(self):
X = X[..., :9]
splits = self.load_Y(["split"]) # Contains 3 splits of different sizes
# Decrease the amount of samples in the interest of time.
X = X[::50]
Y = Y[::50]
splits = splits[::50]
X = X[::100]
Y = Y[::100]
splits = splits[::100]
assert Y.shape[1] > 1
assert Y.shape[1] > X.shape[1]
self.check_center_scale_combinations(X, Y, splits, atol=0, rtol=1e-8)

0 comments on commit 3c560f5

Please sign in to comment.