diff --git a/func_adl_uproot/transformer.py b/func_adl_uproot/transformer.py index 6a5855c..00b5a38 100644 --- a/func_adl_uproot/transformer.py +++ b/func_adl_uproot/transformer.py @@ -438,7 +438,9 @@ def visit_Call(self, node): + "(logging.getLogger(__name__).info('Using treename='" + ' + repr(tree_name_to_use)),' + ' uproot.dask({input_file: tree_name_to_use' - + ' for input_file in input_files}, filter_branch=' + branch_filter_name + '))[1])' + + ' for input_file in input_files}, filter_branch=' + + branch_filter_name + + '))[1])' + '(' + source_rep + ', ' diff --git a/func_adl_uproot/translation.py b/func_adl_uproot/translation.py index 1d618fe..b9b21b5 100644 --- a/func_adl_uproot/translation.py +++ b/func_adl_uproot/translation.py @@ -6,7 +6,10 @@ from .transformer import branch_filter_name, input_filenames_argument_name, tree_name_argument_name # Adapted from https://github.com/CoffeaTeam/coffea/blob/v2024.4.0/src/coffea/util.py#L217-L248 -remove_not_interpretable_source = ''' def ''' + branch_filter_name + '''(branch): +remove_not_interpretable_source = ( + ' def ' + + branch_filter_name + + '''(branch): if isinstance(branch.interpretation, uproot.interpretation.identify.uproot.AsGrouped): for name, interpretation in branch.interpretation.subbranches.items(): if isinstance( @@ -32,6 +35,7 @@ return True ''' +) def python_ast_to_python_source(python_ast):