Skip to content

Commit

Permalink
Retry download if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasnoack committed Nov 5, 2024
1 parent 0c95f73 commit 37249f5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ CategoricalArrays = "0.8, 0.9, 0.10"
DataFrames = "0.22, 1"
Distributions = "0.16, 0.17, 0.18, 0.19, 0.20, 0.21, 0.22, 0.23, 0.24, 0.25"
RDatasets = "0.5, 0.6, 0.7"
Retry = "0.4"
Reexport = "0.1, 0.2, 1.0"
SpecialFunctions = "0.6, 0.7, 0.8, 0.9, 0.10, 1, 2.0"
Statistics = "1"
Expand All @@ -38,8 +39,9 @@ CategoricalArrays = "324d7699-5711-5eae-9e2f-1d82baa6b597"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b"
Retry = "20febd7b-183b-5ae2-ac4a-720e7ce64774"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["CategoricalArrays", "CSV", "DataFrames", "Downloads", "RDatasets", "StableRNGs", "Test"]
test = ["CategoricalArrays", "CSV", "DataFrames", "Downloads", "RDatasets", "Retry", "StableRNGs", "Test"]
8 changes: 6 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ using CategoricalArrays, CSV, DataFrames, LinearAlgebra, SparseArrays, StableRNG
using GLM
using StatsFuns: logistic
using Distributions: TDist
using Downloads
using Downloads, Retry

test_show(x) = show(IOBuffer(), x)

Expand Down Expand Up @@ -2075,7 +2075,11 @@ end
end

@testset "NIST - Filip. Issue 558" begin
fn = Downloads.download("https://www.itl.nist.gov/div898/strd/lls/data/LINKS/DATA/Filip.dat")
fn = @repeat 5 try
return Downloads.download("https://www.itl.nist.gov/div898/strd/lls/data/LINKS/DATA/Filip.dat")
catch err
@delay_retry if err.code == 503 end
end
filip_estimates_df = CSV.read(fn, DataFrame; skipto = 31, limit = 11, header = ["parameter", "estimate", "se"], delim = " ", ignorerepeated = true)
filip_data_df = CSV.read(fn, DataFrame; skipto = 61, header = ["y", "x"], delim = " ", ignorerepeated = true)
X = [filip_data_df.x[i]^j for i in 1:length(filip_data_df.x), j in 0:10]
Expand Down

0 comments on commit 37249f5

Please sign in to comment.