Skip to content

Commit

Permalink
Merge pull request #150 from haddocking/149
Browse files Browse the repository at this point in the history
Solves missing repeated modules during `prepare_run`
  • Loading branch information
rvhonorato committed Nov 25, 2021
2 parents dec00c4 + f8e4755 commit f33ef44
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/haddock/gear/prepare_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,24 +72,23 @@ def setup_run(workflow_path, restart_from=None):
A dictionary with the general run parameters.
"""
params = read_config(workflow_path)

# validates the configuration file
validate_params(params)

# pre-treats the configuration file
convert_params_to_path(params)
copy_molecules_to_topology(params)

modules_keys = [
k
for k in params.keys()
if get_module_name(k) in modules_category
]

# get a dictionary without the general config keys
general_params = remove_dict_keys(
params,
list(modules_category.keys()),
)
general_params = remove_dict_keys(params, modules_keys)

modules_params = remove_dict_keys(
params,
list(general_params.keys()),
)
modules_params = remove_dict_keys(params, list(general_params.keys()))

validate_modules_params(modules_params)
validate_installed_modules(modules_params)
Expand Down Expand Up @@ -198,8 +197,8 @@ def validate_installed_modules(params):
module_import_name = '.'.join([
'haddock',
'modules',
modules_category[module_name],
module_name,
modules_category[get_module_name(module_name)],
get_module_name(module_name),
])
module_lib = importlib.import_module(module_import_name)
try:
Expand Down

0 comments on commit f33ef44

Please sign in to comment.