Skip to content

Commit 72e13e7

Browse files
committed
Cleanup imports with ExplicitImports.jl
TL;DR: - Replaced all uses of `using` with explicit imports - Removed old imports
1 parent 070b608 commit 72e13e7

12 files changed

+28
-37
lines changed

Diff for: ext/GraphVizExt.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99
import Dagger
1010
import Dagger: EagerThunk, Chunk, Processor
1111
import Dagger.TimespanLogging: Timespan
12-
using Dagger.Graphs
12+
import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, vertices, is_directed, edges, nv
1313

1414
function pretty_time(t; digits=3)
1515
r(t) = round(t; digits)

Diff for: src/Dagger.jl

+16-10
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
module Dagger
22

3-
using Distributed, SharedArrays, Serialization
3+
import Serialization
4+
import Serialization: AbstractSerializer, serialize, deserialize
5+
import SparseArrays: sprand, SparseMatrixCSC
46

5-
using MemPool
7+
import MemPool
8+
import MemPool: DRef, FileRef, poolget, poolset
69

7-
import Base: collect, adjoint, reduce
8-
import Distributed: procs
10+
import Base: collect, reduce
11+
import Distributed
12+
import Distributed: Future, RemoteChannel, myid, workers, nworkers, procs, remotecall, remotecall_wait, remotecall_fetch
913

10-
using LinearAlgebra
11-
import LinearAlgebra: transpose
14+
import LinearAlgebra
15+
import LinearAlgebra: Adjoint, BLAS, Diagonal, LAPACK, LowerTriangular, PosDefException, Transpose, UpperTriangular, diagind, ishermitian, issymmetric
1216

13-
using UUIDs
17+
import UUIDs: UUID, uuid4
1418

1519
if !isdefined(Base, :ScopedValues)
1620
import ScopedValues: ScopedValue, with
@@ -22,15 +26,17 @@ if !isdefined(Base, :get_extension)
2226
using Requires
2327
end
2428

25-
using MacroTools
26-
using TimespanLogging
29+
import TimespanLogging
30+
import TimespanLogging: timespan_start, timespan_finish
2731

2832
include("lib/util.jl")
2933
include("utils/dagdebug.jl")
3034

3135
# Distributed data
3236
include("utils/locked-object.jl")
3337
include("utils/tasks.jl")
38+
39+
import MacroTools: @capture
3440
include("options.jl")
3541
include("processor.jl")
3642
include("threadproc.jl")
@@ -85,7 +91,7 @@ include("utils/logging-events.jl")
8591
include("utils/logging.jl")
8692

8793
# Precompilation
88-
using PrecompileTools
94+
import PrecompileTools: @compile_workload
8995
include("precompile.jl")
9096

9197
function __init__()

Diff for: src/array/alloc.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import Base: cat
2-
using SparseArrays, Random
3-
import SparseArrays: sprand
2+
import Random: MersenneTwister
43
export partition
54

65
mutable struct AllocateArray{T,N} <: ArrayOp{T,N}

Diff for: src/array/darray.jl

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
import Base: ==, fetch
2-
using Serialization
3-
import Serialization: serialize, deserialize
42

53
###### Array Domains ######
64

Diff for: src/array/indexing.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using TaskLocalValues
1+
import TaskLocalValues: TaskLocalValue
22

33
### getindex
44

Diff for: src/array/operators.jl

-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
import Base: exp, expm1, log, log10, log1p, sqrt, cbrt, exponent,
2-
significand, sin, sinpi, cos, cospi, tan, sec, cot, csc,
3-
sinh, cosh, tanh, coth, sech, csch,
4-
asin, acos, atan, acot, asec, acsc,
5-
asinh, acosh, atanh, acoth, asech, acsch, sinc, cosc,
6-
+, -, %, &, *
7-
81
import Base: broadcast
92
import Base: Broadcast
103
import Base.Broadcast: Broadcasted, BroadcastStyle, combine_eltypes

Diff for: src/array/sort.jl

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import Base.Sort: Forward, Ordering, Algorithm, lt
2-
using Distributed
1+
import Base.Sort: Forward, Ordering, lt
2+
import SharedArrays: SharedArray
33

4-
using StatsBase
4+
import StatsBase: fit!, sample
55

66

77
function getmedians(x, n)

Diff for: src/array/sparse_partition.jl

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
export partition_sparse
2-
using SparseArrays
32

43
function partition_sparse(colptr, nnz, sz, nparts)
54
nnz_per_chunk = nnz/nparts

Diff for: src/chunks.jl

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using Serialization
2-
31
export domain, UnitDomain, project, alignfirst, ArrayDomain
42

53
import Base: isempty, getindex, intersect, ==, size, length, ndims

Diff for: src/datadeps.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using Graphs
1+
import Graphs: SimpleDiGraph, add_edge!, add_vertex!, inneighbors, outneighbors, nv
22

33
export In, Out, InOut, spawn_datadeps
44

Diff for: src/sch/Sch.jl

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
module Sch
22

3-
using Distributed
3+
import Distributed: Future, ProcessExitedException, RemoteChannel, RemoteException, myid, remote_do, remotecall_fetch, remotecall_wait, workers
44
import MemPool
55
import MemPool: DRef, StorageResource
6-
import MemPool: poolset, storage_available, storage_capacity, storage_utilized, externally_varying
7-
import Statistics: mean
6+
import MemPool: poolset, storage_capacity, storage_utilized
87
import Random: randperm
98
import Base: @invokelatest
109

1110
import ..Dagger
1211
import ..Dagger: Context, Processor, Thunk, WeakThunk, ThunkFuture, ThunkFailedException, Chunk, WeakChunk, OSProc, AnyScope, DefaultScope, LockedObject
13-
import ..Dagger: order, dependents, noffspring, istask, inputs, unwrap_weak_checked, affinity, tochunk, timespan_start, timespan_finish, procs, move, chunktype, processor, default_enabled, get_processors, get_parent, execute!, rmprocs!, addprocs!, thunk_processor, constrain, cputhreadtime
12+
import ..Dagger: order, dependents, noffspring, istask, inputs, unwrap_weak_checked, affinity, tochunk, timespan_start, timespan_finish, procs, move, chunktype, processor, get_processors, get_parent, execute!, rmprocs!, thunk_processor, constrain, cputhreadtime
1413
import ..Dagger: @dagdebug, @safe_lock_spin1
1514
import DataStructures: PriorityQueue, enqueue!, dequeue_pair!, peek
1615

@@ -1473,7 +1472,7 @@ function do_task(to_proc, task_desc)
14731472
break
14741473
end
14751474
if est_alloc_util + real_alloc_util > storage_cap
1476-
if externally_varying(to_storage)
1475+
if MemPool.externally_varying(to_storage)
14771476
debug_storage("WARN: Insufficient space and allocation behavior is externally varying on $to_storage_name, proceeding anyway")
14781477
break
14791478
end

Diff for: src/utils/logging-events.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ module Events
33
import ..Dagger
44
import ..Dagger: Context, Chunk
55

6-
using ..TimespanLogging
6+
import ..TimespanLogging
77
import .TimespanLogging: Event, init_similar
8-
import .TimespanLogging.Events: EventSaturation
98

109
TimespanLogging.log_sink(ctx::Context) = ctx.log_sink
1110
TimespanLogging.profile(ctx::Context, category, id, tl) =

0 commit comments

Comments
 (0)