cleaned up caching and small fixes

This commit is contained in:
2023-09-14 11:29:52 +02:00
parent 787c863cd1
commit be01a75c68
4 changed files with 88 additions and 34 deletions

View File

@@ -27,6 +27,19 @@ def test_image_calculations():
453842.6]
assert np.allclose(res["JF16T03V01_intensity"], intensity)
def test_joblib_memory():
""" We need joblib for fast caching of intermediate results in all cases. So we check
if the basic function caching to disk works.
"""
def calc_example(x):
return x**2
calc_cached = cristallina.analysis.memory.cache(calc_example)
assert calc_cached(8) == 64
assert calc_cached.check_call_in_cache(8) == True
def test_minimal_2d_gaussian():
image = np.array([[0,0,0,0,0],