Skip to content

Commit 536ff58

Browse files
committed
fix docs
1 parent 8d43615 commit 536ff58

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

docs/make.jl

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ using Documenter, Literate
55
using Pkg
66

77
# Literate Examples
8+
const DRAFT = get(ENV, "DRAFT", "false") == "true"
9+
@show DRAFT
810
const EXAMPLE_DIR = pkgdir(TensorInference, "examples")
911
const LITERATE_GENERATED_DIR = pkgdir(TensorInference, "docs", "src", "generated")
1012
mkpath(LITERATE_GENERATED_DIR)
@@ -19,7 +21,7 @@ for each in readdir(EXAMPLE_DIR)
1921
# build
2022
input_file = joinpath(workdir, "main.jl")
2123
@info "building" input_file
22-
Literate.markdown(input_file, workdir; execute=true)
24+
Literate.markdown(input_file, workdir; execute=!DRAFT)
2325
# restore environment
2426
# Pkg.activate(Pkg.PREV_ENV_PATH[])
2527
end
@@ -30,7 +32,7 @@ for each in EXTRA_JL
3032
cp(joinpath(SRC_DIR, each), joinpath(LITERATE_GENERATED_DIR, each); force=true)
3133
input_file = joinpath(LITERATE_GENERATED_DIR, each)
3234
@info "building" input_file
33-
Literate.markdown(input_file, LITERATE_GENERATED_DIR; execute=true)
35+
Literate.markdown(input_file, LITERATE_GENERATED_DIR; execute=!DRAFT)
3436
end
3537

3638
DocMeta.setdocmeta!(TensorInference, :DocTestSetup, :(using TensorInference); recursive=true)
@@ -68,6 +70,7 @@ makedocs(;
6870
],
6971
doctest = false,
7072
warnonly = :missing_docs,
73+
draft = DRAFT,
7174
)
7275

7376
deploydocs(;

src/TensorInference.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using ProblemReductions
1919
import Pkg
2020

2121
# reexport OMEinsum functions
22-
export RescaledArray, rescale_array
22+
export RescaledArray
2323
export contraction_complexity, TreeSA, GreedyMethod, KaHyParBipartite, HyperND, SABipartite, MergeGreedy, MergeVectors, TreeSASlicer, ScoreFunction
2424

2525
# read and load uai files

test/RescaledArray.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ using OMEinsum
1919
# Test rescale_array function
2020
@testset "rescale_array" begin
2121
T = [1.0 2.0; 3.0 4.0]
22-
r = rescale_array(T)
22+
r = TensorInference.rescale_array(T)
2323

2424
# Maximum absolute value should be 1 in normalized_value
2525
@test maximum(abs, r.normalized_value) 1.0
@@ -29,7 +29,7 @@ using OMEinsum
2929

3030
# Test with zero array
3131
zero_T = zeros(2, 2)
32-
r_zero = rescale_array(zero_T)
32+
r_zero = TensorInference.rescale_array(zero_T)
3333
@test r_zero.log_factor == 0.0
3434
@test r_zero.normalized_value == zero_T
3535
end

0 commit comments

Comments
 (0)