Skip to content

Commit c4d548a

Browse files
authored
Explicitly declare used functions/types from dependencies (#84)
1 parent ba02734 commit c4d548a

File tree

4 files changed

+13
-10
lines changed

4 files changed

+13
-10
lines changed

src/Loggers/LogHistograms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function histogram_summary(name::AbstractString, edges::AbstractVector{<:Number}
4545
return histogram_summary(name, Histogram(edges, hist_vals))
4646
end
4747

48-
function histogram_summary(name::AbstractString, hist::StatsBase.Histogram{T,1}) where T
48+
function histogram_summary(name::AbstractString, hist::Histogram{T,1}) where T
4949
edges = first(hist.edges)
5050
hist_vals = hist.weights
5151

src/PNG.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
module PNGImage
33

44
using FileIO: @format_str, Stream, save
5-
using ImageCore: Colorant, Gray, GrayA, RGB, RGBA
5+
using ColorTypes: Colorant, Gray, GrayA, RGB, RGBA
66
using FixedPointNumbers: Normed
77

88
export PngImage, png_color_T

src/TensorBoardLogger.jl

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
module TensorBoardLogger
22

3-
using ProtoBuf, CRC32c
3+
using ProtoBuf: readproto, writeproto, ProtoType
4+
using CRC32c
5+
6+
using ImageCore: colorview, channelview
7+
using ColorTypes: Colorant, Gray, GrayA, RGB, RGBA
8+
using FileIO: FileIO, @format_str, Stream, save, load
49

510
# hasproperty is not defined before 1.2. This is Compat.hasproperty
611
if VERSION < v"1.2.0-DEV.272"
712
using ProtoBuf: hasproperty
813
end
914

10-
using ImageCore, ColorTypes
11-
using FileIO: FileIO, @format_str, Stream, save, load
12-
13-
using StatsBase #TODO: remove this. Only needed to compute histogram bins.
15+
#TODO: Is there a more lightweight package for compmuting an histogram?
16+
using StatsBase: Histogram, fit
1417

1518
using Base.CoreLogging: CoreLogging, AbstractLogger, LogLevel, Info,
1619
handle_message, shouldlog, min_enabled_level, catch_exceptions

src/logger_dispatch.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ end
5050
## Default behaviours
5151

5252
########## For things going to LogImage ##############################
53-
function preprocess(name, img::AbstractArray{<:Colorant}, data)
53+
function preprocess(name, img::AbstractArray{<:Colorant}, data)
5454
# If it has three dimensions (and we don't have 3D monitors) we log several
5555
# 2D slices under the same tag so that TB shows a slider along the z direction.
5656
dimensions = ndims(img)
@@ -76,8 +76,8 @@ summary_impl(name, value::Any) = text_summary(name, value)
7676

7777
########## For things going to LogHistograms ########################
7878
# Only consider 1D histograms for histogram plotting
79-
preprocess(name, hist::StatsBase.Histogram{T,1}, data) where T = push!(data, name=>hist)
80-
summary_impl(name, hist::StatsBase.Histogram) = histogram_summary(name, hist)
79+
preprocess(name, hist::Histogram{T,1}, data) where T = push!(data, name=>hist)
80+
summary_impl(name, hist::Histogram) = histogram_summary(name, hist)
8181

8282
# TODO: maybe deprecate? tuple means histogram (only if bins/weights match)
8383
function preprocess(name, (bins,weights)::Tuple{AbstractVector,AbstractVector}, data)

0 commit comments

Comments
 (0)