-
Notifications
You must be signed in to change notification settings - Fork 27
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
Interval() and tile_evenly() are bugged when the size of the interval is less than the number of tiles. #338
Comments
Thanks for the report. What do you expect to happen when more tiles are requested than there are elements to begin with? |
I would expect that, if we have |
Thanks for the explanation. I agree that introducing empty tiles would be one way to produce a result, but one problem with that solution is that the result is no longer tiled "evenly" -- some portions of the result have elements, and other portions are empty. Another problem is that it's not immediately clear to me whether there is a way to implement that result that would be as efficient as the current solution, which takes advantage of the assumption that all tiles have the same size, except for possibly the last tile of the result. Also, if one is creating execution based on the tiling as you are, one might prefer not to create agents (a potentially expensive operation) for empty tiles. For what it's worth, Do you think it would be reasonable for |
That seems like a reasonable thing to do, but I thought of another possible solution: you could change the number of tiles to be the size of the range if the range is smaller than the number of tiles given by the user. Although this implicitly hides the configuration of tiles from the user, this should be an exceptional case. Additionally, this avoids creating redundant agents. |
Thanks for the suggestion. I agree that producing a valid tiling in this case is a better option, and should be just as easy to implement. I've filed #339 to track this issue separately. |
When running the following program,
the output will be:
Arguably, the code could be seen as broken because some tiles will have no values in them, but it seems like Agency should still be able to gracefully handle this.
Meta:
The text was updated successfully, but these errors were encountered: