Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: handle NotInstalledError #226

Closed
wants to merge 2 commits into from
Closed

WIP: handle NotInstalledError #226

wants to merge 2 commits into from

Conversation

johnnychen94
Copy link
Member

@johnnychen94 johnnychen94 commented Apr 11, 2019

From previous PR #76 this feature looks like supported, but I can't find the commit that deprecates this. And looks like NotInstalledError isn't used anymore.

I'll work on test cases if this feature is needed, otherwise, I'll close this PR and clean error_handling.jl in next PR.

before:

julia> using TestImages
[ Info: Recompiling stale cache file /home/math/jc/.julia/compiled/v1.1/TestImages/cMlD2.ji for TestImages [5e47fb64-e119-507b-a336-dd2b206d9990]

julia> testimage("ca")
Error encountered while loading "/home/math/jc/.julia/packages/TestImages/6bT9D/images/cameraman.tif".
Fatal error:
ERROR: ArgumentError: Package ImageMagick not found in current path:
- Run `import Pkg; Pkg.add("ImageMagick")` to install the ImageMagick package.

Stacktrace:
 [1] handle_error(::ArgumentError, ::FileIO.File{FileIO.DataFormat{:TIFF}}) at /home/math/jc/.julia/packages/FileIO/e8FNK/src/error_handling.jl:80
 [2] handle_exceptions(::Array{Any,1}, ::String) at /home/math/jc/.julia/packages/FileIO/e8FNK/src/error_handling.jl:75
 [3] #load#27(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::FileIO.File{FileIO.DataFormat{:TIFF}}) at /home/math/jc/.julia/packages/FileIO/e8FNK/src/loadsave.jl:193
 [4] load(::FileIO.File{FileIO.DataFormat{:TIFF}}) at /home/math/jc/.julia/packages/FileIO/e8FNK/src/loadsave.jl:172
 [5] #load#13(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::String) at /home/math/jc/.julia/packages/FileIO/e8FNK/src/loadsave.jl:118
 [6] load at /home/math/jc/.julia/packages/FileIO/e8FNK/src/loadsave.jl:118 [inlined]
 [7] testimage(::String) at /home/math/jc/.julia/packages/TestImages/6bT9D/src/TestImages.jl:88
 [8] top-level scope at none:0

after:

julia> using TestImages
[ Info: Recompiling stale cache file /home/math/jc/.julia/compiled/v1.1/TestImages/cMlD2.ji for TestImages [5e47fb64-e119-507b-a336-dd2b206d9990]

julia> testimage("ca")
Error encountered while loading "/home/math/jc/.julia/packages/TestImages/6bT9D/images/cameraman.tif".
Fatal error:
Library "ImageMagick" is not installed but is recommended as a library to load format: ".tif"
Should we install "ImageMagick" for you? (y/n):

@johnnychen94 johnnychen94 changed the title handle NotInstalledError WIP: handle NotInstalledError Apr 12, 2019
@johnnychen94
Copy link
Member Author

Close this since there's no additional feedback. I'm not sure if this is a wanted feature.

@timholy
Copy link
Member

timholy commented May 13, 2019

It may just be that no one got around to reviewing this; certainly I was quite busy when it was first submitted (still am, but...). I have a vague memory that @SimonDanisch might have disabled this out of fears that it was too magical?

@SimonDanisch
Copy link
Member

There was a lot of push back against this and since it was breaking on 1.0, I removed it - or maybe someone else who took up porting FileIO to 1.0 did ;)
But I'm actually quite happy with it removed, since I usually run into an uninstalled package in Atom, which would freeze my julia process (no prompt, but still isinteractive() == true)

@johnnychen94
Copy link
Member Author

In this case, shall I clean the legacy file error_handling.jl?

@timholy
Copy link
Member

timholy commented Dec 18, 2020

I'm not sure I've seen the Pkg.add feature run in ages, so I'd be happy having it removed.

timholy added a commit that referenced this pull request Dec 31, 2020
I haven't seen this warning come up in a long time, so I don't think
this code is active. It adds significant latency due to the time
needed to infer the Pkg calls, so let's ditch it.

xref #226.
@timholy timholy mentioned this pull request Dec 31, 2020
@timholy timholy mentioned this pull request Mar 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants