diff --git a/GaudiConf/python/GaudiConf/QMTest/LHCbExclusions.py b/GaudiConf/python/GaudiConf/QMTest/LHCbExclusions.py index 699719c5e9b034f54ac013ba23be6245ca78fe30..19f2df2fd976e1134103d634cddd0d4d7913d15d 100755 --- a/GaudiConf/python/GaudiConf/QMTest/LHCbExclusions.py +++ b/GaudiConf/python/GaudiConf/QMTest/LHCbExclusions.py @@ -149,7 +149,12 @@ preprocessor = ( r'.*SUCCESS (Exceptions/Errors/Warnings/Infos Statistics :| #WARNINGS =| #ERRORS =|List of booked \dD histograms in directory).*' ) + # TODO To be removed when GaudiAlgorithm is gone and thus this output line is no more present - SortGroupOfLines(r'CompareTracksTr.*DEBUG Changing \S* to \S*')) + SortGroupOfLines(r'CompareTracksTr.*DEBUG Changing \S* to \S*') + + RegexpReplacer( # normalize any timing prints + when="INFO", + orig=r'\d+\.*\d*(\s+(ns|us|ms|seconds|s|minutes|min)(\s+|\.|$))', + repl=r'n\1', + )) try: from DDDB.Configuration import GIT_CONDDBS diff --git a/PyConf/python/PyConf/components.py b/PyConf/python/PyConf/components.py index af32d030c33d9362078b7800183c8c5ec2cacbf9..46a4826e4fd3f7a4660ce9f0b302d00464945484 100644 --- a/PyConf/python/PyConf/components.py +++ b/PyConf/python/PyConf/components.py @@ -232,6 +232,18 @@ def _ids_from_list(handles): return tuple(h.id for h in handles) +def _gather_extra_inputs(io_dict): + """Returns a list of extra_inputs contained in io_dict""" + d = [] + for k, v in io_dict.items(): + if k.endswith(_DATA_DEPENDENCY_KEY_SUFFIX): + if isinstance(v, list): + d += [vv.location for vv in v] + else: + d.append(v.location) + return d + + def _gather_locations(io_dict): """Return the dictionary with all values mapped to their `.location` property. @@ -822,6 +834,16 @@ class Algorithm(object): input_dict = _gather_locations(self.inputs) output_dict = _gather_locations(self.outputs) + # get the functor data dependencies to add them to ExtraInputs + extra_inputs = _gather_extra_inputs(self.inputs) + if extra_inputs: + # ExtraInputs is also a property so we need to be careful to not + # overwrite it if its there, but only extend it. + cfg['ExtraInputs'] = cfg.get('ExtraInputs', []) + extra_inputs + # I don't think duplicates would matter but it's easy to declutter + # here so let's quickly do it + cfg['ExtraInputs'] = sorted(set(cfg['ExtraInputs'])) + if self._input_transform: input_dict = self._input_transform(**input_dict) @@ -1170,6 +1192,16 @@ class Tool(object): cfg = config[(self.type, name)] = self.properties.copy() input_dict = _gather_locations(self.inputs) tools_dict = _gather_tool_names(self.tools) + # get the functor data dependencies to add them to ExtraInputs + extra_inputs = _gather_extra_inputs(self.inputs) + if extra_inputs: + # ExtraInputs is also a property so we need to be careful to not + # overwrite it if its there, but only extend it. + cfg['ExtraInputs'] = cfg.get('ExtraInputs', []) + extra_inputs + # I don't think duplicates would matter but it's easy to declutter + # here so let's quickly do it + cfg['ExtraInputs'] = sorted(set(cfg['ExtraInputs'])) + if conflict := _dict_add(cfg, input_dict): raise ConfigurationError(f"input properties try to overwrite " f"already set properties: {conflict}")