1. Lisandro Dalcin
  2. igakit

Commits

Lisandro Dalcin  committed b41b9b7

Add error checking

  • Participants
  • Parent commits 9ed6ad1
  • Branches default

Comments (0)

Files changed (1)

File src/igakit/cad.py

View file
     else:
         assert shape.ndim == 1
         dim = shape.shape[0]
-    assert 1 <= dim <= 3
+        assert 1 <= dim <= 3
     #
     degree = np.asarray(degree, dtype='i')
     if degree.ndim == 0:
         degree = degree.repeat(dim)
     assert degree.shape == (dim,)
+    assert np.all(degree > 0)
     #
     if continuity is None:
         continuity = degree - 1
         continuity = continuity.repeat(dim)
     assert continuity.shape == (dim,)
     continuity[continuity<0] += degree[continuity<0]
+    assert np.all(continuity >= 0)
+    assert np.all(continuity < degree)
     #
     limits = np.asarray(limits, dtype='d')
     if limits.ndim == 1: