Repository: hyrodium/BasicBSpline.jl (julia)

Issue:
Rename `isproper` -> `isnondegenerate`

Pull request description:
This PR fixes #137.

Patch:
diff --git a/docs/src/math.md b/docs/src/math.md
index 45815d71f..e8d8fa25d 100644
--- a/docs/src/math.md
+++ b/docs/src/math.md
@@ -112,7 +112,7 @@ k = KnotVector([1,3,5,6,8,9])
 BSplineSpace{p}(k)
 ```
 
-A B-spline space is said to be **proper** if its degree and knotvector satisfies following property:
+A B-spline space is said to be **non-degenerate** if its degree and knotvector satisfies following property:
 ```math
 \begin{aligned}
 k_{i}&<k_{i+p+1} & (1 \le i \le l-p-1)
@@ -120,10 +120,10 @@ k_{i}&<k_{i+p+1} & (1 \le i \le l-p-1)
 ```
 
 ```@docs
-isproper
+isnondegenerate
 ```
 
-The B-spline space is a linear space, and if a B-spline space is proper, its dimension is calculated by:
+The B-spline space is a linear space, and if a B-spline space is non-degenerate, its dimension is calculated by:
 ```math
 \dim(\mathcal{P}[p,k])=\sharp k - p -1
 ```
@@ -197,7 +197,7 @@ In these cases, each B-spline basis function ``B_{(i,2,k)}`` is coninuous, so `b
 
 ## Support of B-spline basis function
 !!! info "Thm.  Support of B-spline basis function"
-    If a B-spline space``\mathcal{P}[p,k]`` is proper, the support of its basis function is calculated as follows:
+    If a B-spline space``\mathcal{P}[p,k]`` is non-degenerate, the support of its basis function is calculated as follows:
     ```math
     \operatorname{supp}(B_{(i,p,k)})=[k_{i},k_{i+p+1}]
     ```
@@ -294,7 +294,7 @@ plot(t->sum(bsplinebasis(P,i,t) for i in 1:dim(P)), 1, 8, ylims=(0,1))
 
 ## Inclusive relation between B-spline spaces
 !!! info "Thm.  Support of B-spline basis function"
-    For proper B-spline spaces, the following relationship holds.
+    For non-degenerate B-spline spaces, the following relationship holds.
     ```math
     \mathcal{P}[p,k]
     \subseteq \mathcal{P}[p',k']
diff --git a/src/BasicBSpline.jl b/src/BasicBSpline.jl
index a4d4e7ff1..02de34a10 100644
--- a/src/BasicBSpline.jl
+++ b/src/BasicBSpline.jl
@@ -14,7 +14,7 @@ export bsplinebasis′₊₀, bsplinebasis′₋₀, bsplinebasis′
 export bsplinesupport, domain, changebasis, expandspace
 export bsplinebasisall, intervalindex
 export refinement, bsplinespaces, controlpoints
-export isproper, properdim
+export isdegenerate, isnondegenerate, exactdim
 export degree, knotvector
 export 𝔫
 export AbstractBSplineManifold, AbstractBSplineSpace
diff --git a/src/_BSplineSpace.jl b/src/_BSplineSpace.jl
index fc320da3d..1cc92f751 100644
--- a/src/_BSplineSpace.jl
+++ b/src/_BSplineSpace.jl
@@ -111,25 +111,45 @@ function iszeros(P::AbstractBSplineSpace{p}) where p
 end
 
 @doc raw"""
-Check if given B-spline space is proper.
+Check if given B-spline space is non-degenerate.
 
 # Examples
 ```jldoctest
-julia> isproper(BSplineSpace{2}(KnotVector([1,3,5,6,8,9])))
+julia> isnondegenerate(BSplineSpace{2}(KnotVector([1,3,5,6,8,9])))
 true
 
-julia> isproper(BSplineSpace{1}(KnotVector([1,3,3,3,8,9])))
+julia> isnondegenerate(BSplineSpace{1}(KnotVector([1,3,3,3,8,9])))
 false
 ```
 """
-function isproper(P::AbstractBSplineSpace)
-    return !any(iszeros(P))
+function isnondegenerate(P::AbstractBSplineSpace)
+    return !isdegenerate(P)
 end
 
-function properdim(P::AbstractBSplineSpace)
+@doc raw"""
+Check if given B-spline space is degenerate.
+
+# Examples
+```jldoctest
+julia> isdegenerate(BSplineSpace{2}(KnotVector([1,3,5,6,8,9])))
+false
+
+julia> isdegenerate(BSplineSpace{1}(KnotVector([1,3,3,3,8,9])))
+true
+```
+"""
+function isdegenerate(P::AbstractBSplineSpace)
+    return any(iszeros(P))
+end
+
+function exactdim(P::AbstractBSplineSpace)
     return dim(P) - sum(iszeros(P))
 end
 
+# These bindings will be removed when releasing v0.5.0
+Base.@deprecate_binding isproper isnondegenerate true
+Base.@deprecate_binding properdim exactdim true
+
 @doc raw"""
 Return the support of ``i``-th B-spline basis function.
 ```math
diff --git a/src/_DerivativeSpace.jl b/src/_DerivativeSpace.jl
index 90be278b7..4cf1f251d 100644
--- a/src/_DerivativeSpace.jl
+++ b/src/_DerivativeSpace.jl
@@ -14,7 +14,7 @@ bsplinespace(dP::BSplineDerivativeSpace) = dP.bsplinespace
 knotvector(dP::BSplineDerivativeSpace) = knotvector(bsplinespace(dP))
 degree(dP::BSplineDerivativeSpace{r,<:AbstractBSplineSpace{p}}) where {r,p} = p - r
 dim(dP::BSplineDerivativeSpace{r,<:AbstractBSplineSpace{p}}) where {r,p} = dim(bsplinespace(dP))
-properdim(dP::BSplineDerivativeSpace{r,<:AbstractBSplineSpace{p}}) where {r,p} = properdim(bsplinespace(dP)) - r
+exactdim(dP::BSplineDerivativeSpace{r,<:AbstractBSplineSpace{p}}) where {r,p} = exactdim(bsplinespace(dP)) - r
 intervalindex(dP::BSplineDerivativeSpace,t::Real) = intervalindex(bsplinespace(dP),t)
 domain(dP::BSplineDerivativeSpace) = domain(bsplinespace(dP))
 _lower(dP::BSplineDerivativeSpace{r}) where r = BSplineDerivativeSpace{r-1}(_lower(bsplinespace(dP)))


Test patch:
diff --git a/test/test_BSplineBasis.jl b/test/test_BSplineBasis.jl
index bcd79e3d4..d557109ea 100644
--- a/test/test_BSplineBasis.jl
+++ b/test/test_BSplineBasis.jl
@@ -129,9 +129,9 @@ end
         P1 = BSplineSpace{1}(k)
         P2 = BSplineSpace{2}(k)
 
-        @test !isproper(P0)
-        @test !isproper(P1)
-        @test isproper(P2)
+        @test isdegenerate(P0)
+        @test isdegenerate(P1)
+        @test isnondegenerate(P2)
 
         n0 = dim(P0)
         n1 = dim(P1)
diff --git a/test/test_BSplineSpace.jl b/test/test_BSplineSpace.jl
index 291b10868..faa8e26ff 100644
--- a/test/test_BSplineSpace.jl
+++ b/test/test_BSplineSpace.jl
@@ -4,12 +4,12 @@
     P1 = BSplineSpace{2}(KnotVector([1, 3, 5, 6, 8, 9]))
     @test bsplinesupport(P1, 2) == 3..8
     @test dim(P1) == 3
-    @test properdim(P1) == 3
-    @test isproper(P1) == true
+    @test exactdim(P1) == 3
+    @test isnondegenerate(P1) == true
 
     P2 = BSplineSpace{1}(KnotVector([1, 3, 3, 3, 8, 9]))
-    @test isproper(P2) == false
-    @test properdim(P2) == 3
+    @test isnondegenerate(P2) == false
+    @test exactdim(P2) == 3
 
     i = 2
     k = KnotVector([5, 12, 13, 13, 14])
@@ -18,8 +18,8 @@
     @test bsplinesupport(P) == [5..13, 12..14]
     @test bsplinesupport(P, i) == 12..14
 
-    @test isproper(BSplineSpace{2}(KnotVector([1, 3, 5, 6, 8, 9])))
-    @test !isproper(BSplineSpace{1}(KnotVector([1, 3, 3, 3, 8, 9])))
+    @test isnondegenerate(BSplineSpace{2}(KnotVector([1, 3, 5, 6, 8, 9])))
+    @test isdegenerate(BSplineSpace{1}(KnotVector([1, 3, 3, 3, 8, 9])))
 
     @test dim(BSplineSpace{2}(KnotVector([1, 3, 5, 6, 8, 9]))) == 3
 
diff --git a/test/test_Derivative.jl b/test/test_Derivative.jl
index bf7290b71..d02dae10f 100644
--- a/test/test_Derivative.jl
+++ b/test/test_Derivative.jl
@@ -48,7 +48,7 @@
             Pb = BSplineDerivativeSpace{r-1}(P)
             @test degree(Pa) == p-r
             @test dim(Pa) == dim(P)
-            @test properdim(Pa) == properdim(P)-r
+            @test exactdim(Pa) == exactdim(P)-r
             @test domain(P) == domain(Pa) == domain(Pb)
             for t in ts, i in 1:dim(P)
                 d1 = bsplinebasis(Pa,i,t)
@@ -143,9 +143,9 @@
         P1 = BSplineSpace{1}(k)
         P2 = BSplineSpace{2}(k)
 
-        @test !isproper(P0)
-        @test !isproper(P1)
-        @test isproper(P2)
+        @test isdegenerate(P0)
+        @test isdegenerate(P1)
+        @test isnondegenerate(P2)
 
         n0 = dim(P0)
         n1 = dim(P1)