From deca2f598ad4530cc538758fadca5a06b4a5681a Mon Sep 17 00:00:00 2001 From: Alejandro Jose Leiva Palomo Date: Wed, 6 Sep 2023 16:10:52 -0600 Subject: [PATCH] fix: remove parameter aggregation from assembly and remove label being shown in assembled profile Signed-off-by: Alejandro Jose Leiva Palomo --- trestle/core/commands/author/profile.py | 29 ------------------------- 1 file changed, 29 deletions(-) diff --git a/trestle/core/commands/author/profile.py b/trestle/core/commands/author/profile.py index 94a652bf5..d35777d66 100644 --- a/trestle/core/commands/author/profile.py +++ b/trestle/core/commands/author/profile.py @@ -269,7 +269,6 @@ def _replace_modify_set_params( new_set_params.append( prof.SetParameter( param_id=key, - label=param.label, values=param.values, select=param.select, props=param.props @@ -285,26 +284,6 @@ def _replace_modify_set_params( profile.modify.set_parameters = none_if_empty(profile.modify.set_parameters) return changed - @staticmethod - def _add_aggregated_parameter(param: Any, param_dict: Dict[str, Any]) -> None: - """ - Add aggregated parameter value to original parameter. - - Notes: - None - """ - # verifies aggregated param is not on grabbed param dict - agg_props = [prop for prop in as_list(param.props) if prop.name == const.AGGREGATES] - for prop in as_list(agg_props): - if param_dict[prop.value].get('values'): - agg_param_values = param_dict[prop.value].get('values') - param.values = param.values if param.values is not None else [] - for value in as_list(agg_param_values): - param.values.append(value) - dict_param = ModelUtils.parameter_to_dict(param, False) - param_dict[param.id] = dict_param - return None - @staticmethod def assemble_profile( trestle_root: pathlib.Path, @@ -374,14 +353,6 @@ def assemble_profile( catalog_api = CatalogAPI(catalog=catalog, context=context) found_alters, param_dict, param_map = catalog_api.read_additional_content_from_md(label_as_key=True) - controls = {} - for group in as_list(catalog.groups): - for control in as_list(group.controls): - controls[control.id] = control.params - for _, params in controls.items(): - for param in as_list(params): - ProfileAssemble._add_aggregated_parameter(param, param_dict) - # technically if allowed sections is [] it means no sections are allowed if allowed_sections is not None: for bad_part in [ part for alter in found_alters for add in as_list(alter.adds)