Skip to content

Commit

Permalink
Merge pull request #2648 from AllenInstitute/targeted_imaging_depth_t…
Browse files Browse the repository at this point in the history
…o_oe_table

Add targeted_imaging_depth column to get_ophys_experiment_table
  • Loading branch information
mikejhuang committed Jan 23, 2023
2 parents c07effe + 497bbc9 commit 045ec3c
Show file tree
Hide file tree
Showing 4 changed files with 1,950 additions and 1,945 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,12 @@ def _get_ophys_experiment_table(self) -> pd.DataFrame:
query += where_clause

self.logger.debug(f"get_ophys_experiment_table query: \n{query}")
return self.lims_engine.select(query)
query_df = self.lims_engine.select(query)
targeted_imaging_depth = query_df[
["ophys_container_id", "imaging_depth"]
].groupby("ophys_container_id").mean()
targeted_imaging_depth.columns = ['targeted_imaging_depth']
return query_df.merge(targeted_imaging_depth, on='ophys_container_id')

def _get_ophys_cells_table(self):
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def test_get_ophys_experiments_table(self):
.sort_values('ophys_experiment_id')\
.reset_index(drop=True)
pd.testing.assert_frame_equal(
obtained, expected)
obtained.sort_index(axis=1), expected.sort_index(axis=1))

@pytest.mark.requires_bamboo
def test_get_ophys_cells_table(self):
Expand Down
Loading

0 comments on commit 045ec3c

Please sign in to comment.