Skip to content

Commit 257d2ea

Browse files
author
miranov25
committed
Commit latest working version of AliasDataFrame
1 parent 512323d commit 257d2ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

UTILS/dfextensions/AliasDataFrame.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,19 +369,19 @@ def load(path_prefix):
369369
adf.constant_aliases = set(json.loads(meta[b"constants"].decode()))
370370
return adf
371371

372-
def export_tree(self, filename_or_file, treename="tree", dropAliasColumns=True,compression=uproot.LZMA(level=9),chunk_bytes=None):
372+
def export_tree(self, filename_or_file, treename="tree", dropAliasColumns=True,compression=uproot.LZMA(level=5)):
373373
is_path = isinstance(filename_or_file, str)
374374

375375
if is_path:
376376
with uproot.recreate(filename_or_file,compression=compression) as f:
377-
self._write_to_uproot(f, treename, dropAliasColumns, chunk_bytes=chunk_bytes)
377+
self._write_to_uproot(f, treename, dropAliasColumns)
378378
self._write_metadata_to_root(filename_or_file, treename)
379379
else:
380380
self._write_to_uproot(filename_or_file, treename, dropAliasColumns)
381381
for subframe_name, entry in self._subframes.items():
382382
entry["frame"]._write_metadata_to_root(filename_or_file, f"{treename}__subframe__{subframe_name}")
383383

384-
def _write_to_uproot(self, uproot_file, treename, dropAliasColumns,chunk_bytes=None):
384+
def _write_to_uproot(self, uproot_file, treename, dropAliasColumns):
385385
export_cols = [col for col in self.df.columns if not dropAliasColumns or col not in self.aliases]
386386
dtype_casts = {col: np.float32 for col in export_cols if self.df[col].dtype == np.float16}
387387
export_df = self.df[export_cols].astype(dtype_casts)

0 commit comments

Comments
 (0)