Skip to content

Commit bfcdb13

Browse files
committed
addsigs
1 parent c6c0a4b commit bfcdb13

6 files changed

Lines changed: 665 additions & 17 deletions

File tree

docs/src/modules.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Modules
22

3-
[Abundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Abundant.jl)   🔶  [AndreNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/AndreNumbers.jl)   🔶  [BellNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BellNumbers.jl)   🔶  [BernoulliNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BernoulliNumbers.jl)   🔶  [BinaryInteger](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryInteger.jl)   🔶  [BinaryQF](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryQF.jl)   🔶  [CarmichaelNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CarmichaelNumbers.jl)   🔶  [ClausenNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ClausenNumbers.jl)   🔶  [CombinationsIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CombinationsIterator.jl)   🔶  [Compositions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Compositions.jl)   🔶  [Counts](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Counts.jl)   🔶  [DedekindEta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/DedekindEta.jl)   🔶  [Deleham](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Deleham.jl)   🔶  [Fibonacci](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Fibonacci.jl)   🔶  [FigurativeNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/FigurativeNumbers.jl)   🔶  [GaussFactorialRecords](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GaussFactorialRecords.jl)   🔶  [GeneralizedBinomial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GeneralizedBinomial.jl)   🔶  [HighlyAbundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/HighlyAbundant.jl)   🔶  [Hyper1F1](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Hyper1F1.jl)   🔶  [JacobiTheta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/JacobiTheta.jl)   🔶  [Kolakoski](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Kolakoski.jl)   🔶  [NarayanaCows](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NarayanaCows.jl)   🔶  [NumberTheory](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NumberTheory.jl)   🔶  [OEISUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OEISUtils.jl)   🔶  [OrthoPolynomials](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OrthoPolynomials.jl)   🔶  [Partitions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Partitions.jl)   🔶  [PrimesIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimesIterator.jl)   🔶  [PrimeSwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimeSwingFactorial.jl)   🔶  [Products](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Products.jl)   🔶  [QueensProblems](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/QueensProblems.jl)   🔶  [RecordSearch](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RecordSearch.jl)   🔶  [RiordanSquares](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RiordanSquares.jl)   🔶  [SelfConvolutive](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SelfConvolutive.jl)   🔶  [SeqUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeqUtils.jl)   🔶  [SeriesExpansion](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeriesExpansion.jl)   🔶  [StirlingLahNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/StirlingLahNumbers.jl)   🔶  [SwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SwingFactorial.jl)   🔶  [Triangles](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Triangles.jl)   🔶  [UlamNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/UlamNumbers.jl)   🔶  [ZumkellerNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ZumkellerNumbers.jl)   🔶  
3+
[Abundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Abundant.jl)   🔶  [AndreNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/AndreNumbers.jl)   🔶  [BellNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BellNumbers.jl)   🔶  [BernoulliNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BernoulliNumbers.jl)   🔶  [BinaryInteger](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryInteger.jl)   🔶  [BinaryQF](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/BinaryQF.jl)   🔶  [CarmichaelNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CarmichaelNumbers.jl)   🔶  [ClausenNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ClausenNumbers.jl)   🔶  [CombinationsIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/CombinationsIterator.jl)   🔶  [Compositions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Compositions.jl)   🔶  [Counts](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Counts.jl)   🔶  [DedekindEta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/DedekindEta.jl)   🔶  [Deleham](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Deleham.jl)   🔶  [Fibonacci](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Fibonacci.jl)   🔶  [FigurativeNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/FigurativeNumbers.jl)   🔶  [GaussFactorialRecords](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GaussFactorialRecords.jl)   🔶  [GeneralizedBinomial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/GeneralizedBinomial.jl)   🔶  [HighlyAbundant](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/HighlyAbundant.jl)   🔶  [Hyper1F1](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Hyper1F1.jl)   🔶  [JacobiTheta](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/JacobiTheta.jl)   🔶  [Kolakoski](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Kolakoski.jl)   🔶  [NarayanaCows](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NarayanaCows.jl)   🔶  [NumberTheory](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/NumberTheory.jl)   🔶  [OEISUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OEISUtils.jl)   🔶  [OrthoPolynomials](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/OrthoPolynomials.jl)   🔶  [Partitions](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Partitions.jl)   🔶  [PrimesIterator](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimesIterator.jl)   🔶  [PrimeSwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/PrimeSwingFactorial.jl)   🔶  [Products](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Products.jl)   🔶  [QueensProblems](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/QueensProblems.jl)   🔶  [RecordSearch](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RecordSearch.jl)   🔶  [RiordanSquares](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/RiordanSquares.jl)   🔶  [SelfConvolutive](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SelfConvolutive.jl)   🔶  [SeqUtils](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeqUtils.jl)   🔶  [SeriesExpansion](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SeriesExpansion.jl)   🔶  [StirlingLahNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/StirlingLahNumbers.jl)   🔶  [SwingFactorial](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/SwingFactorial.jl)   🔶  [S_INDEX](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/S_INDEX.jl)   🔶  [Triangles](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/Triangles.jl)   🔶  [UlamNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/UlamNumbers.jl)   🔶  [ZumkellerNumbers](https://github.com/OpenLibMathSeq/Sequences.jl/blob/master/src/ZumkellerNumbers.jl)   🔶  

src/BuildSequences.jl

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,13 +186,13 @@ function build_seq(docdefs)
186186

187187
tmp = open("_TEMP.jl", "r")
188188
sor = open("S_INDEX.jl", "r")
189-
target = joinpath(srcdir, "Sequences.jl")
189+
target = joinpath(srcdir, "_Sequences.jl")
190190
olm = open(target, "w")
191191
header(olm)
192192
println(olm, "__precompile__()")
193193

194194
println(olm, "module Sequences")
195-
println(olm, "using Nemo, IterTools, HTTP")
195+
println(olm, "using Nemo, IterTools, HTTP, DocStringExtensions")
196196

197197
for l in eachline(sor, keep=true)
198198
print(olm, l)
@@ -282,6 +282,11 @@ function build_perf()
282282
o = open(path, "w")
283283

284284
header(o)
285+
println(o, "tstdir = realpath(joinpath(dirname(@__FILE__)))")
286+
println(o, "srcdir = joinpath(dirname(tstdir), \"src\")")
287+
println(o, "tstdir ∉ LOAD_PATH && push!(LOAD_PATH, tstdir)")
288+
println(o, "srcdir ∉ LOAD_PATH && push!(LOAD_PATH, srcdir)")
289+
285290
println(o, "module perftests")
286291
println(o, "using Sequences, Dates, InteractiveUtils")
287292

@@ -377,8 +382,63 @@ function make_modules()
377382
close(ind)
378383
end
379384

385+
function nextline(srcfile)
386+
387+
while !eof(srcfile)
388+
n = readline(srcfile)
389+
n == "" && continue
390+
# startswith(n, "#") && continue
391+
return n
392+
end
393+
return nothing
394+
end
395+
396+
function addsig(srcfile, docfile)
397+
398+
while true
399+
400+
n = nextline(srcfile)
401+
n == nothing && return
402+
while ! startswith(n, "\"\"\"")
403+
println(docfile, n)
404+
n = nextline(srcfile)
405+
n == nothing && return
406+
end
407+
408+
if startswith(n, "\"\"\"")
409+
println(docfile, n)
410+
n = nextline(srcfile)
411+
n == nothing && return
412+
while ! startswith(n, "\"\"\"")
413+
println(docfile, n)
414+
n = nextline(srcfile)
415+
n == nothing && return
416+
end
417+
418+
println(docfile, "\$(SIGNATURES)")
419+
println(docfile, n)
420+
end
421+
end
422+
end
423+
424+
function addsignature()
425+
426+
docdir = realpath(joinpath(dirname(@__FILE__)))
427+
pkgdir = dirname(docdir)
428+
srcdir = joinpath(pkgdir, "src")
429+
srcfile = open(joinpath(srcdir, "_Sequences.jl"), "r")
430+
docfile = open(joinpath(docdir, "Sequences.jl"), "w")
431+
432+
addsig(srcfile, docfile)
433+
434+
close(srcfile)
435+
close(docfile)
436+
rm("_Sequences.jl")
437+
end
438+
380439
function build_all(docdefs=false)
381440
build_seq(docdefs)
441+
addsignature()
382442

383443
build_test()
384444
build_perf()

0 commit comments

Comments
 (0)