-
Notifications
You must be signed in to change notification settings - Fork 120
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
Speed up get_child
by first checking links that have id in them
#1064
Conversation
Codecov ReportPatch coverage:
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more Additional details and impacted files@@ Coverage Diff @@
## main #1064 +/- ##
==========================================
+ Coverage 90.24% 90.25% +0.01%
==========================================
Files 47 47
Lines 6220 6228 +8
Branches 931 935 +4
==========================================
+ Hits 5613 5621 +8
Misses 427 427
Partials 180 180
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure how to test this.
We could assert that non-preferred links are unresolved? E.g.
_ = catalog.get_child(id="foo")
for link in catalog.links:
if "foo" not in link.href:
assert not foo.is_resolved()
8b831c0
to
2f9e57f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a CHANGELOG entry.
b764b1b
to
27e1063
Compare
Related Issue(s):
Description:
This PR passes id along to the underlying method so the links can be sorted to prefer the ones that contain the id and reduce the number of calls.
I am not sure how to test this. I was originally thinking that I could check the number of calls on one of the methods on
Link
that happen withingget_stac_objects
but this felt rather convoluted and I am going to have to put this down for a few days, so I figured I should just go ahead and open the PR with what I've got.PR Checklist:
pre-commit
hooks pass locallyscripts/test
)