Skip to content

Commit

Permalink
fix loader specification
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyleung521 committed May 13, 2024
1 parent 16a6d3c commit c9412e1
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/westpa/core/propagators/executable.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,22 +345,27 @@ def __init__(self, rc=None):
loader_directive = dsinfo.get('loader', None)
if callable(loader_directive): # If directly callable, then use it
loader = loader_directive
elif dsname in ['pcoord', 'seglog', 'restart']: # These are "protected" dataset names
if loader_directive in data_loaders.keys():
loader = data_loaders[loader_directive]
else:
loader = get_object(loader_directive)
elif dsname in ['trajectory']: # Special dataset for saving trajectory coordinates in HDF5 Framework
if 'module_path' in dsinfo.keys():
if 'module_path' in dsinfo:
dspath = self.makepath(dsinfo['module_path'])
else:
dspath = None
if loader_directive in trajectory_loaders.keys():

if loader_directive in trajectory_loaders:
loader = trajectory_loaders[loader_directive]
else:
loader = get_object(loader_directive, path=dspath)
else: # Assumed aux dataset, defaulting to aux_data_loader
loader = aux_data_loader
elif dsname not in ['pcoord', 'seglog', 'restart']: # If not a "protected" dataset names
if loader_directive in data_loaders:
loader = data_loaders[loader_directive]
elif loader_directive is None:
# Defaulting to auxdata loader
loader = aux_data_loader
else:
loader = get_object(loader_directive)
else:
# YOLO. Or maybe it wasn't specified.
loader = loader_directive

if loader:
dsinfo['loader'] = loader
Expand Down

0 comments on commit c9412e1

Please sign in to comment.