-
Notifications
You must be signed in to change notification settings - Fork 122
added support for STAC file extension #270
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
Conversation
pystac/extensions/file.py
Outdated
If an Asset is supplied, sets the property on the Asset. | ||
Otherwise sets the Item's value. | ||
""" | ||
if asset is None: |
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.
We should handle setting optional values to None
by popping the dict keys - I've fixed an issue in https://github.com/stac-utils/pystac/pull/269/files that has a pattern for this which you could reuse here.
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.
@lossyrob Instead of replacing it in all the setters, I have extracted the mechanism to a separate method _set_property
. Maybe it would be worth to have that in the parent Item class? Other extensions might have the same issue (I actually used the eo
extension as the base for the file
one, so that one for sure has the same problem with None values in setters.
Let me know if you think it's a good idea and I can take care of that bit of refactoring
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.
Sounds like a great idea!
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.
Seems like I captured the idea of doing this in #230, so this refactor will close that issue.
Looks like Afterwards I suggest making sure |
It adds support for data_type, nodata, checksum and size
The tests only cover the support for values in assets, since I am not sure how to apply (or even if it makes sense to ) those parameters can be applied outside of the asset level...