Skip to content

Commit

Permalink
Merge pull request #504 from pepkit/dev_270_rework
Browse files Browse the repository at this point in the history
Dev 270 rework
  • Loading branch information
donaldcampbelljr authored Jun 25, 2024
2 parents 7b2c229 + 34f3db7 commit ed410cc
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 24 deletions.
7 changes: 1 addition & 6 deletions looper/cli_pydantic.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,9 @@ def run_looper(args: TopLevelParser, parser: ArgumentParser, test_args=None):
looper_config_dict = read_looper_dotfile()
_LOGGER.info(f"Using looper config ({looper_cfg_path}).")

sample_modifiers_dict = None
cli_modifiers_dict = None
for looper_config_key, looper_config_item in looper_config_dict.items():
if looper_config_key == SAMPLE_MODS_KEY:
sample_modifiers_dict = looper_config_item
elif looper_config_key == CLI_MODS_KEY:
if looper_config_key == CLI_KEY:
cli_modifiers_dict = looper_config_item
else:
setattr(subcommand_args, looper_config_key, looper_config_item)
Expand Down Expand Up @@ -203,7 +200,6 @@ def run_looper(args: TopLevelParser, parser: ArgumentParser, test_args=None):
amendments=subcommand_args.amend,
divcfg_path=divcfg,
runp=subcommand_name == "runp",
sample_modifiers=sample_modifiers_dict,
**{
attr: getattr(subcommand_args, attr)
for attr in CLI_PROJ_ATTRS
Expand All @@ -219,7 +215,6 @@ def run_looper(args: TopLevelParser, parser: ArgumentParser, test_args=None):
amendments=subcommand_args.amend,
divcfg_path=divcfg,
runp=subcommand_name == "runp",
sample_modifiers=sample_modifiers_dict,
project_dict=PEPHubClient()._load_raw_pep(
registry_path=subcommand_args.config_file
),
Expand Down
3 changes: 0 additions & 3 deletions looper/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@
"DEBUG_EIDO_VALIDATION",
"LOOPER_GENERIC_OUTPUT_SCHEMA",
"LOOPER_GENERIC_COUNT_LINES",
"CLI_MODS_KEY",
"PipelineLevel",
]

Expand Down Expand Up @@ -224,8 +223,6 @@ def _get_apperance_dict(type, templ=APPEARANCE_BY_FLAG):
SAMPLE_PL_ARG = "sample_pipeline_interfaces"
PROJECT_PL_ARG = "project_pipeline_interfaces"

CLI_MODS_KEY = "cli_modifiers"


DEFAULT_CFG_PATH = os.path.join(os.getcwd(), LOOPER_DOTFILE_NAME)
CLI_PROJ_ATTRS = [
Expand Down
13 changes: 0 additions & 13 deletions looper/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,19 +131,6 @@ def __init__(self, cfg=None, amendments=None, divcfg_path=None, **kwargs):
except NotImplementedError:
self.name = None

# consolidate sample modifiers
if kwargs.get(SAMPLE_MODS_KEY) and self._modifier_exists():
_LOGGER.warning(
"Sample modifiers were provided in Looper Config and in PEP Project Config. Merging..."
)
deep_update(self.config["sample_modifiers"], kwargs.get(SAMPLE_MODS_KEY))
_LOGGER.debug(
msg=f"Merged sample modifiers: {self.config['sample_modifiers']}"
)
elif kwargs.get(SAMPLE_MODS_KEY):
self.config.setdefault("sample_modifiers", {})
self.config["sample_modifiers"] = kwargs.get(SAMPLE_MODS_KEY)

# add sample pipeline interface to the project
if kwargs.get(SAMPLE_PL_ARG):
self.set_sample_piface(kwargs.get(SAMPLE_PL_ARG))
Expand Down
6 changes: 4 additions & 2 deletions looper/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,8 @@ def enrich_args_via_cfg(
if getattr(parser_args, key, None):
new_value = getattr(parser_args, key)
cfg_args_all[key] = new_value
else:
cfg_args_all = {}

looper_config_cli_modifiers = None
if cli_modifiers:
Expand Down Expand Up @@ -604,8 +606,8 @@ def read_looper_config_file(looper_config_path: str) -> dict:
if SAMPLE_MODS_KEY in dp_data:
return_dict[SAMPLE_MODS_KEY] = dp_data[SAMPLE_MODS_KEY]

if CLI_MODS_KEY in dp_data:
return_dict[CLI_MODS_KEY] = dp_data[CLI_MODS_KEY]
if CLI_KEY in dp_data:
return_dict[CLI_KEY] = dp_data[CLI_KEY]

if PIPELINE_INTERFACES_KEY in dp_data:

Expand Down

0 comments on commit ed410cc

Please sign in to comment.