Repository: JuliaDiff/FiniteDifferences.jl
Pull request #30 (2019-07-31 16:48:59)

Rename
This is to change over to the new name


Patch:
diff --git a/Project.toml b/Project.toml
index 88a4587..fa510fa 100644
--- a/Project.toml
+++ b/Project.toml
@@ -1,6 +1,6 @@
-name = "FDM"
+name = "FiniteDifferences"
 uuid = "e25cca7e-83ef-51fa-be6c-dfe2a3123128"
-version = "0.6.2"
+version = "0.7.0"
 
 [deps]
 LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
diff --git a/README.md b/README.md
index b5b4ac1..14daf0e 100644
--- a/README.md
+++ b/README.md
@@ -1,13 +1,13 @@
-# FDM.jl: Finite Difference Methods
+# FiniteDifferences.jl: Finite Difference Methods
 
-[![Build Status](https://travis-ci.org/invenia/FDM.jl.svg?branch=master)](https://travis-ci.org/invenia/FDM.jl)
-[![Windows Build status](https://ci.appveyor.com/api/projects/status/g0gun5dxbkt631am/branch/master?svg=true)](https://ci.appveyor.com/project/invenia/fdm-jl/branch/master)
-[![codecov.io](http://codecov.io/github/invenia/FDM.jl/coverage.svg?branch=master)](http://codecov.io/github/invenia/FDM.jl?branch=master)
-[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FDM.jl/latest/)
+[![Build Status](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl)
+[![Windows Build status](https://ci.appveyor.com/api/projects/status/g0gun5dxbkt631am/branch/master?svg=true)](https://ci.appveyor.com/project/JuliaDiff/FiniteDifferences-jl/branch/master)
+[![codecov.io](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl?branch=master)
+[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FiniteDifferences.jl/latest/)
 
-FDM.jl estimates derivatives with finite differences.
+FiniteDifferences.jl estimates derivatives with [finite differences](https://en.wikipedia.org/wiki/Finite_difference).
 
-See also [FDM](https://github.com/wesselb/fdm).
+See also [FiniteDifferences](https://github.com/wesselb/fdm).
 
 ## Examples
 
@@ -24,11 +24,11 @@ julia> central_fdm(5, 2)(sin, 1) + sin(1)
 9.747314066999024e-12
 ```
 
-Construct a FDM on a custom grid:
+Construct a FiniteDifferences on a custom grid:
 
 ```julia
 julia> method, report = fdm([-2, 0, 5], 1, report=true)
-(FDM.method, FDMReport:
+(FiniteDifferences.method, FiniteDifferencesReport:
   order of method:       3
   order of derivative:   1
   grid:                  [-2, 0, 5]
diff --git a/docs/make.jl b/docs/make.jl
index 6d965a3..97e6a96 100644
--- a/docs/make.jl
+++ b/docs/make.jl
@@ -1,13 +1,13 @@
-using Documenter, FDM
+using Documenter, FiniteDifferences
 
 makedocs(
-    modules=[FDM],
+    modules=[FiniteDifferences],
     format=:html,
     pages=[
         "Home" => "index.md",
         "API" => "pages/api.md"
     ],
-    sitename="FDM.jl",
+    sitename="FiniteDifferences.jl",
     authors="Invenia Labs",
     assets=[
         "assets/invenia.css",
@@ -15,7 +15,7 @@ makedocs(
 )
 
 deploydocs(
-    repo = "github.com/invenia/FDM.jl.git",
+    repo = "github.com/JuliaDiff/FiniteDifferences.jl.git",
     julia = "1.0",
     target = "build",
     deps = nothing,
diff --git a/docs/src/index.md b/docs/src/index.md
index 4916087..4bcfa9b 100644
--- a/docs/src/index.md
+++ b/docs/src/index.md
@@ -1,10 +1,10 @@
-# FDM.jl: Finite Difference Methods
+# FiniteDifferences.jl: Finite Difference Methods
 
-[![Build Status](https://travis-ci.org/invenia/FDM.jl.svg?branch=master)](https://travis-ci.org/invenia/FDM.jl)
-[![codecov.io](http://codecov.io/github/invenia/FDM.jl/coverage.svg?branch=master)](http://codecov.io/github/invenia/FDM.jl?branch=master)
-[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FDM.jl/latest/)
+[![Build Status](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl)
+[![codecov.io](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl?branch=master)
+[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FiniteDifferences.jl/latest/)
 
-FDM.jl approximates derivatives of functions using finite difference methods.
+FiniteDifferences.jl approximates derivatives of functions using finite difference methods.
 
 ## Examples
 
@@ -21,11 +21,11 @@ julia> central_fdm(5, 2)(sin, 1) + sin(1)
 9.747314066999024e-12
 ```
 
-Construct a FDM on a custom grid:
+Construct a FiniteDifferences on a custom grid:
 
 ```julia
 julia> method, report = fdm([-2, 0, 5], 1, report=true)
-(FDM.method, FDMReport:
+(FiniteDifferences.method, FiniteDifferencesReport:
   order of method:       3
   order of derivative:   1
   grid:                  [-2, 0, 5]
diff --git a/docs/src/pages/api.md b/docs/src/pages/api.md
index 80eb93b..329ec8a 100644
--- a/docs/src/pages/api.md
+++ b/docs/src/pages/api.md
@@ -1,4 +1,4 @@
 ```@autodocs
-Modules = [FDM]
+Modules = [FiniteDifferences]
 Private = false
 ```
diff --git a/src/FDM.jl b/src/FiniteDifferences.jl
similarity index 85%
rename from src/FDM.jl
rename to src/FiniteDifferences.jl
index fe39434..a379d12 100644
--- a/src/FDM.jl
+++ b/src/FiniteDifferences.jl
@@ -1,4 +1,4 @@
-module FDM
+module FiniteDifferences
 
     using Printf, LinearAlgebra
 
diff --git a/src/methods.jl b/src/methods.jl
index 6533120..f1b0272 100644
--- a/src/methods.jl
+++ b/src/methods.jl
@@ -1,7 +1,7 @@
 export fdm, backward_fdm, forward_fdm, central_fdm
 
 """
-    FDM.DEFAULT_CONDITION
+    FiniteDifferences.DEFAULT_CONDITION
 
 The default [condition number](https://en.wikipedia.org/wiki/Condition_number) used when
 computing bounds. It provides amplification of the ∞-norm when passed to the function's
@@ -10,7 +10,7 @@ derivatives.
 const DEFAULT_CONDITION = 100
 
 """
-    FDM.TINY
+    FiniteDifferences.TINY
 
 A tiny number added to some quantities to ensure that division by 0 does not occur.
 """
@@ -48,10 +48,10 @@ mutable struct History
 end
 
 """
-    FDMethod
+    FiniteDifferenceMethod
 
 Abstract type for all finite differencing method types.
-Subtypes of `FDMethod` are callable with the signature
+Subtypes of `FiniteDifferenceMethod` are callable with the signature
 
 ```
 method(f, x; kwargs...)
@@ -64,10 +64,10 @@ where the keyword arguments can be any of
 * `condition`: The condition number. See [`DEFAULT_CONDITION`](@ref).
 * `eps`: The assumed roundoff error. Defaults to `eps()` plus [`TINY`](@ref).
 """
-abstract type FDMethod end
+abstract type FiniteDifferenceMethod end
 
-function Base.show(io::IO, x::FDMethod)
-    @printf io "FDMethod:\n"
+function Base.show(io::IO, x::FiniteDifferenceMethod)
+    @printf io "FiniteDifferenceMethod:\n"
     @printf io "  order of method:       %d\n" x.p
     @printf io "  order of derivative:   %d\n" x.q
     @printf io "  grid:                  %s\n" x.grid
@@ -83,7 +83,7 @@ end
 
 for D in (:Forward, :Backward, :Central, :Nonstandard)
     @eval begin
-        struct $D{G<:AbstractVector, C<:AbstractVector} <: FDMethod
+        struct $D{G<:AbstractVector, C<:AbstractVector} <: FiniteDifferenceMethod
             p::Int
             q::Int
             grid::G
@@ -116,24 +116,24 @@ for D in (:Forward, :Backward, :Central)
         end
 
         @doc """
-            FDM.$($(Meta.quot(D)))(p, q; kwargs...)
+            FiniteDifferences.$($(Meta.quot(D)))(p, q; kwargs...)
             $($(Meta.quot(fdmf)))(p, q; kwargs...)
 
         Construct a $($lcname) finite difference method of order `p` to compute the `q`th
         derivative.
-        See [`FDMethod`](@ref) for more details.
+        See [`FiniteDifferenceMethod`](@ref) for more details.
         """
         ($D, $fdmf)
     end
 end
 
 """
-    FDM.Nonstandard(grid, q; kwargs...)
+    FiniteDifferences.Nonstandard(grid, q; kwargs...)
 
 An finite differencing method which is constructed based on a user-defined grid. It is
 nonstandard in the sense that it represents neither forward, backward, nor central
 differencing.
-See [`FDMethod`](@ref) for further details.
+See [`FiniteDifferenceMethod`](@ref) for further details.
 """
 function Nonstandard(grid::AbstractVector{<:Real}, q::Integer; adapt=0, kwargs...)
     p = length(grid)
@@ -166,8 +166,8 @@ end
 _estimate_bound(x, cond) = cond * maximum(abs, x) + TINY
 
 """
-    fdm(m::FDMethod, f, x[, Val(false)]; kwargs...) -> Real
-    fdm(m::FDMethod, f, x, Val(true); kwargs...) -> Tuple{FDMethod, Real}
+    fdm(m::FiniteDifferenceMethod, f, x[, Val(false)]; kwargs...) -> Real
+    fdm(m::FiniteDifferenceMethod, f, x, Val(true); kwargs...) -> Tuple{FiniteDifferenceMethod, Real}
 
 Compute the derivative of `f` at `x` using the finite differencing method `m`.
 The optional `Val` argument dictates whether the method should be returned alongside the
@@ -186,7 +186,7 @@ The recognized keywords are:
     `adapt` greater than 0 when `m::Nonstandard` results in an error.
 
 !!! note
-    Calling [`FDMethod`](@ref) objects is equivalent to passing them to `fdm`.
+    Calling [`FiniteDifferenceMethod`](@ref) objects is equivalent to passing them to `fdm`.
 
 # Examples
 
@@ -195,7 +195,7 @@ julia> fdm(central_fdm(5, 1), sin, 1; adapt=2)
 0.5403023058681039
 
 julia> fdm(central_fdm(2, 1), exp, 0, Val(true))
-(FDMethod:
+(FiniteDifferenceMethod:
   order of method:       2
   order of derivative:   1
   grid:                  [-1, 1]
@@ -217,7 +217,7 @@ function fdm(
     eps=(Base.eps(float(bound)) + TINY),
     adapt=m.history.adapt,
     max_step=0.1,
-) where M<:FDMethod
+) where M<:FiniteDifferenceMethod
     if M <: Nonstandard && adapt > 0
         throw(ArgumentError("can't adaptively compute bounds over Nonstandard grids"))
     end
@@ -265,7 +265,7 @@ function fdm(
     return m, dfdx
 end
 
-function fdm(m::FDMethod, f, x, ::Val{false}=Val(false); kwargs...)
+function fdm(m::FiniteDifferenceMethod, f, x, ::Val{false}=Val(false); kwargs...)
     _, dfdx = fdm(m, f, x, Val(true); kwargs...)
     return dfdx
 end


Test patch:
diff --git a/test/grad.jl b/test/grad.jl
index dd3a9ea..00c4ea4 100644
--- a/test/grad.jl
+++ b/test/grad.jl
@@ -1,11 +1,11 @@
-using FDM: grad, jacobian, _jvp, _j′vp, jvp, j′vp, to_vec
+using FiniteDifferences: grad, jacobian, _jvp, _j′vp, jvp, j′vp, to_vec
 
 # Dummy type where length(x::DummyType) ≠ length(first(to_vec(x)))
 struct DummyType{TX<:Matrix}
     X::TX
 end
 
-function FDM.to_vec(x::DummyType)
+function FiniteDifferences.to_vec(x::DummyType)
     x_vec, back = to_vec(x.X)
     return x_vec, x_vec -> DummyType(back(x_vec))
 end
diff --git a/test/methods.jl b/test/methods.jl
index 2fad844..bbdca61 100644
--- a/test/methods.jl
+++ b/test/methods.jl
@@ -1,4 +1,4 @@
-using FDM: Forward, Backward, Central, Nonstandard
+using FiniteDifferences: Forward, Backward, Central, Nonstandard
 
 @testset "Methods" begin
     for f in [:forward_fdm, :backward_fdm, :central_fdm]
@@ -25,9 +25,9 @@ using FDM: Forward, Backward, Central, Nonstandard
         @test central_fdm(5, 1)(abs, 0.001) ≈ 1.0
     end
 
-    @testset "Printing FDMethods" begin
+    @testset "Printing FiniteDifferenceMethods" begin
         @test sprint(show, central_fdm(2, 1)) == """
-            FDMethod:
+            FiniteDifferenceMethod:
               order of method:       2
               order of derivative:   1
               grid:                  [-1, 1]
@@ -39,7 +39,7 @@ using FDM: Forward, Backward, Central, Nonstandard
         regex_array = r"\[([\d.+-e]+(, )?)+\]"
         @test occursin(Regex(join(map(x -> x.pattern,
             [
-                r"FDMethod:",
+                r"FiniteDifferenceMethod:",
                 r"order of method:", r"\d+",
                 r"order of derivative:", r"\d+",
                 r"grid:", regex_array,
diff --git a/test/runtests.jl b/test/runtests.jl
index 665a087..b4b5314 100644
--- a/test/runtests.jl
+++ b/test/runtests.jl
@@ -1,6 +1,6 @@
-using FDM, Test, Random, Printf, LinearAlgebra
+using FiniteDifferences, Test, Random, Printf, LinearAlgebra
 
-@testset "FDM" begin
+@testset "FiniteDifferences" begin
     include("methods.jl")
     include("numerics.jl")
     include("grad.jl")