Skip to content

Commit

Permalink
fix flake8 and remove try from autodiff test
Browse files Browse the repository at this point in the history
  • Loading branch information
kinnala committed Jul 31, 2024
1 parent e43313c commit 717df49
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 2 additions & 1 deletion skfem/io/meshio.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ def from_meshio(m,
ind = p2f[:, sorted_facets[0]]
for itr in range(sorted_facets.shape[0] - 1):
ind = ind.multiply(p2f[:, sorted_facets[itr + 1]])
# does not preserve order: boundaries[k] = np.nonzero(ind)[0].astype(np.int32)
# does not preserve order:
# boundaries[k] = np.nonzero(ind)[0].astype(np.int32)
ii, jj = ind.nonzero()
boundaries[k] = ii[np.argsort(jj)]

Expand Down
18 changes: 8 additions & 10 deletions tests/test_autodiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
import numpy as np
from numpy.testing import (assert_array_almost_equal,
assert_almost_equal)
try:
import jax.numpy as jnp
from skfem.experimental.autodiff import NonlinearForm
from skfem.experimental.autodiff.helpers import (grad, dot,
ddot, mul,
div, sym_grad,
transpose,
eye, trace)
except:
pass

import jax.numpy as jnp
from skfem.experimental.autodiff import NonlinearForm
from skfem.experimental.autodiff.helpers import (grad, dot,
ddot, mul,
div, sym_grad,
transpose,
eye, trace)
from skfem.assembly import Basis
from skfem.mesh import MeshTri, MeshQuad
from skfem.element import (ElementTriP1, ElementTriP2,
Expand Down

0 comments on commit 717df49

Please sign in to comment.