-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support makie backends #181
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #181 +/- ##
==========================================
- Coverage 88.69% 88.49% -0.21%
==========================================
Files 65 66 +1
Lines 9460 9515 +55
==========================================
+ Hits 8391 8420 +29
- Misses 1069 1095 +26 ☔ View full report in Codecov by Sentry. |
ext/MakieExt/plot.jl
Outdated
|
||
function GLMakie.convert_arguments(::PointBased, contres::AbstractBranchResult, vars = nothing, applytoY = identity, applytoX = identity) | ||
function Makie.convert_arguments(::PointBased, contres::AbstractBranchResult, vars=nothing, applytoY=identity, applytoX=identity) |
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.
My coding style is to have spaces around =
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.
Ah yes, sorry about that, I hit auto indent and forgot to check it. I just don't know yet in vscode how to change the formatting settings. Would you know ?
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.
not really
vars = nothing, | ||
linewidthunstable = 1.0, | ||
linewidthstable = 3.0linewidthunstable, | ||
plotcirclesbif = true, |
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.
My coding style is to have spaces around =
Wow, thank you for this new PR!! One issue I found is that the following does not work
|
This works on latest. |
Yep but this one is broken now :( # test vector field for event detection
function Feve(X, p)
p1, p2, k = p
x, y = X
out = similar(X)
out[1] = p1 + x - y - x^k/k
out[2] = p1 + y + x - 2y^k/k
out
end
# parameters for the vector field
par = (p1 = -3., p2 = -3., k = 3)
# bifurcation problem
prob = BifurcationProblem(Feve, -2ones(2), par, (@optic _.p1);
record_from_solution = (x, p; k...) -> x[1])
# parameters for the continuation
opts = ContinuationPar(max_steps = 150, p_min = -3., p_max = 4.0,
# we disable bifurcation detection to focus
# on the user passed events
detect_bifurcation = 0, detect_fold = false,
# parameters specific to event detection
detect_event = 2)
# arguments for continuation
args = (prob, PALC(), opts)
kwargs = (plot = false, verbosity = 0,)
br = continuation(args...; kwargs...,)
BK.plot(br)
br = continuation(args...; kwargs...,
event = SaveAtEvent((-2.,-1.); use_newton = true))
BK.plot(br) |
It should be okay now, it was because empty |
Do you think it is good for merging? |
At this point, I think it works. The only question is if there are other uses of line widths I did not meet during my tests. It's really the only problem I met with CairoMakie. |
yes if you have a working solution, that would be awesome. The Makie backend is slower than the Plots one during continuation. I think the Makie backend should rely on observables in that case but that's another issue. |
So actually, it doesn't exactly require
Thanks, but compared to all the difficult math stuff, this is very easy ;).
Yep I could work on that if you have examples that show the problem. |
Not really, when trying both backend on a simple example, I came to this subjective observation |
You might also be interested by https://github.com/gszep/BifurcationExplorer.jl |
This is a first proposal to allow other Makie backends to be used with BifurcationKit.
The first main problem (solved in this draft) is that (un)stable branches are displayed with different line widths, which is incompatible with CairoMakie as is.
Another solution could be to have one plot per branch. But I'm not sure what is best.
Fixes #54 for CairoMakie at least.