alexriss / SpmImageTycoon.jl

Organize Scanning Probe Microscopy (SPM, STM, AFM) Images and Spectra.
GNU General Public License v3.0
13 stars 1 forks source link

Error or warning when opening directory test data #11

Closed xcasas closed 2 years ago

xcasas commented 2 years ago
image

Hi!

I just got this error when opening the test data in Tycoon. If I click ok everything still works though.

alexriss commented 2 years ago

Thanks for the report. This error occurs when opening the directory? First open? Or re-open? It does not happen on my system. Can you paste the whole error stack from the console window? Also, which OS and julia version do you use?

I somehow suspect it is related to a third-party package I am using (I only use the convert function once - for conversion of old database formats, and it seems very unlikely that this was needed in your case). So, you can also try updating all packages in julia: press julia> ] to change into package manager, then type pkg> up.

xcasas commented 2 years ago

Yes sorry!

Julia version 1.8.0. This is what I get in the console:

julia> tycoon()

julia> Parsed 22 files and created 22 items in 17 milliseconds. MethodError: convert(::Type{Union{}}, ::String) is ambiguous. Candidates: convert(T::Type{<:FilePathsBase.AbstractPath}, x::AbstractString) in FilePathsBase at C:\Users\xavie.julia\packages\FilePathsBase\dVWLK\src\path.jl:116 convert(::Type{T}, s::AbstractString) where T<:AbstractString in Base at strings/basic.jl:232 convert(::Type{Union{}}, x) in Base at essentials.jl:213 convert(::Type{T}, x) where T<:Observables.Observable in Observables at C:\Users\xavie.julia\packages\Observables\ynr7h\src\Observables.jl:125 convert(::Type{T}, arg) where T<:VecElement in Base at baseext.jl:19 Possible fix, define convert(::Type{Union{}}, ::AbstractString) MethodError: convert(::Type{Union{}}, ::String) is ambiguous. Candidates: convert(T::Type{<:FilePathsBase.AbstractPath}, x::AbstractString) in FilePathsBase at C:\Users\xavie.julia\packages\FilePathsBase\dVWLK\src\path.jl:116 convert(::Type{T}, s::AbstractString) where T<:AbstractString in Base at strings/basic.jl:232 convert(::Type{Union{}}, x) in Base at essentials.jl:213 convert(::Type{T}, x) where T<:Observables.Observable in Observables at C:\Users\xavie.julia\packages\Observables\ynr7h\src\Observables.jl:125 convert(::Type{T}, arg) where T<:VecElement in Base at baseext.jl:19 Possible fix, define convert(::Type{Union{}}, ::AbstractString) Stacktrace: [1] pushfirst!(a::Vector{Union{}}, item::String) @ Base .\array.jl:1389 [2] save_config(new_directory::String) @ SpmImageTycoon C:\Users\xavie.julia\packages\SpmImageTycoon\0MqP6\src\config.jl:263 [3] load_directory(dir_data::String, w::Blink.AtomShell.Window) @ SpmImageTycoon C:\Users\xavie.julia\packages\SpmImageTycoon\0MqP6\src\SpmImageTycoon.jl:611 [4] (::SpmImageTycoon.var"#73#76"{Blink.AtomShell.Window, ReentrantLock})(arg::String) @ SpmImageTycoon C:\Users\xavie.julia\packages\SpmImageTycoon\0MqP6\src\event_handlers.jl:292 [5] #invokelatest#2 @ .\essentials.jl:729 [inlined] [6] invokelatest @ .\essentials.jl:726 [inlined] [7] handle_message(o::Blink.Page, m::Dict{String, Any}) @ Blink C:\Users\xavie.julia\packages\Blink\mwJC9\src\rpc\callbacks.jl:7 [8] macro expansion @ C:\Users\xavie.julia\packages\Lazy\9Xnd3\src\macros.jl:268 [inlined] [9] ws_handler(req::Dict{Any, Any}) @ Blink C:\Users\xavie.julia\packages\Blink\mwJC9\src\content\server.jl:56 [10] splitquery(app::typeof(Blink.ws_handler), req::Dict{Any, Any}) @ Mux C:\Users\xavie.julia\packages\Mux\3h8RY\src\basics.jl:31 [11] #1 @ C:\Users\xavie.julia\packages\Mux\3h8RY\src\Mux.jl:10 [inlined] [12] wcatch(app::Mux.var"#1#2"{typeof(Mux.splitquery), typeof(Blink.ws_handler)}, req::Dict{Any, Any}) @ Mux C:\Users\xavie.julia\packages\Mux\3h8RY\src\websockets_integration.jl:12 [13] #1 @ C:\Users\xavie.julia\packages\Mux\3h8RY\src\Mux.jl:10 [inlined] [14] todict @ C:\Users\xavie.julia\packages\Mux\3h8RY\src\basics.jl:25 [inlined] [15] #3 (repeats 2 times) @ C:\Users\xavie.julia\packages\Mux\3h8RY\src\Mux.jl:14 [inlined] [16] (::Mux.var"#1#2"{Mux.var"#3#4"{Mux.var"#3#4"{typeof(Mux.todict), typeof(Mux.wcatch)}, typeof(Mux.splitquery)}, typeof(Blink.ws_handler)})(x::Tuple{HTTP.Messages.Request, WebSockets.WebSocket{Sockets.TCPSocket}}) @ Mux C:\Users\xavie.julia\packages\Mux\3h8RY\src\Mux.jl:10 [17] (::Mux.var"#9#10"{Mux.App})(req::HTTP.Messages.Request, client::WebSockets.WebSocket{Sockets.TCPSocket}) @ Mux C:\Users\xavie.julia\packages\Mux\3h8RY\src\server.jl:49 [18] upgrade(f::Mux.var"#9#10"{Mux.App}, stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) @ WebSockets C:\Users\xavie.julia\packages\WebSockets\QcswW\src\HTTP.jl:201 [19] (::WebSockets.var"#_servercoroutine#11"{WebSockets.ServerWS})(stream::HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}) @ WebSockets C:\Users\xavie.julia\packages\WebSockets\QcswW\src\HTTP.jl:370 [20] macro expansion @ C:\Users\xavie.julia\packages\HTTP\aTjcj\src\Servers.jl:415 [inlined] [21] (::HTTP.Servers.var"#13#14"{WebSockets.var"#_servercoroutine#11"{WebSockets.ServerWS}, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}, HTTP.Servers.Server{Nothing, Sockets.TCPServer}, HTTP.Streams.Stream{HTTP.Messages.Request, HTTP.ConnectionPool.Transaction{Sockets.TCPSocket}}})() @ HTTP.Servers .\task.jl:484

xcasas commented 2 years ago

and it occurs when I open the directory, already the first time I do it. But also the following ones.

xcasas commented 2 years ago

I tried updating the packages but the error persists

alexriss commented 2 years ago

I could not reproduce the error on windows, nor on Linux/WSL. However, I think I know where it came from, and I have released an update. You can update all packages as explained above - this time it should update SpmImageTycoon to version 0.3.7. Then restart julia and run the app (you can double-check the version in the app by clicking "About"). Please see if this fixes the error. Thanks!

xcasas commented 2 years ago

It worked !

alexriss commented 2 years ago

Great, thanks for the help. And yes, it was in my code.... 😃