From e2c0aa8d4196fb0c39ab9f5b31581413b69b9c10 Mon Sep 17 00:00:00 2001 From: "Soroosh.Mani" Date: Fri, 17 Nov 2023 09:52:06 -0500 Subject: [PATCH] WIP2: Fixing remaining permission issues due to open files --- ocsmesh/hfun/collector.py | 4 ++++ tests/api/hfun.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ocsmesh/hfun/collector.py b/ocsmesh/hfun/collector.py index c17f5ddc..44c776db 100644 --- a/ocsmesh/hfun/collector.py +++ b/ocsmesh/hfun/collector.py @@ -832,6 +832,10 @@ def msh_t(self) -> jigsaw_msh_t: rast = self._create_big_raster(temp_dir) hfun = self._apply_features_fast(rast) composite_hfun = self._get_hfun_composite_fast(hfun) + # So that the tempfiles are deleted and the dir can be + # safely removed + del rast + del hfun else: raise ValueError(f"Invalid method specified: {self._method}") diff --git a/tests/api/hfun.py b/tests/api/hfun.py index dbd4274b..4b72019d 100755 --- a/tests/api/hfun.py +++ b/tests/api/hfun.py @@ -513,8 +513,8 @@ def test_calculated_size(self): hfun_val_diff = self.hfun_orig_val - hfun_calc_val # TODO: Come up with a more robust criteria! - threshold = 0.21 - err_value = np.max(np.abs(hfun_val_diff))/np.max(self.hfun_orig_val) + threshold = 0.05 + err_value = np.mean(np.abs(hfun_val_diff))/np.mean(self.hfun_orig_val) self.assertTrue(err_value < threshold)