Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add targeted_imaging_depth column to get_ophys_experiment_table #2648

Merged
merged 4 commits into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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