pystac icon indicating copy to clipboard operation
pystac copied to clipboard

Add convenience method for accessing pystac_client

Open jsignell opened this issue 1 year ago • 2 comments

Related Issue(s):

  • Closes #1334

Description:

from pystac.client import Client

PR Checklist:

  • [x] pre-commit hooks pass locally
  • [x] Tests pass (run scripts/test)
  • [ ] Documentation has been updated to reflect changes, if applicable
  • [x] 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.

jsignell avatar Jul 16 '24 16:07 jsignell

Codecov Report

Attention: Patch coverage is 38.46154% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.19%. Comparing base (a88906b) to head (1ea5ae6). Report is 41 commits behind head on main.

Files with missing lines Patch % Lines
pystac/client.py 38.46% 7 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1365      +/-   ##
==========================================
- Coverage   91.28%   91.19%   -0.10%     
==========================================
  Files          51       52       +1     
  Lines        7221     7234      +13     
  Branches     1018     1019       +1     
==========================================
+ Hits         6592     6597       +5     
- Misses        450      457       +7     
- Partials      179      180       +1     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Jul 16 '24 16:07 codecov[bot]

I can either ignore this file in coverage or I can try to figure out a test for the the case where pystac_client is not importable.

jsignell avatar Jul 16 '24 18:07 jsignell

All right! I ended up ignoring mypy. Mypy passes if pystac_client is installed, but it didn't seem worth it to try to mock out a stub or something. Another option I suppose would be to add pystac_client as a test requirement, but that might not be desirable.

jsignell avatar Aug 06 '24 16:08 jsignell

I just added a smidge of docs:

Screenshot from 2024-08-06 11-26-12

jsignell avatar Aug 06 '24 16:08 jsignell

Love it! Thank you 🙏

alexgleith avatar Aug 06 '24 21:08 alexgleith