-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Ambiguity fix #385
Ambiguity fix #385
Conversation
@ChrisRackauckas were there more plotting changes recently? The doc build crash here is plotting a solution object that previously worked. |
There was just the major change SciML/SciMLBase.jl#572. The syntax of the plots isn't changed at all, just the internals. The internals got rid of everything special about plotting and now just uses the solution interface. This revealed that we had an issue with idxs with FunctionMap SciML/OrdinaryDiffEq.jl#2099. |
https://github.com/SciML/JumpProcesses.jl/actions/runs/7360900012/job/20037606665?pr=385#step:6:671 parameter indexing test needs to be updated but @AayushSabharwal is |
I think @TorkelE had added parameter indexing stuff here a while back. I guess that needs the updates SciMLbase got too? |
I'm confused. Has the new MTK version with the new indexing been pushed and is that what we are using? Or has it not, by why is then problem indexing affected? |
This is about SciMLBase not MTK. |
SUre, but it is all tied together, right? My understanding was that a big MTK update was coming that would make indexing easier (MTK v9). Obviously this would change internal stuff as well. But has this been rolled out already? Or it hasn't? Or just in some places? And if big changes have been rolled out in SciML base, why wasn't it made a breaking release? Or this have nothing to do with the new big changes, but it seems like Chris is talking about them. Basically, it would be useful to learn what is actually planned to happen where and when, and have some kind of announcement before major things happens. But maybe this wasn't a major change, but then exactly what it is that have changed? |
The RecursiveArrayTools v3, and SymbolicIndexingInterface v0.3 roll outs have all already happened. See https://docs.sciml.ai/SymbolicIndexingInterface/dev/usage/ for examples on how it's used.
I mentioned many times before that indexing from
We had 2 of the core packages do a major update, and hundreds of PRs to go along with it. |
@ChrisRackauckas should I just remove the getindex/setindex stuff on JumpProblems (and associated tests)? |
Last time we chatted you said that it was being discussed, and you generally was no in favour of it, and we both stated why we think differently. Both since then and before I have been in contact with the people handling the implementation, and I have been reassured that Just to demonstrate why this is important to end-users, here is an example where you create a bifurcation diagram, both using Using `Symbol notation that thought we would support: narula_system = @reaction_network begin
kDeg, (w,w2,w2v,v,w2v2,vP,σB,w2σB) ⟶ ∅
kDeg, vPp ⟶ phos
(kBw,kDw), 2w ⟷ w2
(kB1,kD1), w2 + v ⟷ w2v
(kB2,kD2), w2v + v ⟷ w2v2
kK1, w2v ⟶ w2 + vP
kK2, w2v2 ⟶ w2v + vP
(kB3,kD3), w2 + σB ⟷ w2σB
(kB4,kD4), w2σB + v ⟷ w2v + σB
(kB5,kD5), vP + phos ⟷ vPp
kP, vPp ⟶ v + phos
v0*((1+F*σB)/(K+σB)), ∅ ⟶ σB
λW*v0*((1+F*σB)/(K+σB)), ∅ ⟶ w
λV*v0*((1+F*σB)/(K+σB)), ∅ ⟶ v
end
p_vals = [:kBw => 3600, :kDw => 18, :kD => 18, :kK1 => 36, :kK2 => 36, :kP => 180,:kDeg => 0.7,
:kB1 => 3600, :kB2 => 3600, :kB3 => 3600, :kB4 => 1800, :kB5 => 3600,
:kD1 => 18, :kD2 => 18, :kD3 => 18, :kD4 => 1800, :kD5 => 18,
:v0 => 0.4, :F => 30, :K => 0.2, :λW => 4, :λV => 4.5, :pInit => 0.001, :pStress => 0.4]
u_guess = [:w => 1.0, :w2 => 1.0, :w2v => 1.0, :v => 1.0,:w2v2 => 1.0, :w2σB => 1.0, :σB => 1.0,
:vP => 1.0, :phos => 1.0, :vPp => 1.0]
u0 = [:phos => 0.4, :vPp => 0.0]
bprob = BifurcationProblem(narula_system, u_guess, p_vals, :kK2; plot_var = :σB, u0) Using the narula_system = @reaction_network begin
kDeg, (w,w2,w2v,v,w2v2,vP,σB,w2σB) ⟶ ∅
kDeg, vPp ⟶ phos
(kBw,kDw), 2w ⟷ w2
(kB1,kD1), w2 + v ⟷ w2v
(kB2,kD2), w2v + v ⟷ w2v2
kK1, w2v ⟶ w2 + vP
kK2, w2v2 ⟶ w2v + vP
(kB3,kD3), w2 + σB ⟷ w2σB
(kB4,kD4), w2σB + v ⟷ w2v + σB
(kB5,kD5), vP + phos ⟷ vPp
kP, vPp ⟶ v + phos
v0*((1+F*σB)/(K+σB)), ∅ ⟶ σB
λW*v0*((1+F*σB)/(K+σB)), ∅ ⟶ w
λV*v0*((1+F*σB)/(K+σB)), ∅ ⟶ v
end
p_vals = [narula_system.kBw => 3600, narula_system.kDw => 18, narula_system.kD => 18, narula_system.kK1 => 36,
narula_system.kK2 => 36, narula_system.kP => 180,narula_system.kDeg => 0.7,
narula_system.kB1 => 3600, narula_system.kB2 => 3600, narula_system.kB3 => 3600, narula_system.kB4 => 1800,
narula_system.kB5 => 3600, narula_system.kD1 => 18, narula_system.kD2 => 18, narula_system.kD3 => 18, narula_system.kD4 => 1800,
narula_system.kD5 => 18, narula_system.v0 => 0.4, narula_system.F => 30, narula_system.K => 0.2, narula_system.λW => 4,
narula_system.λV => 4.5, narula_system.pInit => 0.001, narula_system.pStress => 0.4]
u_guess = [narula_system.w => 1.0, narula_system.w2 => 1.0, narula_system.w2v => 1.0, narula_system.v => 1.0,
narula_system.w2v2 => 1.0, narula_system.w2σB => 1.0, narula_system.σB => 1.0,
narula_system.vP => 1.0, narula_system.phos => 1.0, narula_system.vPp => 1.0]
u0 = [narula_system.phos => 0.4, narula_system.vPp => 0.0]
bprob = BifurcationProblem(narula_system, u_guess, p_vals, narula_system.kK2; plot_var = narula_system.σB, u0) |
@TorkelE the latter issue could be fixed by a p_vals = @valuemap narula_system [kBw => 3600, kDw => 18, ...] (I like explicitly using the desired container type here since then one could potentially give tuples or other input type arrays to store the mapping.) But I understand that such functionality doesn't exist currently. |
You're talking about something different. Did you read the link that I just sent? https://docs.sciml.ai/SymbolicIndexingInterface/dev/usage/.
What I am referring to is the fact that Right now, From this, other DSLs can implement how to symbolically interface with their systems by either building a SymbolCache and passing that as |
You are right Chris, I had another look and get it better, my mistake. Seems the issue is specific to Also, do SII allow Finally, does this mean that the big indexing change has happened? Whatever the outcome I have been looking forward to that one. having this in place has been the last piece for needed for the comprehensive upgrade of the Catalyst docs, looking forward to be able to work on all parts of that one! |
@isaacsas Yes, that was the one I alluded to. I think there are some stuff that needs to be ironed out. E.g. in some cases you want to provide not a map, but a list of e.g. parameters or expressions (e.g. known_ps = @make_symbolic system [p, d, k]
funcs_to_check = @make_symbolic system [X1+x2+X3, Y + 2*Y2Z] |
That seems sensible to me. |
It has already happened. We're cleaning up a few test errors that we're finding here and there, but I think it's all done now? This might be the last one.
That's not really up to SII. SII states that in order for fast matching to occur, any DSL needs to define unique names for all of its symbols. The reason why that's not great still though is that |
I just posted an issue on SymbolicIndexingInterface. It seems like there would be a benefit to having a formalized interface for getting a display representation of a name (as a string), which can be distinct from the Symbol-based indexing interface. This could be used then by |
Is there more to that then |
Yes, it could handle converting unicode plus to a normal dot for MTK systems. |
interesting idea. I'm not opposed. |
If we do that correctly, users would only encounter unicode plus when accessing variables/parameters via flattened systems directly, but all their display output would look nice. (And if people are trained to access variables/parameters via the pre-flattened base system then they might never have to see the unicode plus and it would just be internal.) |
Yeah, I could see that. @YingboMa would you be opposed to having the printing show the |
It could always just be used for plots and Latexify, but those are both cases where the unicode plus is definitely not desirable. |
I heavily agree there. At that point though, we might as well also remove it from display/show. |
Is MTK v9 something imminent (as in there is a plan to release when some stuff gets finished and we more or less know what changes it will bring), or still off in the hard to forsee future? |
It's very imminent. SciML/ModelingToolkit.jl#2262 |
I want it done by next week before the class starts. |
Makes sense to have it ready for the class. Looking forward to the release! |
@ChrisRackauckas will having heterogenous tuple inputs (i.e. floats and ints) be supported again? There needs to be a way to perfomantly have mixed parameter types. |
As parameters? Yes. It's still implemented it's just off by default. That's getting turned back on. |
Ok, I’d like to get the stuff that broke in catalyst working again. We had to basically add a comment that such support was broken due to a bug in our docs, and have had people asking why their tuples are getting converted to union type vectors that give performance warnings from ScoMLBase. |
Yeah sorry, it's a bit of a bumpy month, but I'm trying to get everything onto standard interfaces so it's easier to maintain it all going forward. No secret side channels, closing all of those 😅 |
I'm all in favor of standard interfaces! I had wanted to actually chat with you about dev practices at some point for when one is making big interface changes (whether non-breaking or user facing and breaking). The current approach is to merge the incremental dev work for such efforts into master if it doesn't appear breaking, which means changes get released piecemeal before the overall effort is completely finished. I was wondering if more ambitious rewrites within core packages like SciMLBase or MTK should perhaps go via PRs to feature branches. When they are complete an announcement could be made to test against them (basically an alpha/beta type release), and only after a chance for people to test would they then get merged into master and released. I feel like this would have (perhaps) avoided some of the bugs that slipped through in the past semester. (Note, for more minor changes, adding features that don't change existing (internal) API functions, or bug fixes I wouldn't think anything needs changing. This is more for things that make big internal changes that have a higher likelihood of inadvertently introducing changes/bugs that impact downstream packages.) I admitedly have little experience on dev practices for larger software packages, but it seemed like maybe SciML is starting to reach the size where the most core libraries that many things depend might benefit from a modified dev/release workflow. |
We did hold this on PR branches for a few months while doing a lot of downstream testing. There were about 12 PRs or something like that prepared and a thread with 500 replies of multiple people testing out a bunch of things. Most tests passed, but there was still quite a bit of clean up to do. Part of that is because v1.10 happened to land right in the middle of the rollout. Also the RecursiveArrayTools v3 happening at the same time didn't make it easier (though it was necessary because that's where the indexing break actually took place, and thus changing the AbstrsctVoA to no longer be a AbstractArray because of the linear indexing had been waiting for a long time and we finally had a good chance to do it). Changing very low level interfaces is just something that takes a significant amount of work. |
Does this fix #384 ? |
Your comment said this was the missing dispatch. |
Is there still an issue? |
Yes, by |
Can you try with master? We haven’t made a release with this fix yet. |
I think the best way to be sure is to set up Aqua test in CI. |
@ChrisRackauckas @TorkelE I don't know about the internal field https://docs.sciml.ai/DiffEqDocs/stable/types/discrete_types/#SciMLBase.DiscreteFunction So it would be nice to ensure they keep working within SciMLBase 2.X (perhaps by auto-constructing the |
That should've never gotten documented. If anything, we'll just need to do a fast SciMLBase v3 and merge without looking at CI just to get it out. There's no way we have the manpower to keep that thing around. |
Basically |
No, DiscreteFunction isn't going anywhere. If anyone is saying that it's not true. It's |
Got it, good to know. There was something in SciML/ModelingToolkit.jl#2262 about removing discrete time stuff, so got a bit uncertain exactly what was happening. |
That's a different kind of discrete stuff. It's a form of discrete+continuous model that's used in control systems, and it's removing an older implementation that was deprecated for a newer one years ago (and it was undocumented). The newer tested and documented one would serve as a nice building block for making hybrid solvers (see SciML/ModelingToolkit.jl#2410 for some details on how to use it), but the old one was more of a test run. |
Let's see if tests pass with this.