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

Rename, edit and link notebooks #74

Open
wants to merge 28 commits into
base: main
Choose a base branch
from

Conversation

tcmetzger
Copy link
Contributor

@tcmetzger tcmetzger commented Aug 31, 2021

This PR updates all tutorial notebooks that are currently in the tutorials folder of the main branch. Two notebooks (census and proximity) have not been merged yet and therefore are not included in this PR. I will update this PR to include those two notebooks once they have been merged.

All notebooks now follow a consistent file naming pattern. This includes numbering all notebooks in the following order:

  1. Reprojecting and Resampling
  2. Coregistration
  3. Mosaicking
  4. Geospatial Classification
  5. Local Tools
  6. Focal Statistics
  7. Surface Tools
  8. Proximity Tools [not yet included in this PR]
  9. Zonal Statistics
  10. Census Data [not yet included in this PR]
  11. Landcover Classification

The basic thoughts behind this order:

  • Notebooks 1 to 4 cover basic operations that are used in many of the subsequent notebooks
  • Notebooks 5 to 9 cover operations that generally follow the categories of the Map Algebra Functions (Local Operations, Focal Operations, Global Operations, and Zonal Operations).
  • The census data notebook (10) is similar to zonal statistics, as much of what happens there is defining and plotting zones and therefore fits in well right behind the Zonal Statistics notebook.
  • The Landcover Classification notebook goes beyond the other notebooks since it introduces PyTorch.

Other than renaming and ordering notebooks, this PR includes the following updates:

  • Add a "Click on this link to go to the next notebook" link at the bottom of each notebook.
  • Check and update external and internal links
  • Edit for stylistic consistency, orthography, and interpunctuation (based on the Microsoft Writing Style Guide).

Since the Landcover Classification was note created by makepath, this PR only changes the filename but leaves the file unchanged otherwise.

* Rename files

* Check and update internal and external links

* Consistent capitalization for Xarray-Spatial

* Begin editing for style and consistency

* Finish editing for style and consistency

* Update next steps section for classification nb
@tcmetzger tcmetzger marked this pull request as ready for review August 31, 2021 05:57
@TomAugspurger
Copy link

Thanks. I believe the README links to these notebooks. Can you make sure those links are updated?

@TomAugspurger
Copy link

And FYI, proximity has been merged now.

@tcmetzger
Copy link
Contributor Author

tcmetzger commented Aug 31, 2021

@TomAugspurger Thanks for your feedback! My recent commits add the proximity notebook and also update the links in README.md.

@thuydotm
Copy link
Contributor

thuydotm commented Sep 1, 2021

Thanks @TomAugspurger

I'm noticing some error when searching for STAC items using pystac_client. Are there any changes with the API or with the set up on Planetary Computer?

bounds = [-57.151965, -2.530125, -55.710724, -1.179033]

catalog = pystac_client.Client.open(
    "https://planetarycomputer-staging.microsoft.com/api/stac/v1"
)
jrc = catalog.search(collections=["jrc-gsw"], bbox=bounds)

items = list(jrc.get_items())
print(f"Returned {len(items)} Items")
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
/tmp/ipykernel_359/2968004645.py in <module>
      4     "https://planetarycomputer-staging.microsoft.com/api/stac/v1"
      5 )
----> 6 jrc = catalog.search(collections=["jrc-gsw"], bbox=bounds)
      7 
      8 items = list(jrc.get_items())

/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac_client/client.py in search(self, **kwargs)
    166                 'No link with "rel" type of "search" could be found in this catalog')
    167 
--> 168         return ItemSearch(search_link.target, stac_io=self._stac_io, client=self, **kwargs)

/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac_client/item_search.py in __init__(self, url, limit, bbox, datetime, intersects, ids, collections, query, sortby, fields, max_items, method, stac_io, client)
    171         else:
    172             self._stac_io = StacApiIO()
--> 173         self._stac_io.assert_conforms_to(ConformanceClasses.ITEM_SEARCH)
    174 
    175         self._max_items = max_items

/srv/conda/envs/notebook/lib/python3.8/site-packages/pystac_client/stac_api_io.py in assert_conforms_to(self, conformance_class)
    212         """
    213         if not self.conforms_to(conformance_class):
--> 214             raise NotImplementedError(f"{conformance_class} not supported")
    215         else:
    216             return True

NotImplementedError: ConformanceClasses.ITEM_SEARCH not supported

@TomAugspurger
Copy link

The staging deployment is going through some changes. Does using https://planetarycomputer-staging.microsoft.com/api/stac/v1 work for you?

@thuydotm
Copy link
Contributor

thuydotm commented Sep 1, 2021

Thanks for the insights. The staging doesn't work. "https://planetarycomputer.microsoft.com/api/stac/v1 works though.

@tcmetzger
Copy link
Contributor Author

@tom this PR should now be up to date with main. It now also includes the census notebook which I renamed to fit the pattern of the other notebooks. I also added a link to the next notebook at the end, as we have for all the other notebooks. I think this PR is now ready to merge!

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.

4 participants