-
Notifications
You must be signed in to change notification settings - Fork 1
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
spacing of linspace can be more than step_max when supplied #45
Comments
I think you are just hitting some insignificant floating point rounding error here.
|
Or alternately:
|
I agree, yet if upstream tests use "<" it doesn't seem to matter if the interval is only larger by a floating point rounding error than step_max, the < still fails. |
I'm not sure where you are going with that. It's just the wrong test to apply, and e.g.
|
OK, what is the appropriate test to confirm a time range isn't larger than the allowed maximum time range? Per your comments I thought it would be something like CxoTime(stop) - CxoTime(start) < Quantity, but apparently that's not what you have in mind. |
I'm not sure of the context of your question. If it is in the reference chandra_aca
It should not ever happen that a single fetch query exceeds If you are talking about a unit test here, then with your example you should just test for |
Sure, I thought the point of step_max was that the calling code could expect all the intervals to be smaller by a "<" test, so I considered it a bug and worked around it in my WIP by making step_max less than the limit. If you think it is fine that the intervals can be floating point error larger than step_max than we can go forward using that convention. I just figured you hated calling code to need to keep track of that kind of thing. |
Floating point comparisons always need to account for floating point errors. That's not unique to this application, as evidenced by the It never would even occur to me to check the thing you were checking in the calling code, I expect the function to work as advertised. You could update the |
Basically, don't do that e.g.:
|
Regarding "It never would even occur to me to check the thing you were checking in the calling code," I still don't understand because we headed along the path to creating the general CxoTime.linspace method specifically to break an interval into chunks so that each chunk would satisfy a time-limit requirement. So now we have a new method that doesn't satisfy the original requirement. |
Are you able to break the code at sot/chandra_aca#181 in any way? If not then we are done. You are using the new |
I can't think of a way to break it with an explicit step_max smaller by any reasonable amount than the limit. And yes, sure, that's fine and that's what I meant by " If you think it is fine that the intervals can be floating point error larger than step_max then we can go forward using that convention." |
I think to be completely correct for applications that require that the time deltas not be greater than step_max we'll need to add something to step_max when calculating the number of pieces, or just increment the number of pieces if any chunk is greater than step_max.
The text was updated successfully, but these errors were encountered: