-
Notifications
You must be signed in to change notification settings - Fork 30
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
Remove Requires and implement a Makie extension instead #181
Conversation
260bd0e
to
beb319d
Compare
From @mohamed82008 's description, the intention of this PR looks good to me. But I don't understand how |
Extension packages in Julia get loaded automatically just like Requires worked in the past. So when I call function visualize(arg::T; kwargs...) where {T}
throw(ArgumentError("`visualize` is not defined for input type $T. This may be because the input to the function is incorrect or because you forgot to load `Makie` in your code. You can load `Makie` with `using Makie`."))
end |
Note that it is just a single function |
The latest commit implements a more informative error message. |
0f94030
to
cad39c5
Compare
Good to know! Do we have to declare extension packages somewhere, or we simply need to put it in to the |
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" | ||
|
||
[extensions] | ||
TopOptMakieExt = "Makie" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@yijiangh these 2 new Project.toml sections are where we declare the extension packages
Summary
visualize
function now at the top level in TopOpt.jl and overload it in the extension. This means that a singlevisualize
function is overloaded for both continuum and truss problems. This function is also exported by default.