-
Notifications
You must be signed in to change notification settings - Fork 122
Add collection to ExtensionManagementMixin type params where appropriate #547
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
Add collection to ExtensionManagementMixin type params where appropriate #547
Conversation
It isn't necessarily the case that the extensions in question can be applied to collections (in the sense that their fields mean anything on collection properties) but they _can_ show up in summaries (inferred from th presence of `SummariesFooExtension`).
Codecov Report
@@ Coverage Diff @@
## main #547 +/- ##
==========================================
+ Coverage 94.27% 94.33% +0.05%
==========================================
Files 71 71
Lines 10290 10378 +88
Branches 1077 1085 +8
==========================================
+ Hits 9701 9790 +89
+ Misses 420 419 -1
Partials 169 169
Continue to review full report at Codecov.
|
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.
This looks great, thanks for getting it in!
Originally I was thinking we should add test cases for using add_to
and remove_from
on Collection
instances to make sure it actually works at runtime, but I'm pretty confident that we are covering our bases with the typing. What do you think @jisantuc?
How to test was going to be my next question -- conditions are:
? |
Yeah, and: |
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.
Looks good overall.
I'm curious to get other input on how we handle automatically adding schema URIs to objects when summarizing (see review comment for more detail) before merging.
tests should fail
the add_if_missing params happen not to be necessary all over the test file here, but they make the tests resilient to changes in the test data, which I think is nice
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.
Awesome, thanks for getting this in!
Related Issue(s): #525
Description: This PR adds
pystac.Collection
to theExtensionManagementMixin
type params (via aUnion
) for all extensions that provide concrete implementations ofSummariesExtension
.PR Checklist:
pre-commit run --all-files
)scripts/test
)Documentation has been updated to reflect changes, if applicable