Skip to content

Commit

Permalink
reset before view_as
Browse files Browse the repository at this point in the history
  • Loading branch information
gracesong312 committed Feb 28, 2024
1 parent 57952c8 commit 911744b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/pygama/flow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
12 changes: 6 additions & 6 deletions src/pygama/flow/data_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/pygama/flow/file_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)]

Expand Down

0 comments on commit 911744b

Please sign in to comment.