Skip to content

Commit 27e0161

Browse files
authored
Merge pull request #111 from mschauer/workload
Prevent namespace pollution from workload
2 parents 88c70df + df57bb4 commit 27e0161

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

src/workloads.jl

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
using PrecompileTools
22

33
@setup_workload begin
4-
N = 200 # number of data points
5-
64
# define simple linear model with added noise
7-
x = randn(N)
8-
v = x + randn(N)*0.25
9-
w = x + randn(N)*0.25
10-
z = v + w + randn(N)*0.25
11-
s = z + randn(N)*0.25
12-
13-
df = (x=x, v=v, w=w, z=z, s=s)
14-
@compile_workload begin
15-
ges(df; penalty=1.0, parallel=false)
16-
pcalg(df, 0.01, gausscitest; stable=false)
5+
df___ = let N = 200 # number of data points
6+
x = randn(N)
7+
v = x + randn(N)*0.25
8+
w = x + randn(N)*0.25
9+
z = v + w + randn(N)*0.25
10+
s = z + randn(N)*0.25
11+
(x=x, v=v, w=w, z=z, s=s)
12+
end
13+
@compile_workload begin
14+
ges(df___; penalty=1.0, parallel=false)
15+
pcalg(df___, 0.01, gausscitest; stable=false)
1716
end
1817

19-
dag = digraph([1 => 3, 3 => 6, 2 => 5, 5 => 8, 6 => 7, 7 => 8, 1 => 4, 2 => 4, 4 => 6, 4 => 8])
18+
dag__ = digraph([1 => 3, 3 => 6, 2 => 5, 5 => 8, 6 => 7, 7 => 8, 1 => 4, 2 => 4, 4 => 6, 4 => 8])
2019

2120
@compile_workload begin
22-
dsep(dag, 6, 8, 1)
23-
collect(list_covariate_adjustment(dag, 6, 8, Int[], setdiff(Set(1:8), [1, 2])))
21+
dsep(dag__, 6, 8, 1)
22+
collect(list_covariate_adjustment(dag__, 6, 8, Int[], setdiff(Set(1:8), [1, 2])))
2423
end
2524
end

0 commit comments

Comments
 (0)