Skip to content

Commit

Permalink
reset ai between runs
Browse files Browse the repository at this point in the history
  • Loading branch information
kif committed Jun 28, 2023
1 parent 0ded734 commit fc0ad25
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyFAI/test/test_azimuthal_integrator.py
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def print_mem():
logger.error("psutil missing")
else:
logger.warning("Memory consumption: %s",psutil.virtual_memory())
ai = AzimuthalIntegrator.sload(self.ai) #make an empty copy and work on just one module
ai = AzimuthalIntegrator.sload(self.ai) #make an empty copy and work on just one module of the detector (much faster)
ai.detector = detector_factory("Pilatus_100k")
img = self.img[:ai.detector.shape[0],:ai.detector.shape[1]]

Expand All @@ -676,6 +676,7 @@ def print_mem():
failed = []
for m in methods.values():
res = ai.integrate2d_ng(img, 11, 13, variance=variance, error_model=error_model, method=m)
ai.reset()
v = res.sum_variance
if v.min()< 0:
failed.append(f"min variance is positive or null with {res.method}, error model {error_model.as_str()}")
Expand Down

0 comments on commit fc0ad25

Please sign in to comment.