Skip to content

Commit

Permalink
compat julia, CSV, DataFrames, Optim, Plots, PrettyTables
Browse files Browse the repository at this point in the history
  • Loading branch information
gustafsson committed Jul 4, 2022
1 parent db10ae1 commit 083de40
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 14 deletions.
16 changes: 8 additions & 8 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion src/datasets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
4 changes: 2 additions & 2 deletions test/loess.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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))))
Expand Down
2 changes: 1 addition & 1 deletion test/plots.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Test
using Forecast
using Plots, RecipesBase
using Plots

@testset "plots" begin

Expand Down
6 changes: 4 additions & 2 deletions test/stl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 083de40

Please sign in to comment.