From 8fe4a62b182742b100232acc41125ffc863946b7 Mon Sep 17 00:00:00 2001 From: Luke Zoltan Kelley Date: Sat, 13 Apr 2024 14:35:10 -0700 Subject: [PATCH] Cleanup --- holodeck/librarian/combine.py | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/holodeck/librarian/combine.py b/holodeck/librarian/combine.py index ded49fd6..321f0617 100644 --- a/holodeck/librarian/combine.py +++ b/holodeck/librarian/combine.py @@ -100,23 +100,6 @@ def sam_lib_combine(path_output, log, path_pspace=None, recreate=False, gwb_only # ---- load parameter space from save file - ''' - if path_pspace is None: - # look for parameter-space save files - regex = "*" + holo.librarian.PSPACE_FILE_SUFFIX # "*.pspace.npz" - files = sorted(path_output.glob(regex)) - num_files = len(files) - msg = f"found {num_files} pspace.npz files in {path_output}" - log.info(msg) - if num_files != 1: - log.exception(msg) - log.exception(f"{files=}") - log.exception(f"{regex=}") - raise RuntimeError(f"{msg}") - path_pspace = files[0] - - pspace = _Param_Space.from_save(path_pspace, log) - ''' if path_pspace is None: path_pspace = path_output pspace, pspace_fname = libraries.load_pspace_from_path(path_pspace, log=log) @@ -202,6 +185,11 @@ def sam_lib_combine(path_output, log, path_pspace=None, recreate=False, gwb_only log.warning(f"Saved to {lib_path}, size: {holo.utils.get_file_size(lib_path)}") + with h5py.File(lib_path, 'r') as h5: + assert np.all(h5['fobs_cents'][()] > 0.0) + if has_gwb: + log.info(f"Checking library file: {holo.utils.stats(gwb)=}") + return lib_path