Add support for "complex" bounding boxes.#11699
Closed
WilliamJamieson wants to merge 15 commits into
Closed
Conversation
Contributor
Author
|
Tagging @nden and @perrygreenfield for comment. |
Contributor
|
👋 Thank you for your draft pull request! Do you know that you can use |
Member
|
Is this fully backward compatible. Will this break people's custom models downstream? |
Contributor
Author
@plim I do not think this would break people's custom models. It seems to pass all the jwst and gwcs tests in addition to the astropy tests. |
a75d391 to
22858e7
Compare
7d7b848 to
a267bd5
Compare
a267bd5 to
4cb91c1
Compare
9 tasks
Contributor
|
Superseded by #11942 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Often one ends of with models for images with many slices have a dependency on that slice. These models can be extremely complex, being comprised of ~100 models, which are nearly identical for all slices, but have different bounding boxes for each slice. The bounding box calculations for each slice can become expensive if there is a need to run the model multiple times. For this reason, it is useful to be able to bind a "complex" bounding box to the model, which can select the "correct" bounding box based on a slice argument.
In this pull request, I introduce a
ComplexBoundingBoxwhich essentially is a dictionary of bounding boxes with keys given by the slice values. ThenModelandCompoundModelwere modified so that they can use this complex bounding box when the need arises. Moreover, the interfacebind_complex_bounding_boxwas added to facilitate the easy creation and adding of a complex bounding box to any existing model.