Skip to content

Add lru_caches #167

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 2 commits into from
May 25, 2022
Merged

Add lru_caches #167

merged 2 commits into from
May 25, 2022

Conversation

gadomski
Copy link
Member

@gadomski gadomski commented May 20, 2022

Related Issue(s):

Description:
The LRU caches are only applied to functions that return fully-fetched values (e.g. an ItemCollection), not applied to generators. This limits the number of places the cache can be used.

PR Checklist:

  • Code is formatted
  • Tests pass
  • Changes are added to the CHANGELOG

@gadomski gadomski requested a review from matthewhanson May 20, 2022 18:57
@codecov-commenter
Copy link

codecov-commenter commented May 20, 2022

Codecov Report

Merging #167 (2c0133c) into main (dbdc3a4) will increase coverage by 0.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #167      +/-   ##
==========================================
+ Coverage   81.00%   81.20%   +0.20%     
==========================================
  Files           9        9              
  Lines         558      564       +6     
==========================================
+ Hits          452      458       +6     
  Misses        106      106              
Impacted Files Coverage Δ
pystac_client/client.py 79.36% <100.00%> (+0.67%) ⬆️
pystac_client/item_search.py 88.52% <100.00%> (+0.19%) ⬆️

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 dbdc3a4...2c0133c. Read the comment docs.

@gadomski gadomski force-pushed the issues/101-caching branch from 2c0133c to b54bd0e Compare May 20, 2022 19:32
@gadomski gadomski requested a review from philvarner May 24, 2022 15:27
@gadomski gadomski force-pushed the issues/101-caching branch from b54bd0e to 5407c8c Compare May 24, 2022 16:08
@gadomski gadomski requested a review from philvarner May 24, 2022 16:11
@gadomski gadomski force-pushed the issues/101-caching branch from 5407c8c to 5ba4cbd Compare May 25, 2022 14:42
@gadomski gadomski requested a review from philvarner May 25, 2022 14:43
@gadomski
Copy link
Member Author

@philvarner sorry to re-request review, but I forgot max_size on one of the decorators, and wanted to make sure you were ok with setting to 1 for all four usages.

gadomski added 2 commits May 25, 2022 12:09
Only applying to functions that return fully-fetched values (e.g. an ItemCollection). Not applying to generators.
@gadomski gadomski force-pushed the issues/101-caching branch from 5ba4cbd to 3b4b845 Compare May 25, 2022 18:09
@gadomski gadomski merged commit 0b310f0 into main May 25, 2022
@gadomski gadomski deleted the issues/101-caching branch May 25, 2022 18:16
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.

Cache results
3 participants