Skip to content
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

Update Landsat tutorial #692

Merged
merged 3 commits into from
Jan 14, 2022

Conversation

duckontheweb
Copy link
Contributor

@duckontheweb duckontheweb commented Dec 22, 2021

Related Issue(s):

Description:

Updates the Landsat tutorial to be up-to-date with the current extensions and StacIO APIs.

PR Checklist:

  • Code is formatted (run pre-commit run --all-files)
  • Tests pass (run scripts/test)
  • Documentation has been updated to reflect changes, if applicable
  • This PR maintains or improves overall codebase code coverage.
  • Changes are added to the CHANGELOG. See the docs for information about adding to the changelog.

@duckontheweb
Copy link
Contributor Author

cc: @robintw

duckontheweb added a commit to duckontheweb/pystac that referenced this pull request Dec 22, 2021
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2021

Codecov Report

Merging #692 (7822724) into main (ddafad4) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #692   +/-   ##
=======================================
  Coverage   94.30%   94.30%           
=======================================
  Files          77       77           
  Lines       11249    11249           
  Branches     1342     1342           
=======================================
  Hits        10608    10608           
  Misses        461      461           
  Partials      180      180           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ddafad4...7822724. Read the comment docs.

duckontheweb added a commit to duckontheweb/pystac that referenced this pull request Jan 4, 2022
@duckontheweb duckontheweb force-pushed the fix/665-landsat-tutorial branch from 4b2408b to f13a347 Compare January 4, 2022 14:47
@duckontheweb duckontheweb added this to the 1.3.0 milestone Jan 4, 2022
@duckontheweb duckontheweb requested a review from gadomski January 14, 2022 15:00
duckontheweb added a commit to duckontheweb/pystac that referenced this pull request Jan 14, 2022
@duckontheweb duckontheweb force-pushed the fix/665-landsat-tutorial branch from f13a347 to 3142600 Compare January 14, 2022 15:03
Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it's not touched by this PR right now, but there's some typing issues, e.g. in the "Set the providers" block:

Screen Shot 2022-01-14 at 8 35 22 AM

Probably worth cleaning those up as well since we're hitting this file? Alternately, is there an equivalent Python typing way to do Rust's Into/From, since ProviderRole is trivially convertable to/from a string?

@duckontheweb duckontheweb force-pushed the fix/665-landsat-tutorial branch from 3142600 to 7822724 Compare January 14, 2022 16:44
@duckontheweb
Copy link
Contributor Author

So it's not touched by this PR right now, but there's some typing issues, e.g. in the "Set the providers" block:

Screen Shot 2022-01-14 at 8 35 22 AM

Probably worth cleaning those up as well since we're hitting this file? Alternately, is there an equivalent Python typing way to do Rust's Into/From, since ProviderRole is trivially convertable to/from a string?

@gadomski I fixed the type hinting in 7822724 and checked it using nbqa mypy (only for this tutorial). I ended up adding type hints to the functions as well as a TypedDict to describe the scene dictionaries that are used throughout the tutorial in order to satisfy the type checker and hopeful make things more clear. Let me know if you think all of those changes are worthwhile.

As a side note, we may want to add some nbqa checks to our tutorials as part of our test suite to catch these issues across the tutorials.

Copy link
Member

@gadomski gadomski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM. This is one of those cases where type-checking can get in the way a little bit, but I think making sure that the notebooks match the "corrent" way of using the API will save end users headaches down the road.

👍🏽 to adding nbqa to CI.

@duckontheweb duckontheweb merged commit 70faaa5 into stac-utils:main Jan 14, 2022
@duckontheweb duckontheweb deleted the fix/665-landsat-tutorial branch January 14, 2022 20:32
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.

Documentation issues - Quickstart gives errors, and tutorial use of .ext fails
4 participants