Skip to content

Commit

Permalink
debugging curveperturbed CI failures
Browse files Browse the repository at this point in the history
  • Loading branch information
landreman committed Sep 2, 2023
1 parent c859dfb commit 83781fd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.8.17] # To sync with coveragerc use 3 level
python-version: [3.10.12] # To sync with coveragerc use 3 level
test-type: [unit, integrated]

steps:
Expand Down
6 changes: 4 additions & 2 deletions tests/geo/test_curveperturbed.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def test_perturbed_gammadash(self):
gdest *= 1/dphi
err = np.abs(gdest - gd[2:-2, :])

print("np.mean(err)", np.mean(err))
print("test_perturbed_gammadash: np.mean(err)", np.mean(err))
if idx == 0:
assert np.mean(err) < 3e-4
else:
Expand All @@ -45,7 +45,7 @@ def test_perturbed_periodic(self):
rg = np.random.Generator(PCG64(1))
sample = PerturbationSample(sampler, randomgen=rg)
periodic_err = np.abs(sample[0][:n, :] - sample[0][n:, :])
print("periodic_err", np.mean(periodic_err))
print("test_perturbed_periodic: periodic_err =", np.mean(periodic_err))
assert np.mean(periodic_err) < 1e-6

def test_perturbed_objective_torsion(self):
Expand Down Expand Up @@ -75,6 +75,7 @@ def test_perturbed_objective_torsion(self):
h = 1e-3 * np.random.rand(len(curve_dofs)).reshape(curve_dofs.shape)
dJ = J.dJ()
deriv = np.sum(dJ * h)
print("test_perturbed_objective_torsion: np.abs(deriv):", np.abs(deriv))
assert np.abs(deriv) > 1e-10
err = 1e6
for i in range(10, 20):
Expand Down Expand Up @@ -120,6 +121,7 @@ def test_perturbed_objective_distance(self):
J = CurveCurveDistance([curve1, curve2], 2.0)
J0 = J.J()
curve1.resample()
print(f"test_perturbed_objective_distance: J0 = {J0} J.J() = {J.J()}")
assert J0 != J.J()
J0 = J.J()
curve_dofs = J.x
Expand Down

0 comments on commit 83781fd

Please sign in to comment.