griffithlab / civicpy

A python interface for the CIViC db application
MIT License
9 stars 5 forks source link

caching enhancements and get_all_evidence() function #30

Closed ahwagner closed 5 years ago

ahwagner commented 5 years ago

This PR started with a very minor addition, to add a get_all_evidence() function.

Then I went to add a unit test for it, and things got crazy. I realized that you could have either a local cache that gets stale after 7 days, OR load a remote cache on each session. However, the ideal solution is maintaining a local cache that is refreshed from the precomputed remote cache once stale. ebd3875 addresses this with an extended update_cache routine. The upcate_cache behavior is configurable through the use of the from_remote_cache flag (if set to False, it will do the normal CIViCpy queries and compute the cache).

Let me know what you think.

ahwagner commented 5 years ago

Needs more docstrings.

ahwagner commented 5 years ago

I've cleaned up the PR a bit. Commit 3d33f71 drops some unnecessary routines, renames others, and adds docstrings!

Ready (again) for your review, @susannasiebert. Merge to version if you think it looks good.