Skip to content

Commit

Permalink
Better error message if Makie not loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Sep 4, 2024
1 parent 53105eb commit 8acce27
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Sunny.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ export set_external_field!, set_external_field_at!, meV_per_K,
isloaded(pkg::String) = any(k -> k.name == pkg, keys(Base.loaded_modules))

### ext/PlottingExt.jl, dependent on Makie
function view_crystal(args...)
error(isloaded("Makie") ? "Invalid method call" : "Import GLMakie to enable plotting")
function view_crystal(args...; opts...)
error(isloaded("Makie") ? "Invalid method call" : "Import Makie to enable plotting")
end
function plot_spins!(args...)
error(isloaded("Makie") ? "Invalid method call" : "Import GLMakie to enable plotting")
function plot_spins!(args...; opts...)
error(isloaded("Makie") ? "Invalid method call" : "Import Makie to enable plotting")
end
function plot_spins(args...)
error(isloaded("Makie") ? "Invalid method call" : "Import GLMakie to enable plotting")
function plot_spins(args...; opts...)
error(isloaded("Makie") ? "Invalid method call" : "Import Makie to enable plotting")
end
function plot_intensities!(args...; opts...)
error(isloaded("Makie") ? "Invalid method call" : "Import GLMakie to enable plotting")
error(isloaded("Makie") ? "Invalid method call" : "Import Makie to enable plotting")
end
function plot_intensities(args...; opts...)
error(isloaded("Makie") ? "Invalid method call" : "Import GLMakie to enable plotting")
Expand Down

0 comments on commit 8acce27

Please sign in to comment.