Skip to content

Commit 39223ba

Browse files
authored
Use IrrationalConstants and do not export logarithmic constants (#22)
1 parent 1e96ec8 commit 39223ba

File tree

8 files changed

+46
-26
lines changed

8 files changed

+46
-26
lines changed

Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
name = "LogExpFunctions"
22
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
33
authors = ["StatsFun.jl contributors, Tamas K. Papp <[email protected]>"]
4-
version = "0.2.5"
4+
version = "0.3.0"
55

66
[deps]
77
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
8+
IrrationalConstants = "92d709cd-6900-40b7-9082-c6be49f344b6"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910

1011
[compat]
1112
DocStringExtensions = "0.8"
13+
IrrationalConstants = "0.1"
1214
julia = "1"
1315

1416
[extras]

docs/Manifest.toml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,25 @@ version = "0.8.5"
1515

1616
[[Documenter]]
1717
deps = ["Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
18-
git-tree-sha1 = "5acbebf1be22db43589bc5aa1bb5fcc378b17780"
18+
git-tree-sha1 = "47f13b6305ab195edb73c86815962d84e31b0f48"
1919
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
20-
version = "0.27.0"
20+
version = "0.27.3"
2121

2222
[[IOCapture]]
23-
deps = ["Logging"]
24-
git-tree-sha1 = "1868e4e7ad2f93d8de0904d89368c527b46aa6a1"
23+
deps = ["Logging", "Random"]
24+
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
2525
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
26-
version = "0.2.1"
26+
version = "0.2.2"
2727

2828
[[InteractiveUtils]]
2929
deps = ["Markdown"]
3030
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
3131

32+
[[IrrationalConstants]]
33+
git-tree-sha1 = "f76424439413893a832026ca355fe273e93bce94"
34+
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
35+
version = "0.1.0"
36+
3237
[[JSON]]
3338
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
3439
git-tree-sha1 = "81690084b6198a2e1da36fcfda16eeca9f9f24e4"
@@ -39,6 +44,19 @@ version = "0.21.1"
3944
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
4045
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
4146

47+
[[Libdl]]
48+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
49+
50+
[[LinearAlgebra]]
51+
deps = ["Libdl"]
52+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
53+
54+
[[LogExpFunctions]]
55+
deps = ["DocStringExtensions", "IrrationalConstants", "LinearAlgebra"]
56+
path = ".."
57+
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
58+
version = "0.3.0"
59+
4260
[[Logging]]
4361
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
4462

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
34

45
[compat]
5-
Documenter = "~0.26, 0.27"
6+
Documenter = "0.27"
7+
LogExpFunctions = "0.3"

docs/make.jl

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
using Documenter, LogExpFunctions
22

3-
makedocs(
4-
modules = [LogExpFunctions],
5-
format = Documenter.HTML(),
6-
checkdocs = :exports,
7-
sitename = "LogExpFunctions.jl",
8-
pages = Any["index.md"]
3+
# Doctest setup
4+
DocMeta.setdocmeta!(
5+
LogExpFunctions, :DocTestSetup, :(using LogExpFunctions); recursive=true
96
)
107

11-
deploydocs(
12-
repo = "github.com/JuliaStats/LogExpFunctions.jl.git",
8+
makedocs(;
9+
modules=[LogExpFunctions],
10+
format=Documenter.HTML(),
11+
sitename="LogExpFunctions.jl",
12+
pages=Any["index.md"],
13+
checkdocs=:exports,
14+
strict=true,
1315
)
16+
17+
deploydocs(; repo="github.com/JuliaStats/LogExpFunctions.jl.git")

docs/src/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ logexpm1
1717
log1pmx
1818
logmxp1
1919
logaddexp
20+
logsubexp
2021
logsumexp
2122
softmax!
2223
softmax

src/LogExpFunctions.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
module LogExpFunctions
22

33
using DocStringExtensions: SIGNATURES
4-
using Base: Math.@horner, @irrational
4+
using Base: Math.@horner
5+
6+
import IrrationalConstants
57
import LinearAlgebra
68

7-
export loghalf, logtwo, logπ, log2π, log4π
89
export xlogx, xlogy, logistic, logit, log1psq, log1pexp, log1mexp, log2mexp, logexpm1,
910
softplus, invsoftplus, log1pmx, logmxp1, logaddexp, logsubexp, logsumexp, softmax,
1011
softmax!
1112

12-
include("constants.jl")
1313
include("basicfuns.jl")
1414
include("logsumexp.jl")
1515

src/basicfuns.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ See:
116116
117117
Note: different than Maechler (2012), no negation inside parentheses
118118
"""
119-
log1mexp(x::Real) = x < loghalf ? log1p(-exp(x)) : log(-expm1(x))
119+
log1mexp(x::Real) = x < IrrationalConstants.loghalf ? log1p(-exp(x)) : log(-expm1(x))
120120

121121
"""
122122
$(SIGNATURES)

src/constants.jl

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)