-
Notifications
You must be signed in to change notification settings - Fork 40
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
Use a consistent cache directory #268
Use a consistent cache directory #268
Conversation
Questions:
Interesting thought: maybe we could even make a napari widget for setting the cache directory path to something other than the default value. Then we could rely less on people reading every single page of the API documentation, and have better discoverability. |
Codecov Report
@@ Coverage Diff @@
## dev #268 +/- ##
==========================================
+ Coverage 38.34% 39.12% +0.77%
==========================================
Files 30 32 +2
Lines 3987 4118 +131
==========================================
+ Hits 1529 1611 +82
- Misses 2458 2507 +49
📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today! |
No I don't think so. For me
There isn't really a place to put it yet. I have made a note in #249 on this.
I like that idea in principle, but we probably need to think a bit about the implementation and try how well it works in practice. I will make an issue out of this so that we can keep track of it. But I think we should only revisit this once we have made some more advances towards the plugin. |
763a2a3
into
computational-cell-analytics:dev
That's the behaviour I see too, but the pooch os_cache documentation does say "User directories ('~') are not expanded" so perhaps this may not always happen (or might not be guaranteed in the future). Anyway, I don't think this is causing problems, but I could do it if we felt we needed to be super safe. |
I see. Then maybe it's a good idea to expand the path since it should not hurt. |
Closes #264
This PR should make the cache directory handling consistent between the model weights and sample data.
By default, we use:
From the pooch.os_cache() docs:
Additionally, users can set an environment variable named
MICROSAM_CACHEDIR
to choose a different cache directory somewhere else (not the default cache dir + 'micro_sam').The documentation for the environment variable cache dir control is a bit hidden, currently it is only mentioned:
micro_sam/sample_data.py
, andget_sam_model
function inmicro_sam/util.py
.