diff --git a/Project.toml b/Project.toml index 46eb110..32eda20 100644 --- a/Project.toml +++ b/Project.toml @@ -21,16 +21,16 @@ Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2" StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91" [compat] -CSV = "0.8, 0.9" +CSV = "0.8 - 0.10" CodecZlib = "0.7" ColorSchemes = "3" -DataFrames = "1.2" -DataFramesMeta = "0.7, 0.8, 0.9" +DataFrames = "1.2 - 1.3" +DataFramesMeta = "0.7 - 0.11" Distributions = "0.23, 0.25" HypothesisTests = "0.10" -Optim = "1.3" -Plots = "1.15" -PrettyTables = "1.1" -RecipesBase = "1.1" +Optim = "^1.3" +Plots = "^1.15" +PrettyTables = "^1.1" +RecipesBase = "^1.1" StatsBase = "0.33" -julia = "1.5" +julia = "1.5 - 1.7" diff --git a/src/datasets.jl b/src/datasets.jl index 372eb37..f52b9f2 100644 --- a/src/datasets.jl +++ b/src/datasets.jl @@ -105,7 +105,7 @@ function seaborne(full::Bool = false) sb_df = open(joinpath(path, "seaborne.csv.gz")) do file CSV.read(GzipDecompressorStream(file),DataFrame, dateformat = "mm/dd/yyyy HH:MM:SS pp", - types = Dict(:year => Date)) + types = Dict(:date => Date)) end if full diff --git a/test/Project.toml b/test/Project.toml index cde2285..67aa345 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -1,5 +1,9 @@ [deps] +DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" +Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" +Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f" Forecast = "6efb3b9f-b065-4dd1-b1a5-fac2350e161b" Logging = "56ddb016-857b-54e1-b83d-db4d58db5568" +Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/loess.jl b/test/loess.jl index 53d2633..6ceeef3 100644 --- a/test/loess.jl +++ b/test/loess.jl @@ -11,10 +11,10 @@ using Forecast @test length(x) == 20 x = loess(sin.(collect(1:10.)), sin.(collect(1:10.)); d=2) - @test x == [0.8414709848078965, 0.9092974268256817, 0.14112000805986716, -0.7568024953079282, -0.9589242746631381, -0.2794154981989261, 0.6569865987187891, 0.9893582466233829, 0.4121184852417571, -0.5440211108893702] + @test x ≈ [0.8414709848078965, 0.9092974268256817, 0.14112000805986716, -0.7568024953079282, -0.9589242746631381, -0.2794154981989261, 0.6569865987187891, 0.9893582466233829, 0.4121184852417571, -0.5440211108893702] x = loess(sin.(collect(1:10.)), sin.(collect(1:10.)); d=1) - @test x == [0.8414709848078965, 0.9092974268256815, 0.14112000805986719, -0.7568024953079282, -0.9589242746631382, -0.2794154981989259, 0.6569865987187891, 0.9893582466233817, 0.41211848524175654, -0.5440211108893699] + @test x ≈ [0.8414709848078965, 0.9092974268256815, 0.14112000805986719, -0.7568024953079282, -0.9589242746631382, -0.2794154981989259, 0.6569865987187891, 0.9893582466233817, 0.41211848524175654, -0.5440211108893699] x = loess(Int64.(round.(100*rand(100))), Int64.(round.(100*rand(100))); predict = Int64.(round.(100*rand(20)))) diff --git a/test/plots.jl b/test/plots.jl index 40e4c93..4cc6852 100644 --- a/test/plots.jl +++ b/test/plots.jl @@ -1,6 +1,6 @@ using Test using Forecast -using Plots, RecipesBase +using Plots @testset "plots" begin diff --git a/test/stl.jl b/test/stl.jl index 56f6d0c..d2ff833 100644 --- a/test/stl.jl +++ b/test/stl.jl @@ -11,8 +11,10 @@ using Forecast @test x.call isa String x = stl(co2(),365; robust=true, spm=true) - @test Array(x.decomposition[1:5,:]) == - Any[Date("1974-05-17") 3.3336092113804625 330.03520225817715 0.011188530442382216; Date("1974-05-18") 3.2974595453530924 330.0378212346287 -0.22528077998180152; Date("1974-05-19") 3.2594500979279815 330.0404399841902 0.16010991788181173; Date("1974-05-20") 3.219714340570647 330.043058508077 0.3772271513523151; Date("1974-05-21") 3.178405197122059 330.0456768071629 0.1859179957150463] + @test x.decomposition[1:5,1] == + [Date("1974-05-17"), Date("1974-05-18"), Date("1974-05-19"), Date("1974-05-20"), Date("1974-05-21")] + @test Matrix(x.decomposition[1:5,2:end]) ≈ + [3.3336092113804625 330.03520225817715 0.011188530442382216; 3.2974595453530924 330.0378212346287 -0.22528077998180152; 3.2594500979279815 330.0404399841902 0.16010991788181173; 3.219714340570647 330.043058508077 0.3772271513523151; 3.178405197122059 330.0456768071629 0.1859179957150463] end