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

add API layout strategy #1294

Merged
merged 10 commits into from
Jan 10, 2024
Merged

Conversation

thomas-maschler
Copy link
Contributor

@thomas-maschler thomas-maschler commented Dec 23, 2023

Related Issue(s):

Description:
This PR implements the API Layout Strategy following the STAC API Specifications.
Unlike the Best Practice Layout Strategy, this strategy is not based on file paths. Instead, it uses HTTP endpoints. This requires refactoring of Catalog's add_child, add_item, and update_href methods not to remove the last path element. Instead, I moved this step into the HrefLayoutStrategy.get_href method and made it conditional based on whether the path is a file or not.

Together with #1295, this PR is part of setting the foundation for enabling API transactions using pystac-client.

PR Checklist:

  • pre-commit hooks pass locally
  • 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.

Copy link

codecov bot commented Dec 27, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (0407be2) 91.12% compared to head (0c372e0) 91.17%.
Report is 1 commits behind head on main.

❗ Current head 0c372e0 differs from pull request most recent head 199211c. Consider uploading reports for the commit 199211c to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1294      +/-   ##
==========================================
+ Coverage   91.12%   91.17%   +0.05%     
==========================================
  Files          51       51              
  Lines        6994     7015      +21     
  Branches     1001     1004       +3     
==========================================
+ Hits         6373     6396      +23     
+ Misses        444      443       -1     
+ Partials      177      176       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@jsignell jsignell left a comment

Choose a reason for hiding this comment

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

Sorry for the slow response. This looks really good to me. I was kind of surprised that this didn't exist yet in pystac.

pystac/utils.py Show resolved Hide resolved
@thomas-maschler
Copy link
Contributor Author

Thanks for the review. I added a docstring

@jsignell jsignell added this pull request to the merge queue Jan 10, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to a conflict with the base branch Jan 10, 2024
@thomas-maschler
Copy link
Contributor Author

@jsignell I had to resolve a conflict in the change log. Can you resubmit?

@jsignell jsignell added this pull request to the merge queue Jan 10, 2024
Merged via the queue into stac-utils:main with commit cf0ed8f Jan 10, 2024
18 checks passed
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