From c3c90e8c2abe6595fc72dcb89deda8f12f597f23 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Tue, 7 Nov 2023 17:51:18 -0600 Subject: [PATCH 1/5] switch permit_dask to True by default --- src/coffea/nanoevents/factory.py | 83 +++++----------------- src/coffea/nanoevents/schemas/auto.py | 4 +- src/coffea/nanoevents/schemas/base.py | 4 +- src/coffea/nanoevents/schemas/delphes.py | 4 +- src/coffea/nanoevents/schemas/nanoaod.py | 4 +- src/coffea/nanoevents/schemas/pdune.py | 4 +- src/coffea/nanoevents/schemas/physlite.py | 4 +- src/coffea/nanoevents/schemas/treemaker.py | 4 +- tests/test_analysis_tools.py | 2 +- 9 files changed, 32 insertions(+), 81 deletions(-) diff --git a/src/coffea/nanoevents/factory.py b/src/coffea/nanoevents/factory.py index b6656282f..7af50cd4c 100644 --- a/src/coffea/nanoevents/factory.py +++ b/src/coffea/nanoevents/factory.py @@ -20,14 +20,7 @@ TrivialUprootOpener, UprootSourceMapping, ) -from coffea.nanoevents.schemas import ( - BaseSchema, - DelphesSchema, - NanoAODSchema, - PFNanoAODSchema, - PHYSLITESchema, - TreeMakerSchema, -) +from coffea.nanoevents.schemas import BaseSchema, NanoAODSchema from coffea.nanoevents.util import key_to_tuple, quote, tuple_to_key, unquote _offsets_label = quote(",!offsets") @@ -240,7 +233,7 @@ def __setstate__(self, state): def from_root( cls, file, - treepath="/Events", + treepath=uproot._util.unset, entry_start=None, entry_stop=None, chunks_per_file=uproot._util.unset, @@ -252,7 +245,7 @@ def from_root( access_log=None, iteritems_options={}, use_ak_forth=True, - permit_dask=False, + permit_dask=True, ): """Quickly build NanoEvents from a root file @@ -287,42 +280,24 @@ def from_root( permit_dask: Allow nanoevents to use dask as a backend. """ + + if treepath is not uproot._util.unset and not isinstance( + file, uproot.reading.ReadOnlyDirectory + ): + raise ValueError( + """Specification of treename by argument to from_root is no longer supported in coffea 2023. + Please use one of the allow types for "files" specified by uproot: https://github.com/scikit-hep/uproot5/blob/v5.1.2/src/uproot/_dask.py#L109-L132 + """ + ) + if ( permit_dask and not isinstance(schemaclass, FunctionType) and schemaclass.__dask_capable__ ): - behavior = None - if schemaclass is BaseSchema: - from coffea.nanoevents.methods import base - - behavior = base.behavior - elif schemaclass is NanoAODSchema: - from coffea.nanoevents.methods import nanoaod - - behavior = nanoaod.behavior - elif schemaclass is PFNanoAODSchema: - from coffea.nanoevents.methods import nanoaod - - behavior = nanoaod.behavior - elif schemaclass is TreeMakerSchema: - from coffea.nanoevents.methods import base, vector - - behavior = {} - behavior.update(base.behavior) - behavior.update(vector.behavior) - elif schemaclass is PHYSLITESchema: - from coffea.nanoevents.methods import physlite - - behavior = physlite.behavior - elif schemaclass is DelphesSchema: - from coffea.nanoevents.methods import delphes - - behavior = delphes.behavior - map_schema = _map_schema_uproot( schemaclass=schemaclass, - behavior=dict(behavior), + behavior=dict(schemaclass.behavior()), metadata=metadata, version="latest", ) @@ -360,7 +335,7 @@ def from_root( tree = file[treepath] elif "" == str(type(file)): raise RuntimeError( - "The file instance (%r) is an uproot3 type, but this module is only compatible with uproot4 or higher" + "The file instance (%r) is an uproot3 type, but this module is only compatible with uproot5 or higher" % file ) else: @@ -463,33 +438,9 @@ def from_parquet( and not isinstance(schemaclass, FunctionType) and schemaclass.__dask_capable__ ): - behavior = None - if schemaclass is BaseSchema: - from coffea.nanoevents.methods import base - - behavior = base.behavior - elif schemaclass is NanoAODSchema: - from coffea.nanoevents.methods import nanoaod - - behavior = nanoaod.behavior - elif schemaclass is TreeMakerSchema: - from coffea.nanoevents.methods import base, vector - - behavior = {} - behavior.update(base.behavior) - behavior.update(vector.behavior) - elif schemaclass is PHYSLITESchema: - from coffea.nanoevents.methods import physlite - - behavior = physlite.behavior - elif schemaclass is DelphesSchema: - from coffea.nanoevents.methods import delphes - - behavior = delphes.behavior - map_schema = _map_schema_parquet( schemaclass=schemaclass, - behavior=dict(behavior), + behavior=dict(schemaclass.behavior()), metadata=metadata, version="latest", ) @@ -713,7 +664,7 @@ def events(self): events = self._events() if events is None: - behavior = dict(self._schema.behavior) + behavior = dict(self._schema.behavior()) behavior["__events_factory__"] = self events = awkward.from_buffers( self._schema.form, diff --git a/src/coffea/nanoevents/schemas/auto.py b/src/coffea/nanoevents/schemas/auto.py index 5565c8648..60d8a701a 100644 --- a/src/coffea/nanoevents/schemas/auto.py +++ b/src/coffea/nanoevents/schemas/auto.py @@ -109,8 +109,8 @@ def __init__(self, base_form: Dict[str, Any]): v for v in output.values() ] - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import base, candidate diff --git a/src/coffea/nanoevents/schemas/base.py b/src/coffea/nanoevents/schemas/base.py index 8a1f2251e..59a4b4285 100644 --- a/src/coffea/nanoevents/schemas/base.py +++ b/src/coffea/nanoevents/schemas/base.py @@ -125,8 +125,8 @@ def form(self): """Awkward form of this schema""" return self._form - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import base diff --git a/src/coffea/nanoevents/schemas/delphes.py b/src/coffea/nanoevents/schemas/delphes.py index 4c3c06c76..8bfccd6d0 100644 --- a/src/coffea/nanoevents/schemas/delphes.py +++ b/src/coffea/nanoevents/schemas/delphes.py @@ -297,8 +297,8 @@ def _preprocess_branch_form(objname, form): return output - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import delphes diff --git a/src/coffea/nanoevents/schemas/nanoaod.py b/src/coffea/nanoevents/schemas/nanoaod.py index e119d698c..56cd905e8 100644 --- a/src/coffea/nanoevents/schemas/nanoaod.py +++ b/src/coffea/nanoevents/schemas/nanoaod.py @@ -321,8 +321,8 @@ def _build_collections(self, field_names, input_contents): return output.keys(), output.values() - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import nanoaod diff --git a/src/coffea/nanoevents/schemas/pdune.py b/src/coffea/nanoevents/schemas/pdune.py index 64534a9b3..c11086341 100644 --- a/src/coffea/nanoevents/schemas/pdune.py +++ b/src/coffea/nanoevents/schemas/pdune.py @@ -225,8 +225,8 @@ def _build_collections(self, branch_forms): # } # return form - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import pdune diff --git a/src/coffea/nanoevents/schemas/physlite.py b/src/coffea/nanoevents/schemas/physlite.py index 368dc7d8a..2a17e1892 100644 --- a/src/coffea/nanoevents/schemas/physlite.py +++ b/src/coffea/nanoevents/schemas/physlite.py @@ -157,8 +157,8 @@ def _create_eventindex_form(base_form, key): } return form - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import physlite diff --git a/src/coffea/nanoevents/schemas/treemaker.py b/src/coffea/nanoevents/schemas/treemaker.py index 6663f0ef4..bf89971f4 100644 --- a/src/coffea/nanoevents/schemas/treemaker.py +++ b/src/coffea/nanoevents/schemas/treemaker.py @@ -164,8 +164,8 @@ def _build_collections(self, branch_forms): return branch_forms - @property - def behavior(self): + @classmethod + def behavior(cls): """Behaviors necessary to implement this schema""" from coffea.nanoevents.methods import base, vector diff --git a/tests/test_analysis_tools.py b/tests/test_analysis_tools.py index bb3221432..71d1d773e 100644 --- a/tests/test_analysis_tools.py +++ b/tests/test_analysis_tools.py @@ -10,7 +10,7 @@ fname = "tests/samples/nano_dy.root" eagerevents = NanoEventsFactory.from_root( {os.path.abspath(fname): "Events"}, - schemaclass=NanoAODSchema.v6, + schemaclass=NanoAODSchema, metadata={"dataset": "DYJets"}, ).events() dakevents = NanoEventsFactory.from_root( From 288e29fb1ef99ba61c6135439d068840936c5547 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Wed, 8 Nov 2023 12:59:26 -0600 Subject: [PATCH 2/5] oops! --- tests/test_analysis_tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_analysis_tools.py b/tests/test_analysis_tools.py index 71d1d773e..e7914a119 100644 --- a/tests/test_analysis_tools.py +++ b/tests/test_analysis_tools.py @@ -12,12 +12,12 @@ {os.path.abspath(fname): "Events"}, schemaclass=NanoAODSchema, metadata={"dataset": "DYJets"}, + permit_dask=False, ).events() dakevents = NanoEventsFactory.from_root( {os.path.abspath(fname): "Events"}, schemaclass=NanoAODSchema, metadata={"dataset": "DYJets"}, - permit_dask=True, ).events() uprootevents = uproot.dask({fname: "Events"}) From de180281a4db700904d8797a5e82b76a9673aa07 Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Wed, 8 Nov 2023 13:39:16 -0600 Subject: [PATCH 3/5] more permit_dask=False --- tests/test_nanoevents.py | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/tests/test_nanoevents.py b/tests/test_nanoevents.py index 9bfcdd6b9..574ed1630 100644 --- a/tests/test_nanoevents.py +++ b/tests/test_nanoevents.py @@ -71,9 +71,11 @@ def crossref(events): def test_read_nanomc(suffix): path = os.path.abspath(f"tests/samples/nano_dy.{suffix}") # parquet files were converted from even older nanoaod - nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5 + nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, schemaclass=nanoversion + {path: "Events"}, + schemaclass=nanoversion, + permit_dask=False, ) events = factory.events() @@ -132,9 +134,11 @@ def test_read_from_uri(suffix): path = Path(os.path.abspath(f"tests/samples/nano_dy.{suffix}")).as_uri() - nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5 + nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, schemaclass=nanoversion + {path: "Events"}, + schemaclass=nanoversion, + permit_dask=False, ) events = factory.events() @@ -145,9 +149,11 @@ def test_read_from_uri(suffix): def test_read_nanodata(suffix): path = os.path.abspath(f"tests/samples/nano_dimuon.{suffix}") # parquet files were converted from even older nanoaod - nanoversion = NanoAODSchema.v6 if suffix == "root" else NanoAODSchema.v5 + nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, schemaclass=nanoversion + {path: "Events"}, + schemaclass=nanoversion, + permit_dask=False, ) events = factory.events() @@ -158,7 +164,7 @@ def test_read_nanodata(suffix): def test_missing_eventIds_error(): path = os.path.abspath("tests/samples/missing_luminosityBlock.root") + ":Events" with pytest.raises(RuntimeError): - factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema) + factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema, permit_dask=False) factory.events() @@ -168,7 +174,7 @@ def test_missing_eventIds_warning(): RuntimeWarning, match=r"Missing event_ids \: \[\'luminosityBlock\'\]" ): NanoAODSchema.error_missing_event_ids = False - factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema) + factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema, permit_dask=False) factory.events() From d2d1cfc4e3bb0761d90e08b13a16622306f65be7 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 8 Nov 2023 19:39:32 +0000 Subject: [PATCH 4/5] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_nanoevents.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/tests/test_nanoevents.py b/tests/test_nanoevents.py index 574ed1630..f6b5da7b9 100644 --- a/tests/test_nanoevents.py +++ b/tests/test_nanoevents.py @@ -73,7 +73,7 @@ def test_read_nanomc(suffix): # parquet files were converted from even older nanoaod nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, + {path: "Events"}, schemaclass=nanoversion, permit_dask=False, ) @@ -136,7 +136,7 @@ def test_read_from_uri(suffix): nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, + {path: "Events"}, schemaclass=nanoversion, permit_dask=False, ) @@ -151,7 +151,7 @@ def test_read_nanodata(suffix): # parquet files were converted from even older nanoaod nanoversion = NanoAODSchema factory = getattr(NanoEventsFactory, f"from_{suffix}")( - {path: "Events"}, + {path: "Events"}, schemaclass=nanoversion, permit_dask=False, ) @@ -164,7 +164,9 @@ def test_read_nanodata(suffix): def test_missing_eventIds_error(): path = os.path.abspath("tests/samples/missing_luminosityBlock.root") + ":Events" with pytest.raises(RuntimeError): - factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema, permit_dask=False) + factory = NanoEventsFactory.from_root( + path, schemaclass=NanoAODSchema, permit_dask=False + ) factory.events() @@ -174,7 +176,9 @@ def test_missing_eventIds_warning(): RuntimeWarning, match=r"Missing event_ids \: \[\'luminosityBlock\'\]" ): NanoAODSchema.error_missing_event_ids = False - factory = NanoEventsFactory.from_root(path, schemaclass=NanoAODSchema, permit_dask=False) + factory = NanoEventsFactory.from_root( + path, schemaclass=NanoAODSchema, permit_dask=False + ) factory.events() From 57474ffb360ce53e6381fe538c3ffb9bbbd3555d Mon Sep 17 00:00:00 2001 From: Lindsey Gray Date: Thu, 9 Nov 2023 11:53:42 -0600 Subject: [PATCH 5/5] permit_dask -> delayed in NanoEventsFactory.from_X --- src/coffea/nanoevents/factory.py | 20 +++++++++++--------- src/coffea/processor/executor.py | 2 +- tests/test_analysis_tools.py | 2 +- tests/test_fix823.py | 1 - tests/test_jetmet_tools.py | 1 - tests/test_lookup_tools.py | 2 -- tests/test_nanoevents.py | 14 ++++++++------ tests/test_nanoevents_delphes.py | 4 +++- tests/test_nanoevents_pfnano.py | 4 +++- tests/test_nanoevents_physlite.py | 2 +- tests/test_nanoevents_treemaker.py | 2 +- 11 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/coffea/nanoevents/factory.py b/src/coffea/nanoevents/factory.py index 7af50cd4c..bc7b27d05 100644 --- a/src/coffea/nanoevents/factory.py +++ b/src/coffea/nanoevents/factory.py @@ -245,7 +245,7 @@ def from_root( access_log=None, iteritems_options={}, use_ak_forth=True, - permit_dask=True, + delayed=True, ): """Quickly build NanoEvents from a root file @@ -277,8 +277,8 @@ def from_root( Pass a list instance to record which branches were lazily accessed by this instance use_ak_forth: Toggle using awkward_forth to interpret branches in root file. - permit_dask: - Allow nanoevents to use dask as a backend. + delayed: + Nanoevents will use dask as a backend to construct a delayed task graph representing your analysis. """ if treepath is not uproot._util.unset and not isinstance( @@ -291,7 +291,7 @@ def from_root( ) if ( - permit_dask + delayed and not isinstance(schemaclass, FunctionType) and schemaclass.__dask_capable__ ): @@ -326,7 +326,7 @@ def from_root( **uproot_options, ) return cls(map_schema, opener, None, cache=None, is_dask=True) - elif permit_dask and not schemaclass.__dask_capable__: + elif delayed and not schemaclass.__dask_capable__: warnings.warn( f"{schemaclass} is not dask capable despite allowing dask, generating non-dask nanoevents" ) @@ -380,7 +380,7 @@ def from_root( def from_parquet( cls, file, - treepath="/Events", + treepath=uproot._util.unset, entry_start=None, entry_stop=None, runtime_cache=None, @@ -390,7 +390,7 @@ def from_parquet( parquet_options={}, skyhook_options={}, access_log=None, - permit_dask=False, + delayed=True, ): """Quickly build NanoEvents from a parquet file @@ -419,6 +419,8 @@ def from_parquet( Any options to pass to ``pyarrow.parquet.ParquetFile`` access_log : list, optional Pass a list instance to record which branches were lazily accessed by this instance + delayed: + Nanoevents will use dask as a backend to construct a delayed task graph representing your analysis. """ import pyarrow import pyarrow.dataset as ds @@ -434,7 +436,7 @@ def from_parquet( ) if ( - permit_dask + delayed and not isinstance(schemaclass, FunctionType) and schemaclass.__dask_capable__ ): @@ -453,7 +455,7 @@ def from_parquet( else: raise TypeError("Invalid file type (%s)" % (str(type(file)))) return cls(map_schema, opener, None, cache=None, is_dask=True) - elif permit_dask and not schemaclass.__dask_capable__: + elif delayed and not schemaclass.__dask_capable__: warnings.warn( f"{schemaclass} is not dask capable despite allowing dask, generating non-dask nanoevents" ) diff --git a/src/coffea/processor/executor.py b/src/coffea/processor/executor.py index 18ab1c8c5..76080e007 100644 --- a/src/coffea/processor/executor.py +++ b/src/coffea/processor/executor.py @@ -1678,7 +1678,7 @@ def _work_function( schemaclass=schema, metadata=metadata, access_log=materialized, - permit_dask=True, + delayed=True, ) events = factory.events()[item.entrystart : item.entrystop] elif format == "parquet": diff --git a/tests/test_analysis_tools.py b/tests/test_analysis_tools.py index e7914a119..bc3ebf05a 100644 --- a/tests/test_analysis_tools.py +++ b/tests/test_analysis_tools.py @@ -12,7 +12,7 @@ {os.path.abspath(fname): "Events"}, schemaclass=NanoAODSchema, metadata={"dataset": "DYJets"}, - permit_dask=False, + delayed=False, ).events() dakevents = NanoEventsFactory.from_root( {os.path.abspath(fname): "Events"}, diff --git a/tests/test_fix823.py b/tests/test_fix823.py index fcfff3dad..55068dda0 100644 --- a/tests/test_fix823.py +++ b/tests/test_fix823.py @@ -11,7 +11,6 @@ def test_explicit_delete_after_assign(): {testfile: "Events"}, metadata={"dataset": "nano_dy"}, schemaclass=NanoAODSchema, - permit_dask=True, ).events() genpart = events["GenPart"] diff --git a/tests/test_jetmet_tools.py b/tests/test_jetmet_tools.py index 8be3a97f3..82c01e5ee 100644 --- a/tests/test_jetmet_tools.py +++ b/tests/test_jetmet_tools.py @@ -724,7 +724,6 @@ def test_corrected_jets_factory(optimization_enabled): events = NanoEventsFactory.from_root( {os.path.abspath("tests/samples/nano_dy.root"): "Events"}, metadata={}, - permit_dask=True, ).events() jec_stack_names = [ diff --git a/tests/test_lookup_tools.py b/tests/test_lookup_tools.py index 7fde363de..d3ee1593c 100644 --- a/tests/test_lookup_tools.py +++ b/tests/test_lookup_tools.py @@ -389,7 +389,6 @@ def test_rochester(): # test against nanoaod events = NanoEventsFactory.from_root( {os.path.abspath("tests/samples/nano_dimuon.root"): "Events"}, - permit_dask=True, ).events() data_k = rochester.kScaleDT( @@ -406,7 +405,6 @@ def test_rochester(): # test against mc events = NanoEventsFactory.from_root( {os.path.abspath("tests/samples/nano_dy.root"): "Events"}, - permit_dask=True, ).events() hasgen = ~np.isnan(ak.fill_none(events.Muon.matched_gen.pt, np.nan)) diff --git a/tests/test_nanoevents.py b/tests/test_nanoevents.py index f6b5da7b9..291d6f254 100644 --- a/tests/test_nanoevents.py +++ b/tests/test_nanoevents.py @@ -75,7 +75,7 @@ def test_read_nanomc(suffix): factory = getattr(NanoEventsFactory, f"from_{suffix}")( {path: "Events"}, schemaclass=nanoversion, - permit_dask=False, + delayed=False, ) events = factory.events() @@ -138,7 +138,7 @@ def test_read_from_uri(suffix): factory = getattr(NanoEventsFactory, f"from_{suffix}")( {path: "Events"}, schemaclass=nanoversion, - permit_dask=False, + delayed=False, ) events = factory.events() @@ -153,7 +153,7 @@ def test_read_nanodata(suffix): factory = getattr(NanoEventsFactory, f"from_{suffix}")( {path: "Events"}, schemaclass=nanoversion, - permit_dask=False, + delayed=False, ) events = factory.events() @@ -165,7 +165,7 @@ def test_missing_eventIds_error(): path = os.path.abspath("tests/samples/missing_luminosityBlock.root") + ":Events" with pytest.raises(RuntimeError): factory = NanoEventsFactory.from_root( - path, schemaclass=NanoAODSchema, permit_dask=False + path, schemaclass=NanoAODSchema, delayed=False ) factory.events() @@ -177,7 +177,7 @@ def test_missing_eventIds_warning(): ): NanoAODSchema.error_missing_event_ids = False factory = NanoEventsFactory.from_root( - path, schemaclass=NanoAODSchema, permit_dask=False + path, schemaclass=NanoAODSchema, delayed=False ) factory.events() @@ -186,6 +186,8 @@ def test_missing_eventIds_warning_dask(): path = os.path.abspath("tests/samples/missing_luminosityBlock.root") + ":Events" NanoAODSchema.error_missing_event_ids = False events = NanoEventsFactory.from_root( - path, schemaclass=NanoAODSchema, permit_dask=True + path, + schemaclass=NanoAODSchema, + delayed=True, ).events() events.Muon.pt.compute(scheduler="processes") diff --git a/tests/test_nanoevents_delphes.py b/tests/test_nanoevents_delphes.py index cf2e635e5..566634ba9 100644 --- a/tests/test_nanoevents_delphes.py +++ b/tests/test_nanoevents_delphes.py @@ -10,7 +10,9 @@ def _events(): path = os.path.abspath("tests/samples/delphes.root") factory = NanoEventsFactory.from_root( - {path: "Delphes"}, schemaclass=DelphesSchema, permit_dask=True + {path: "Delphes"}, + schemaclass=DelphesSchema, + delayed=True, ) return factory.events() diff --git a/tests/test_nanoevents_pfnano.py b/tests/test_nanoevents_pfnano.py index fc50e97c1..ef3d9af5b 100644 --- a/tests/test_nanoevents_pfnano.py +++ b/tests/test_nanoevents_pfnano.py @@ -9,7 +9,9 @@ def events(): path = os.path.abspath("tests/samples/pfnano.root") events = NanoEventsFactory.from_root( - {path: "Events"}, schemaclass=PFNanoAODSchema, permit_dask=True + {path: "Events"}, + schemaclass=PFNanoAODSchema, + delayed=True, ).events() return events diff --git a/tests/test_nanoevents_physlite.py b/tests/test_nanoevents_physlite.py index 95f58491d..eab0960a8 100644 --- a/tests/test_nanoevents_physlite.py +++ b/tests/test_nanoevents_physlite.py @@ -11,7 +11,7 @@ def _events(): factory = NanoEventsFactory.from_root( {path: "CollectionTree"}, schemaclass=PHYSLITESchema, - permit_dask=True, + delayed=True, ) return factory.events() diff --git a/tests/test_nanoevents_treemaker.py b/tests/test_nanoevents_treemaker.py index 790272474..2edf3449b 100644 --- a/tests/test_nanoevents_treemaker.py +++ b/tests/test_nanoevents_treemaker.py @@ -11,7 +11,7 @@ def events(): path = os.path.abspath("tests/samples/treemaker.root") events = NanoEventsFactory.from_root( - {path: "PreSelection"}, schemaclass=TreeMakerSchema, permit_dask=True + {path: "PreSelection"}, schemaclass=TreeMakerSchema, delayed=True ).events() return events