From 911744b87915984cd03f2101a5f79fc4aebaee5a Mon Sep 17 00:00:00 2001 From: Grace Date: Wed, 28 Feb 2024 15:23:10 -0800 Subject: [PATCH] reset before view_as --- src/pygama/flow/__init__.py | 3 +-- src/pygama/flow/data_loader.py | 12 ++++++------ src/pygama/flow/file_db.py | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/pygama/flow/__init__.py b/src/pygama/flow/__init__.py index fcce73ed6..384d7603d 100644 --- a/src/pygama/flow/__init__.py +++ b/src/pygama/flow/__init__.py @@ -4,6 +4,5 @@ from .data_loader import DataLoader from .file_db import FileDB -from .data_group import DataGroup -__all__ = ["DataLoader", "FileDB", "DataGroup"] +__all__ = ["DataLoader", "FileDB"] diff --git a/src/pygama/flow/data_loader.py b/src/pygama/flow/data_loader.py index ea6d8ebe3..83409846f 100644 --- a/src/pygama/flow/data_loader.py +++ b/src/pygama/flow/data_loader.py @@ -584,7 +584,7 @@ def build_entry_list( tcm_table_name = self.filedb.get_table_name(tcm_tier, tcm_tb) try: - tcm_lgdo, _ = sto.read_object(tcm_table_name, tcm_path) + tcm_lgdo, _ = sto.read(tcm_table_name, tcm_path) except KeyError: log.warning(f"Cannot find table {tcm_table_name} in file {tcm_path}") continue @@ -649,7 +649,7 @@ def build_entry_list( if tb in col_tiers[file]["tables"][tier]: table_name = self.filedb.get_table_name(tier, tb) try: - tier_table, _ = sto.read_object( + tier_table, _ = sto.read( table_name, tier_path, field_mask=cut_cols[level], @@ -862,7 +862,7 @@ def build_hit_entries( # load the data from the tier file, just the columns needed for the cut table_name = self.filedb.get_table_name(tier, tb) try: - tier_tb, _ = sto.read_object( + tier_tb, _ = sto.read( table_name, tier_path, field_mask=cut_cols ) except KeyError: @@ -1120,7 +1120,7 @@ def explode_evt_cols(el: pd.DataFrame, tier_table: Table): for file in files ] - tier_table, _ = sto.read_object( + tier_table, _ = sto.read( name=tb_name, lh5_file=tier_paths, idx=idx_mask, @@ -1224,7 +1224,7 @@ def explode_evt_cols(el: pd.DataFrame, tier_table: Table): raise FileNotFoundError(tier_path) table_name = self.filedb.get_table_name(tier, tb) - tier_table, _ = sto.read_object( + tier_table, _ = sto.read( table_name, tier_path, idx=idx_mask, @@ -1322,7 +1322,7 @@ def load_evts( ) if os.path.exists(tier_path): table_name = self.filedb.get_table_name(tier, tb) - tier_table, _ = sto.read_object( + tier_table, _ = sto.read( table_name, tier_path, idx=idx_mask, diff --git a/src/pygama/flow/file_db.py b/src/pygama/flow/file_db.py index 2639b3122..7134718e4 100644 --- a/src/pygama/flow/file_db.py +++ b/src/pygama/flow/file_db.py @@ -536,7 +536,7 @@ def _replace_idx(row, trans, tier): # loop over the files for p in paths: - cfg, _ = sto.read_object("config", p) + cfg, _ = sto.read("config", p) cfg = json.loads(cfg.value.decode()) # make sure configurations are all the same @@ -548,7 +548,7 @@ def _replace_idx(row, trans, tier): ) # read in unique columns - vov, _ = sto.read_object("columns", p) + vov, _ = sto.read("columns", p) # Convert back from VoV of UTF-8 bytestrings to a list of lists of strings columns = [[v.decode("utf-8") for v in ov] for ov in list(vov)]