Skip to content

Commit 5a86527

Browse files
authored
Merge pull request #30 from JuliaDiff/ox/newname
Rename
2 parents 8a38029 + 5d29a31 commit 5a86527

File tree

10 files changed

+50
-50
lines changed

10 files changed

+50
-50
lines changed

Project.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
name = "FDM"
1+
name = "FiniteDifferences"
22
uuid = "e25cca7e-83ef-51fa-be6c-dfe2a3123128"
3-
version = "0.6.2"
3+
version = "0.7.0"
44

55
[deps]
66
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
# FDM.jl: Finite Difference Methods
1+
# FiniteDifferences.jl: Finite Difference Methods
22

3-
[![Build Status](https://travis-ci.org/invenia/FDM.jl.svg?branch=master)](https://travis-ci.org/invenia/FDM.jl)
4-
[![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)
5-
[![codecov.io](http://codecov.io/github/invenia/FDM.jl/coverage.svg?branch=master)](http://codecov.io/github/invenia/FDM.jl?branch=master)
6-
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FDM.jl/latest/)
3+
[![Build Status](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl)
4+
[![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)
5+
[![codecov.io](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl?branch=master)
6+
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FiniteDifferences.jl/latest/)
77

8-
FDM.jl estimates derivatives with finite differences.
8+
FiniteDifferences.jl estimates derivatives with [finite differences](https://en.wikipedia.org/wiki/Finite_difference).
99

10-
See also [FDM](https://github.com/wesselb/fdm).
10+
See also [FiniteDifferences](https://github.com/wesselb/fdm).
1111

1212
## Examples
1313

@@ -24,11 +24,11 @@ julia> central_fdm(5, 2)(sin, 1) + sin(1)
2424
9.747314066999024e-12
2525
```
2626

27-
Construct a FDM on a custom grid:
27+
Construct a FiniteDifferences on a custom grid:
2828

2929
```julia
3030
julia> method, report = fdm([-2, 0, 5], 1, report=true)
31-
(FDM.method, FDMReport:
31+
(FiniteDifferences.method, FiniteDifferencesReport:
3232
order of method: 3
3333
order of derivative: 1
3434
grid: [-2, 0, 5]

docs/make.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
using Documenter, FDM
1+
using Documenter, FiniteDifferences
22

33
makedocs(
4-
modules=[FDM],
4+
modules=[FiniteDifferences],
55
format=:html,
66
pages=[
77
"Home" => "index.md",
88
"API" => "pages/api.md"
99
],
10-
sitename="FDM.jl",
10+
sitename="FiniteDifferences.jl",
1111
authors="Invenia Labs",
1212
assets=[
1313
"assets/invenia.css",
1414
],
1515
)
1616

1717
deploydocs(
18-
repo = "github.com/invenia/FDM.jl.git",
18+
repo = "github.com/JuliaDiff/FiniteDifferences.jl.git",
1919
julia = "1.0",
2020
target = "build",
2121
deps = nothing,

docs/src/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# FDM.jl: Finite Difference Methods
1+
# FiniteDifferences.jl: Finite Difference Methods
22

3-
[![Build Status](https://travis-ci.org/invenia/FDM.jl.svg?branch=master)](https://travis-ci.org/invenia/FDM.jl)
4-
[![codecov.io](http://codecov.io/github/invenia/FDM.jl/coverage.svg?branch=master)](http://codecov.io/github/invenia/FDM.jl?branch=master)
5-
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FDM.jl/latest/)
3+
[![Build Status](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl.svg?branch=master)](https://travis-ci.org/JuliaDiff/FiniteDifferences.jl)
4+
[![codecov.io](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl/coverage.svg?branch=master)](http://codecov.io/github/JuliaDiff/FiniteDifferences.jl?branch=master)
5+
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://invenia.github.io/FiniteDifferences.jl/latest/)
66

7-
FDM.jl approximates derivatives of functions using finite difference methods.
7+
FiniteDifferences.jl approximates derivatives of functions using finite difference methods.
88

99
## Examples
1010

@@ -21,11 +21,11 @@ julia> central_fdm(5, 2)(sin, 1) + sin(1)
2121
9.747314066999024e-12
2222
```
2323

24-
Construct a FDM on a custom grid:
24+
Construct a FiniteDifferences on a custom grid:
2525

2626
```julia
2727
julia> method, report = fdm([-2, 0, 5], 1, report=true)
28-
(FDM.method, FDMReport:
28+
(FiniteDifferences.method, FiniteDifferencesReport:
2929
order of method: 3
3030
order of derivative: 1
3131
grid: [-2, 0, 5]

docs/src/pages/api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
```@autodocs
2-
Modules = [FDM]
2+
Modules = [FiniteDifferences]
33
Private = false
44
```

src/FDM.jl renamed to src/FiniteDifferences.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module FDM
1+
module FiniteDifferences
22

33
using Printf, LinearAlgebra
44

src/methods.jl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export fdm, backward_fdm, forward_fdm, central_fdm
22

33
"""
4-
FDM.DEFAULT_CONDITION
4+
FiniteDifferences.DEFAULT_CONDITION
55
66
The default [condition number](https://en.wikipedia.org/wiki/Condition_number) used when
77
computing bounds. It provides amplification of the ∞-norm when passed to the function's
@@ -10,7 +10,7 @@ derivatives.
1010
const DEFAULT_CONDITION = 100
1111

1212
"""
13-
FDM.TINY
13+
FiniteDifferences.TINY
1414
1515
A tiny number added to some quantities to ensure that division by 0 does not occur.
1616
"""
@@ -48,10 +48,10 @@ mutable struct History
4848
end
4949

5050
"""
51-
FDMethod
51+
FiniteDifferenceMethod
5252
5353
Abstract type for all finite differencing method types.
54-
Subtypes of `FDMethod` are callable with the signature
54+
Subtypes of `FiniteDifferenceMethod` are callable with the signature
5555
5656
```
5757
method(f, x; kwargs...)
@@ -64,10 +64,10 @@ where the keyword arguments can be any of
6464
* `condition`: The condition number. See [`DEFAULT_CONDITION`](@ref).
6565
* `eps`: The assumed roundoff error. Defaults to `eps()` plus [`TINY`](@ref).
6666
"""
67-
abstract type FDMethod end
67+
abstract type FiniteDifferenceMethod end
6868

69-
function Base.show(io::IO, x::FDMethod)
70-
@printf io "FDMethod:\n"
69+
function Base.show(io::IO, x::FiniteDifferenceMethod)
70+
@printf io "FiniteDifferenceMethod:\n"
7171
@printf io " order of method: %d\n" x.p
7272
@printf io " order of derivative: %d\n" x.q
7373
@printf io " grid: %s\n" x.grid
@@ -83,7 +83,7 @@ end
8383

8484
for D in (:Forward, :Backward, :Central, :Nonstandard)
8585
@eval begin
86-
struct $D{G<:AbstractVector, C<:AbstractVector} <: FDMethod
86+
struct $D{G<:AbstractVector, C<:AbstractVector} <: FiniteDifferenceMethod
8787
p::Int
8888
q::Int
8989
grid::G
@@ -116,24 +116,24 @@ for D in (:Forward, :Backward, :Central)
116116
end
117117

118118
@doc """
119-
FDM.$($(Meta.quot(D)))(p, q; kwargs...)
119+
FiniteDifferences.$($(Meta.quot(D)))(p, q; kwargs...)
120120
$($(Meta.quot(fdmf)))(p, q; kwargs...)
121121
122122
Construct a $($lcname) finite difference method of order `p` to compute the `q`th
123123
derivative.
124-
See [`FDMethod`](@ref) for more details.
124+
See [`FiniteDifferenceMethod`](@ref) for more details.
125125
"""
126126
($D, $fdmf)
127127
end
128128
end
129129

130130
"""
131-
FDM.Nonstandard(grid, q; kwargs...)
131+
FiniteDifferences.Nonstandard(grid, q; kwargs...)
132132
133133
An finite differencing method which is constructed based on a user-defined grid. It is
134134
nonstandard in the sense that it represents neither forward, backward, nor central
135135
differencing.
136-
See [`FDMethod`](@ref) for further details.
136+
See [`FiniteDifferenceMethod`](@ref) for further details.
137137
"""
138138
function Nonstandard(grid::AbstractVector{<:Real}, q::Integer; adapt=0, kwargs...)
139139
p = length(grid)
@@ -166,8 +166,8 @@ end
166166
_estimate_bound(x, cond) = cond * maximum(abs, x) + TINY
167167

168168
"""
169-
fdm(m::FDMethod, f, x[, Val(false)]; kwargs...) -> Real
170-
fdm(m::FDMethod, f, x, Val(true); kwargs...) -> Tuple{FDMethod, Real}
169+
fdm(m::FiniteDifferenceMethod, f, x[, Val(false)]; kwargs...) -> Real
170+
fdm(m::FiniteDifferenceMethod, f, x, Val(true); kwargs...) -> Tuple{FiniteDifferenceMethod, Real}
171171
172172
Compute the derivative of `f` at `x` using the finite differencing method `m`.
173173
The optional `Val` argument dictates whether the method should be returned alongside the
@@ -186,7 +186,7 @@ The recognized keywords are:
186186
`adapt` greater than 0 when `m::Nonstandard` results in an error.
187187
188188
!!! note
189-
Calling [`FDMethod`](@ref) objects is equivalent to passing them to `fdm`.
189+
Calling [`FiniteDifferenceMethod`](@ref) objects is equivalent to passing them to `fdm`.
190190
191191
# Examples
192192
@@ -195,7 +195,7 @@ julia> fdm(central_fdm(5, 1), sin, 1; adapt=2)
195195
0.5403023058681039
196196
197197
julia> fdm(central_fdm(2, 1), exp, 0, Val(true))
198-
(FDMethod:
198+
(FiniteDifferenceMethod:
199199
order of method: 2
200200
order of derivative: 1
201201
grid: [-1, 1]
@@ -217,7 +217,7 @@ function fdm(
217217
eps=(Base.eps(float(bound)) + TINY),
218218
adapt=m.history.adapt,
219219
max_step=0.1,
220-
) where M<:FDMethod
220+
) where M<:FiniteDifferenceMethod
221221
if M <: Nonstandard && adapt > 0
222222
throw(ArgumentError("can't adaptively compute bounds over Nonstandard grids"))
223223
end
@@ -265,7 +265,7 @@ function fdm(
265265
return m, dfdx
266266
end
267267

268-
function fdm(m::FDMethod, f, x, ::Val{false}=Val(false); kwargs...)
268+
function fdm(m::FiniteDifferenceMethod, f, x, ::Val{false}=Val(false); kwargs...)
269269
_, dfdx = fdm(m, f, x, Val(true); kwargs...)
270270
return dfdx
271271
end

test/grad.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
using FDM: grad, jacobian, _jvp, _j′vp, jvp, j′vp, to_vec
1+
using FiniteDifferences: grad, jacobian, _jvp, _j′vp, jvp, j′vp, to_vec
22

33
# Dummy type where length(x::DummyType) ≠ length(first(to_vec(x)))
44
struct DummyType{TX<:Matrix}
55
X::TX
66
end
77

8-
function FDM.to_vec(x::DummyType)
8+
function FiniteDifferences.to_vec(x::DummyType)
99
x_vec, back = to_vec(x.X)
1010
return x_vec, x_vec -> DummyType(back(x_vec))
1111
end

test/methods.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using FDM: Forward, Backward, Central, Nonstandard
1+
using FiniteDifferences: Forward, Backward, Central, Nonstandard
22

33
@testset "Methods" begin
44
for f in [:forward_fdm, :backward_fdm, :central_fdm]
@@ -25,9 +25,9 @@ using FDM: Forward, Backward, Central, Nonstandard
2525
@test central_fdm(5, 1)(abs, 0.001) 1.0
2626
end
2727

28-
@testset "Printing FDMethods" begin
28+
@testset "Printing FiniteDifferenceMethods" begin
2929
@test sprint(show, central_fdm(2, 1)) == """
30-
FDMethod:
30+
FiniteDifferenceMethod:
3131
order of method: 2
3232
order of derivative: 1
3333
grid: [-1, 1]
@@ -39,7 +39,7 @@ using FDM: Forward, Backward, Central, Nonstandard
3939
regex_array = r"\[([\d.+-e]+(, )?)+\]"
4040
@test occursin(Regex(join(map(x -> x.pattern,
4141
[
42-
r"FDMethod:",
42+
r"FiniteDifferenceMethod:",
4343
r"order of method:", r"\d+",
4444
r"order of derivative:", r"\d+",
4545
r"grid:", regex_array,

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using FDM, Test, Random, Printf, LinearAlgebra
1+
using FiniteDifferences, Test, Random, Printf, LinearAlgebra
22

3-
@testset "FDM" begin
3+
@testset "FiniteDifferences" begin
44
include("methods.jl")
55
include("numerics.jl")
66
include("grad.jl")

0 commit comments

Comments
 (0)