-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
MAINT: dense_output and t_eval are mutually exclusive inputs #9282
Conversation
I am not sure the current behavior is the correct behavior. I don't see why both of these options could not be set simultaneously. I think @nmayorov wrote this part of the code. I would like to hear his opinion. |
I can see the reasoning behind the functionality as is. Using neither option stores t and y at every integrator step. Using only t_eval stores only t and y at t=t_eval. Using only dense_output stores t, y and an interpolating function at every integrator step. In my opinion, the reason for specifying t_eval is for convenience and for reducing memory requirements. One still gets similar convenience using dense_output by adding one more line after the solution is returned (like in the issue linked originally). What are the use cases for specifying both? I would suggest the following options:
|
I don't think there is a use-case for specifying both. But I think the sensible behavior when both are specified is this:
|
I think this is a fine option. I can take a crack, but I still haven't been able to build scipy for development, despite reading the developers build documentation several times over. |
Go ahead and take a crack at it. I can't build the dev environment anymore either. I just modify the files of an installed instance in an isolated conda environment and then copy the files to the git repo once everything is working. |
This is what I was planning on doing :) thanks
…On Wed, Sep 19, 2018, 7:24 AM David Hagen ***@***.***> wrote:
Go ahead and take a crack at it. I can't build the dev environment anymore
either. I just modify the files of an installed instance in an isolated
conda environment and then copy the files to the git repo once everything
is working.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#9282 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AlhM4WXJCxnbLcWKrwDnRnv-0u2ostx3ks5ucilcgaJpZM4Wr3d2>
.
|
I have tested this with the following code adapted from the issue above, where sol is the solution when t_eval and dense_output are both set, sol_teval is the solution when only t_eval is set, and sol_dense is the solution when only dense_output is set. I think this satisfies what @drhagen suggested.
Running this returns:
|
I added a simple test that would have failed previously but passes now (on my end). I also changed title to MAINT, since it is no longer a documentation change. Let me know if it should be another category like bug. |
This seems like the correct behavior to me. Very nicely done. |
Hi! I think these are good suggestion and implementation. I'm merging this, quite sure nobody will mind it. |
As found in #9228 in solve_ivp, if both t_eval and dense_output are used, an exception occurs when ts and interpolants lengths do not match.
Added this information to the docstring. Could consider adding an Exception with more informative message as well.