Skip to content

Commit

Permalink
Add separate names for combined simulation 'library' and 'domain'
Browse files Browse the repository at this point in the history
  • Loading branch information
lzkelley committed Apr 29, 2024
1 parent ae11d21 commit 860ff0d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@

* Semi-Analytic Models
* Improve accuracy of dynamic binary number calculation for consistent evolution models.
* `holodeck.librarian`
* Added functionality to construct 'domain' sets of simulations, to explore each parameter in a parameter-space one at a time.
* NOTE: Standard library files will now be called "sam-library.hdf5" instead of "sam_lib.hdf5"


## v1.5.2 - 2024/04/12
Expand Down
2 changes: 2 additions & 0 deletions holodeck/librarian/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@
FNAME_DOMAIN_SIM_FILE = "domain__p{pnum:06d}.npz"
DIRNAME_LIBRARY_SIMS = "library_sims"
DIRNAME_DOMAIN_SIMS = "domain_sims"
FNAME_LIBRARY_COMBINED_FILE = "sam-library" # do NOT include file suffix (i.e. 'hdf5')
FNAME_DOMAIN_COMBINED_FILE = "sam-domain" # do NOT include file suffix (i.e. 'hdf5')
PSPACE_FILE_SUFFIX = ".pspace.npz"
ARGS_CONFIG_FNAME = "config.json"

Expand Down
11 changes: 9 additions & 2 deletions holodeck/librarian/libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from holodeck.constants import YR
from holodeck.librarian import (
DEF_NUM_FBINS, DEF_NUM_LOUDEST, DEF_NUM_REALS, DEF_PTA_DUR,
FNAME_LIBRARY_COMBINED_FILE, FNAME_DOMAIN_COMBINED_FILE,
)

PARAM_NAMES__ERROR = [
Expand Down Expand Up @@ -1021,8 +1022,14 @@ def _get_sim_fname(path, pnum, library=True):
return temp


def get_sam_lib_fname(path, gwb_only):
fname = 'sam_lib'
def get_sam_lib_fname(path, gwb_only, library=True):
# standard 'library'
if library:
fname = FNAME_LIBRARY_COMBINED_FILE
# 'domain' of parameter space
else:
fname = FNAME_DOMAIN_COMBINED_FILE

if gwb_only:
fname += "_gwb-only"
lib_path = path.joinpath(fname).with_suffix(".hdf5")
Expand Down

0 comments on commit 860ff0d

Please sign in to comment.