Skip to content

Commit

Permalink
hot fix for kcenialoader
Browse files Browse the repository at this point in the history
  • Loading branch information
grg2rsr committed Dec 6, 2024
1 parent 831d5c5 commit be13f0a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/iblphotometry/loaders.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def _load_data_from_eid(self, eid, rename=True) -> pd.DataFrame:
data_columns=list(locations_df.index),
rename=locations_df['brain_region'].to_dict() if rename else None,
)
raw_dfs = io.from_dataframe(raw_photometry_df, **read_config)
raw_dfs = io.from_ibl_dataframe(raw_photometry_df, **read_config)

signal_band_names = list(raw_dfs.keys())
col_names = list(raw_dfs[signal_band_names[0]].columns)
Expand All @@ -44,19 +44,19 @@ def _load_data_from_eid(self, eid: str, rename=True):
session_path = self.one.eid2path(eid)
pnames = self._eid2pnames(eid)

raw_dfs = {}
_raw_dfs = {}
for pname in pnames:
pqt_path = session_path / 'alf' / pname / 'raw_photometry.pqt'
raw_dfs[pname] = pd.read_parquet(pqt_path).set_index('times')
_raw_dfs[pname] = pd.read_parquet(pqt_path).set_index('times')

signal_bands = ['raw_calcium', 'raw_isosbestic'] # HARDCODED but fine

# flipping the data representation
raw_dfs = {}
for band in signal_bands:
df = pd.DataFrame([raw_dfs[pname][band].values for pname in pnames]).T
df = pd.DataFrame([_raw_dfs[pname][band].values for pname in pnames]).T
df.columns = pnames
df.index = raw_dfs[pname][band].index
df.index = _raw_dfs[pname][band].index
raw_dfs[band] = df

if self.verbose:
Expand Down

0 comments on commit be13f0a

Please sign in to comment.