Skip to content

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

Merged
merged 4 commits into from
Mar 11, 2021
Merged

added support for STAC file extension #270

merged 4 commits into from
Mar 11, 2021

Conversation

volaya
Copy link
Contributor

@volaya volaya commented Mar 3, 2021

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...

If an Asset is supplied, sets the property on the Asset.
Otherwise sets the Item's value.
"""
if asset is None:
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Member

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!

Copy link
Member

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.

@lossyrob
Copy link
Member

lossyrob commented Mar 3, 2021

Looks like codespell is complaining about "FileTest" - you can add it to the codespell ingore file (will be the first entry!).

Afterwards I suggest making sure scripts/test pass; this is the same script that CI is running. Note you can also use scripts/format to reformat things. If you're on windows, the shell scripts won't work, though I recommend wsl 2 (that's what I use) - otherwise the scripts will at least show you what steps need to be run. Perhaps we could also add some batch files in the future as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants