From dd4182ba7ac5761339c4b8e4d9b8805900d2d1c9 Mon Sep 17 00:00:00 2001 From: Deeptendu Date: Thu, 1 Sep 2022 15:41:15 -0400 Subject: [PATCH 1/2] required pickle and pass tests --- src/MLDatasets.jl | 4 ++-- test/runtests.jl | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/MLDatasets.jl b/src/MLDatasets.jl index 0fec184c..c267f7cf 100644 --- a/src/MLDatasets.jl +++ b/src/MLDatasets.jl @@ -9,6 +9,7 @@ using MLUtils: getobs, numobs, AbstractDataContainer using Glob using DelimitedFiles: readdlm using FileIO +import CSV using LazyModules: @lazy include("require.jl") # export @require @@ -22,10 +23,9 @@ include("require.jl") # export @require @require import JSON3="0f8b85d8-7281-11e9-16c2-39a750bddbf1" @require import DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @require import ImageShow="4e3cecfd-b093-5904-9786-8bbb286a6a31" +@require import Pickle="fbb45041-c46e-462f-888f-7c521cafbc2c" # @lazy import NPZ # lazy imported by FileIO -@lazy import Pickle="fbb45041-c46e-462f-888f-7c521cafbc2c" @lazy import MAT="23992714-dd62-5051-b70f-ba57cb901cac" -import CSV @lazy import HDF5="f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" # @lazy import JLD2 diff --git a/test/runtests.jl b/test/runtests.jl index 7ed8e5f4..8d87b97f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -7,6 +7,7 @@ using ImageShow using ColorTypes using FixedPointNumbers using JSON3 +using Pickle ENV["DATADEPS_ALWAYS_ACCEPT"] = true From 1c1f8429469b090343d1c21afdd26b7fe7850c06 Mon Sep 17 00:00:00 2001 From: Deeptendu Date: Sat, 3 Sep 2022 00:26:38 -0400 Subject: [PATCH 2/2] Require hot fix --- src/MLDatasets.jl | 2 +- src/io.jl | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/MLDatasets.jl b/src/MLDatasets.jl index c267f7cf..05e20f8a 100644 --- a/src/MLDatasets.jl +++ b/src/MLDatasets.jl @@ -23,8 +23,8 @@ include("require.jl") # export @require @require import JSON3="0f8b85d8-7281-11e9-16c2-39a750bddbf1" @require import DataFrames="a93c6f00-e57d-5684-b7b6-d8193f3e46c0" @require import ImageShow="4e3cecfd-b093-5904-9786-8bbb286a6a31" -@require import Pickle="fbb45041-c46e-462f-888f-7c521cafbc2c" # @lazy import NPZ # lazy imported by FileIO +@lazy import Pickle="fbb45041-c46e-462f-888f-7c521cafbc2c" @lazy import MAT="23992714-dd62-5051-b70f-ba57cb901cac" @lazy import HDF5="f67ccb44-e63f-5c2f-98bd-6dc0ccc4ba2f" # @lazy import JLD2 diff --git a/src/io.jl b/src/io.jl index 5183fea1..f28360ea 100644 --- a/src/io.jl +++ b/src/io.jl @@ -25,6 +25,7 @@ function read_npz(path) end function read_pytorch(path) + assert_imported(Pickle._lazy_pkgid) return Pickle.Torch.THload(path) end