Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #442 +/- ##
==========================================
- Coverage 72.89% 72.88% -0.02%
==========================================
Files 35 35
Lines 6091 6092 +1
==========================================
Hits 4440 4440
- Misses 1651 1652 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
To be clear, that's a feature that's already there ( |
| cache_path.mkdir(mode=666, exist_ok=True, parents=True) | ||
| np.save(cache_path / fname, mean_data) |
There was a problem hiding this comment.
While we're changing this, I might be inclined to catch and ignore PermissionError here, so you don't need to pass use_cache=False for XMPL proposals.
There was a problem hiding this comment.
Do you mean something like this? Inside the if use_cache or do you want to get rid of the use_cache=False option altogether?
| cache_path.mkdir(mode=666, exist_ok=True, parents=True) | |
| np.save(cache_path / fname, mean_data) | |
| try: | |
| cache_path.mkdir(mode=666, exist_ok=True, parents=True) | |
| np.save(cache_path / fname, mean_data) | |
| except PermissionError: | |
| pass |
There was a problem hiding this comment.
Yup, that's what I was thinking. I'd leave the use_cache option around as well - you might want to skip using the cache even if it works, e.g. if you suspect it might be outdated.
Hmm, I don't think quite as we discussed unless I missed something? The documentation suggests that
|
Co-authored-by: Thomas Kluyver <thomas.kluyver@xfel.eu>
That's right: I meant that it gives you the option to load & average the data separately, so then you can save/load a prepared array yourself rather than relying on the caching behaviour. |
tmichela
left a comment
There was a problem hiding this comment.
+1 to @takluyver 's comment.
Could you also add a clear_cache method? Now that the cache can't be updated anymore, we need a way to remove it, other than navigating the filesystem.
| Changed: | ||
|
|
||
| - [SpectrometerCalibration][extra.gui.jupyter.SpectrometerCalibration] no longer | ||
| saves loaded data to cache if `user_cache=False`. |
There was a problem hiding this comment.
| saves loaded data to cache if `user_cache=False`. | |
| saves loaded data to cache if `use_cache=False`. |
Changed the scope of the
use_cacheoption in theSpectrometerCalibrationmethod so that it doesn't attempt to create a directory or save the averaged data into it.The reason behind this is that I was trying to open a run from XMPL where I have read but not write access (even to
${proposal}/scratch). This problem could come up in other cases as well, not just with XMPL, if a DA person has access to a proposal but is not part of it.There are other alternatives/possible additions to the proposed propsoed including:
out=option inextra.data) [@takluyver ]${proposal}/scratch. For example,${HOME}/.cache/extraor something like that.These options were discussed on Zulip with @turkot, @philsmt, and @takluyver.