diff --git a/allensdk/brain_observatory/behavior/behavior_project_cache/behavior_project_cache.py b/allensdk/brain_observatory/behavior/behavior_project_cache/behavior_project_cache.py index 6b6aa2494..cea0a7125 100644 --- a/allensdk/brain_observatory/behavior/behavior_project_cache/behavior_project_cache.py +++ b/allensdk/brain_observatory/behavior/behavior_project_cache/behavior_project_cache.py @@ -74,7 +74,7 @@ class VBOLimsCache(Cache): class VisualBehaviorOphysProjectCache(ProjectCacheBase): PROJECT_NAME = "visual-behavior-ophys" - BUCKET_NAME = "visual-behavior-ophys-data" + BUCKET_NAME = "staging.visual-behavior-ophys-data" def __init__( self, diff --git a/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_cloud_api.py b/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_cloud_api.py index 17652fa74..0365ef78c 100644 --- a/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_cloud_api.py +++ b/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_cloud_api.py @@ -23,16 +23,16 @@ from allensdk.brain_observatory.behavior.behavior_session import ( BehaviorSession, ) +from allensdk.brain_observatory.ophys.project_constants import ( + VBO_INTEGER_COLUMNS, + VBO_METADATA_COLUMN_ORDER, +) from allensdk.core.dataframe_utils import ( enforce_df_column_order, enforce_df_int_typing, return_one_dataframe_row_only, ) from allensdk.core.utilities import literal_col_eval -from allensdk.brain_observatory.ophys.project_constants import ( - VBO_METADATA_COLUMN_ORDER, - VBO_INTEGER_COLUMNS -) COL_EVAL_LIST = ["ophys_experiment_id", "ophys_container_id", "driver_line"] @@ -190,13 +190,10 @@ def _get_ophys_session_table(self): df["date_of_acquisition"], utc="True" ) df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) df = enforce_df_column_order( - input_df=df, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=df, column_order=VBO_METADATA_COLUMN_ORDER ) self._ophys_session_table = df.set_index("ophys_session_id") @@ -223,13 +220,10 @@ def _get_behavior_session_table(self): df["date_of_acquisition"], utc="True" ) df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) df = enforce_df_column_order( - input_df=df, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=df, column_order=VBO_METADATA_COLUMN_ORDER ) self._behavior_session_table = df.set_index("behavior_session_id") @@ -261,13 +255,10 @@ def _get_ophys_experiment_table(self): df["date_of_acquisition"], utc="True" ) df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) df = enforce_df_column_order( - input_df=df, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=df, column_order=VBO_METADATA_COLUMN_ORDER ) self._ophys_experiment_table = df.set_index("ophys_experiment_id") diff --git a/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_lims_api.py b/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_lims_api.py index b0a15a06a..dff7e491a 100644 --- a/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_lims_api.py +++ b/allensdk/brain_observatory/behavior/behavior_project_cache/project_apis/data_io/behavior_project_lims_api.py @@ -14,24 +14,24 @@ from allensdk.brain_observatory.ecephys.ecephys_project_api.http_engine import ( # noqa: E501 HttpEngine, ) +from allensdk.brain_observatory.ophys.project_constants import ( + VBO_INTEGER_COLUMNS, + VBO_METADATA_COLUMN_ORDER, +) from allensdk.core.auth_config import ( LIMS_DB_CREDENTIAL_MAP, MTRAIN_DB_CREDENTIAL_MAP, ) from allensdk.core.authentication import DbCredentials +from allensdk.core.dataframe_utils import ( + enforce_df_column_order, + enforce_df_int_typing, +) from allensdk.internal.api import db_connection_creator from allensdk.internal.api.queries.utils import ( build_in_list_selector_query, build_where_clause, ) -from allensdk.core.dataframe_utils import ( - enforce_df_column_order, - enforce_df_int_typing -) -from allensdk.brain_observatory.ophys.project_constants import ( - VBO_METADATA_COLUMN_ORDER, - VBO_INTEGER_COLUMNS -) class BehaviorProjectLimsApi(BehaviorProjectBase): @@ -394,13 +394,10 @@ def _get_ophys_experiment_table(self) -> pd.DataFrame: targeted_imaging_depth.columns = ["targeted_imaging_depth"] df = query_df.merge(targeted_imaging_depth, on="ophys_container_id") df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) df = enforce_df_column_order( - input_df=df, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=df, column_order=VBO_METADATA_COLUMN_ORDER ) return df @@ -446,9 +443,7 @@ def _get_ophys_cells_table(self): # NaN's for invalid cells force this to float, push to int df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) return df @@ -512,13 +507,11 @@ def get_ophys_session_table(self) -> pd.DataFrame: # There is one ophys_session_id from 2018 that has multiple behavior # ids, causing duplicates -- drop all dupes for now; # TODO table = self._get_ophys_session_table().drop_duplicates( - subset=["ophys_session_id"], - keep=False + subset=["ophys_session_id"], keep=False ) # Make date time explicitly UTC. table["date_of_acquisition"] = pd.to_datetime( - table["date_of_acquisition"], - utc=True + table["date_of_acquisition"], utc=True ) # Fill NaN values of imaging_plane_group_count with zero to match @@ -526,11 +519,10 @@ def get_ophys_session_table(self) -> pd.DataFrame: table = enforce_df_int_typing( input_df=table, int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + use_pandas_type=True, ) table = enforce_df_column_order( - input_df=table, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=table, column_order=VBO_METADATA_COLUMN_ORDER ) return table.set_index("ophys_session_id") @@ -562,19 +554,15 @@ def get_ophys_experiment_table(self) -> pd.DataFrame: """ df = self._get_ophys_experiment_table() df["date_of_acquisition"] = pd.to_datetime( - df["date_of_acquisition"], - utc=True + df["date_of_acquisition"], utc=True ) # Set type to pandas.Int64 to enforce integer typing and not revert to # float. df = enforce_df_int_typing( - input_df=df, - int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + input_df=df, int_columns=VBO_INTEGER_COLUMNS, use_pandas_type=True ) df = enforce_df_column_order( - input_df=df, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=df, column_order=VBO_METADATA_COLUMN_ORDER ) return df.set_index("ophys_experiment_id") @@ -600,11 +588,10 @@ def get_behavior_session_table(self) -> pd.DataFrame: summary_tbl = enforce_df_int_typing( input_df=summary_tbl, int_columns=VBO_INTEGER_COLUMNS, - use_pandas_type=True + use_pandas_type=True, ) summary_tbl = enforce_df_column_order( - input_df=summary_tbl, - column_order=VBO_METADATA_COLUMN_ORDER + input_df=summary_tbl, column_order=VBO_METADATA_COLUMN_ORDER ) return summary_tbl.set_index("behavior_session_id") diff --git a/allensdk/brain_observatory/ophys/project_constants.py b/allensdk/brain_observatory/ophys/project_constants.py index f1d701399..e9448feee 100644 --- a/allensdk/brain_observatory/ophys/project_constants.py +++ b/allensdk/brain_observatory/ophys/project_constants.py @@ -52,17 +52,40 @@ } VBO_METADATA_COLUMN_ORDER = [ - 'behavior_session_id', 'ophys_session_id', 'ophys_container_id', - 'mouse_id', 'indicator', 'full_genotype', 'driver_line', - 'cre_line', 'reporter_line', 'sex', 'age_in_days', - 'imaging_depth', 'targeted_structure', 'targeted_imaging_depth', - 'imaging_plane_group_count', 'imaging_plane_group', - 'project_code', 'session_type', 'session_number', 'image_set', - 'behavior_type', 'passive', 'experience_level', - 'prior_exposures_to_session_type', 'prior_exposures_to_image_set', - 'prior_exposures_to_omissions', 'date_of_acquisition', - 'equipment_name', 'num_depths_per_area', 'ophys_experiment_id', - 'num_targeted_structures', 'published_at', 'isi_experiment_id'] + "behavior_session_id", + "ophys_session_id", + "ophys_container_id", + "mouse_id", + "indicator", + "full_genotype", + "driver_line", + "cre_line", + "reporter_line", + "sex", + "age_in_days", + "imaging_depth", + "targeted_structure", + "targeted_imaging_depth", + "imaging_plane_group_count", + "imaging_plane_group", + "project_code", + "session_type", + "session_number", + "image_set", + "behavior_type", + "passive", + "experience_level", + "prior_exposures_to_session_type", + "prior_exposures_to_image_set", + "prior_exposures_to_omissions", + "date_of_acquisition", + "equipment_name", + "num_depths_per_area", + "ophys_experiment_id", + "num_targeted_structures", + "published_at", + "isi_experiment_id", +] VBO_INTEGER_COLUMNS = [ @@ -77,5 +100,5 @@ "targeted_areas", "num_depths_per_area", "num_targeted_structures", - "cell_specimen_id" + "cell_specimen_id", ] diff --git a/allensdk/test/brain_observatory/behavior/behavior_project_cache/test_behavior_project_lims_api.py b/allensdk/test/brain_observatory/behavior/behavior_project_cache/test_behavior_project_lims_api.py index ca46e387c..c2d7ea30b 100644 --- a/allensdk/test/brain_observatory/behavior/behavior_project_cache/test_behavior_project_lims_api.py +++ b/allensdk/test/brain_observatory/behavior/behavior_project_cache/test_behavior_project_lims_api.py @@ -4,26 +4,26 @@ import pandas as pd import pytest - -from allensdk.brain_observatory.behavior.behavior_project_cache import \ - VisualBehaviorOphysProjectCache -from allensdk.brain_observatory.behavior.behavior_project_cache.project_metadata_writer.behavior_project_metadata_writer import ( # noqa: E501 - SESSION_SUPPRESS, OPHYS_EXPERIMENTS_SUPPRESS, - OPHYS_EXPERIMENTS_SUPPRESS_FINAL +from allensdk.brain_observatory.behavior.behavior_project_cache import ( + VisualBehaviorOphysProjectCache, ) from allensdk.brain_observatory.behavior.behavior_project_cache.project_apis.data_io import ( # noqa: E501 - BehaviorProjectLimsApi, BehaviorProjectCloudApi + BehaviorProjectCloudApi, + BehaviorProjectLimsApi, +) +from allensdk.brain_observatory.behavior.behavior_project_cache.project_metadata_writer.behavior_project_metadata_writer import ( # noqa: E501 + OPHYS_EXPERIMENTS_SUPPRESS, + OPHYS_EXPERIMENTS_SUPPRESS_FINAL, + SESSION_SUPPRESS, ) from allensdk.brain_observatory.behavior.data_objects import BehaviorSessionId -from allensdk.brain_observatory.behavior.data_objects.metadata\ - .behavior_metadata.behavior_metadata import \ - BehaviorMetadata -from allensdk.brain_observatory.behavior.data_objects.metadata\ - .behavior_metadata.session_type import \ - SessionType - -from allensdk.test_utilities.custom_comparators import ( - WhitespaceStrippedString) +from allensdk.brain_observatory.behavior.data_objects.metadata.behavior_metadata.behavior_metadata import ( # noqa: E501 + BehaviorMetadata, +) +from allensdk.brain_observatory.behavior.data_objects.metadata.behavior_metadata.session_type import ( # noqa: E501 + SessionType, +) +from allensdk.test_utilities.custom_comparators import WhitespaceStrippedString class MockQueryEngine: @@ -42,14 +42,18 @@ def stream(self, endpoint): @pytest.fixture def MockBehaviorProjectLimsApi(): - return BehaviorProjectLimsApi(MockQueryEngine(), MockQueryEngine(), - MockQueryEngine()) + return BehaviorProjectLimsApi( + MockQueryEngine(), MockQueryEngine(), MockQueryEngine() + ) @pytest.mark.parametrize( - "line,expected", [ - ("reporter", WhitespaceStrippedString( - """-- -- begin getting reporter line from donors -- -- + "line,expected", + [ + ( + "reporter", + WhitespaceStrippedString( + """-- -- begin getting reporter line from donors -- -- SELECT ARRAY_AGG (g.name) AS reporter_line, d.id AS donor_id FROM donors d LEFT JOIN donors_genotypes dg ON dg.donor_id=d.id @@ -57,9 +61,13 @@ def MockBehaviorProjectLimsApi(): LEFT JOIN genotype_types gt ON gt.id=g.genotype_type_id WHERE gt.name='reporter' GROUP BY d.id - -- -- end getting reporter line from donors -- --""")), - ("driver", WhitespaceStrippedString( - """-- -- begin getting driver line from donors -- -- + -- -- end getting reporter line from donors -- --""" + ), + ), + ( + "driver", + WhitespaceStrippedString( + """-- -- begin getting driver line from donors -- -- SELECT ARRAY_AGG (g.name) AS driver_line, d.id AS donor_id FROM donors d LEFT JOIN donors_genotypes dg ON dg.donor_id=d.id @@ -67,36 +75,42 @@ def MockBehaviorProjectLimsApi(): LEFT JOIN genotype_types gt ON gt.id=g.genotype_type_id WHERE gt.name='driver' GROUP BY d.id - -- -- end getting driver line from donors -- --""")) - ] + -- -- end getting driver line from donors -- --""" + ), + ), + ], ) -def test_build_line_from_donor_query(line, expected, - MockBehaviorProjectLimsApi): +def test_build_line_from_donor_query( + line, expected, MockBehaviorProjectLimsApi +): mbp_api = MockBehaviorProjectLimsApi assert expected == mbp_api._build_line_from_donor_query(line=line) class TestProjectTablesAll: """Tests for passing passed_only=False to project tables""" + @classmethod def setup_class(cls): - test_dir = Path(__file__).parent / 'test_data' / 'vbo' + test_dir = Path(__file__).parent / "test_data" / "vbo" # Note: these tables will need to be updated if the expected table # changes cls.release_behavior_sessions_table = pd.read_csv( - test_dir / 'behavior_session_table.csv') + test_dir / "behavior_session_table.csv" + ) cls.release_ophys_sessions_table = pd.read_csv( - test_dir / 'ophys_session_table.csv') + test_dir / "ophys_session_table.csv" + ) cls.release_ophys_experiments_table = pd.read_csv( - test_dir / 'ophys_experiment_table.csv') + test_dir / "ophys_experiment_table.csv" + ) cls.release_ophys_cells_table = pd.read_csv( - test_dir / 'ophys_cells_table.csv') - - cls.lims_api = BehaviorProjectLimsApi.default( - passed_only=False + test_dir / "ophys_cells_table.csv" ) + cls.lims_api = BehaviorProjectLimsApi.default(passed_only=False) + def _get_behavior_session(self, behavior_session_id, lims_db): if isinstance(behavior_session_id, BehaviorSessionId): behavior_session_id = behavior_session_id.value @@ -106,8 +120,8 @@ def _get_behavior_session(self, behavior_session_id, lims_db): behavior_session_id=BehaviorSessionId(behavior_session_id), equipment=None, stimulus_frame_rate=None, - session_type=SessionType('foo'), - behavior_session_uuid=None + session_type=SessionType("foo"), + behavior_session_uuid=None, ) @pytest.mark.requires_bamboo @@ -115,54 +129,78 @@ def test_all_behavior_sessions(self): """Tests that when passed_only=False, that more sessions are returned than in the release table""" with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): obtained = self.lims_api.get_behavior_session_table() # Make sure ids returned are superset of release ids - assert len(set(obtained.index).intersection( - self.release_behavior_sessions_table['behavior_session_id'])) \ - == \ - self.release_behavior_sessions_table['behavior_session_id']\ - .nunique() - assert obtained.shape[0] > \ - self.release_behavior_sessions_table.shape[0] + assert ( + len( + set(obtained.index).intersection( + self.release_behavior_sessions_table[ + "behavior_session_id" + ] + ) + ) + == self.release_behavior_sessions_table[ + "behavior_session_id" + ].nunique() + ) + assert ( + obtained.shape[0] + > self.release_behavior_sessions_table.shape[0] + ) @pytest.mark.requires_bamboo def test_all_ophys_sessions(self): """Tests that when passed_only=False, that more sessions are returned than in the release table""" with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): obtained = self.lims_api.get_ophys_session_table() # Make sure ids returned are superset of release ids - assert len(set(obtained.index).intersection( - self.release_ophys_sessions_table['ophys_session_id'])) \ - == \ - self.release_ophys_sessions_table['ophys_session_id']\ - .nunique() - assert obtained.shape[0] > \ - self.release_ophys_sessions_table.shape[0] + assert ( + len( + set(obtained.index).intersection( + self.release_ophys_sessions_table["ophys_session_id"] + ) + ) + == self.release_ophys_sessions_table[ + "ophys_session_id" + ].nunique() + ) + assert ( + obtained.shape[0] > self.release_ophys_sessions_table.shape[0] + ) @pytest.mark.requires_bamboo def test_all_ophys_experiments(self): """Tests that when passed_only=False, that more experiments are returned than in the release table""" with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): obtained = self.lims_api.get_ophys_experiment_table() # Make sure ids returned are superset of release ids - assert len(set(obtained.index).intersection( - self.release_ophys_experiments_table['ophys_experiment_id'])) \ - == \ - self.release_ophys_experiments_table['ophys_experiment_id']\ - .nunique() - assert obtained.shape[0] > \ - self.release_ophys_experiments_table.shape[0] + assert ( + len( + set(obtained.index).intersection( + self.release_ophys_experiments_table[ + "ophys_experiment_id" + ] + ) + ) + == self.release_ophys_experiments_table[ + "ophys_experiment_id" + ].nunique() + ) + assert ( + obtained.shape[0] + > self.release_ophys_experiments_table.shape[0] + ) @pytest.mark.requires_bamboo def test_all_cells(self): @@ -171,41 +209,47 @@ def test_all_cells(self): obtained = self.lims_api.get_ophys_cells_table() # Make sure ids returned are superset of release ids - assert len(set(obtained['ophys_experiment_id']).intersection( - self.release_ophys_cells_table['ophys_experiment_id'])) \ - == \ - self.release_ophys_cells_table['ophys_experiment_id']\ - .nunique() - assert obtained.shape[0] > \ - self.release_ophys_cells_table.shape[0] + assert ( + len( + set(obtained["ophys_experiment_id"]).intersection( + self.release_ophys_cells_table["ophys_experiment_id"] + ) + ) + == self.release_ophys_cells_table["ophys_experiment_id"].nunique() + ) + assert obtained.shape[0] > self.release_ophys_cells_table.shape[0] class TestLimsCloudConsistency: """Tests for checking consistency between tables as returned by cloud vs those returned internally by lims""" + @classmethod def setup_class(cls): tempdir = tempfile.TemporaryDirectory() - cls.test_dir = Path(__file__).parent / 'test_data' / 'vbo' + cls.test_dir = Path(__file__).parent / "test_data" / "vbo" behavior_sessions_table = pd.read_csv( - cls.test_dir / 'behavior_session_table.csv') - cls.session_type_map = ( - behavior_sessions_table - .set_index('behavior_session_id')[['session_type']] - .to_dict()['session_type']) + cls.test_dir / "behavior_session_table.csv" + ) + cls.session_type_map = behavior_sessions_table.set_index( + "behavior_session_id" + )[["session_type"]].to_dict()["session_type"] cls.lims_cache = VisualBehaviorOphysProjectCache.from_lims( - data_release_date=['2021-03-25', '2021-08-12']) + data_release_date=["2021-03-25", "2021-08-12"] + ) cls.tempdir = tempdir with patch.object( - BehaviorProjectCloudApi, - '_get_metadata_path', - wraps=cls._get_project_table_path): + BehaviorProjectCloudApi, + "_get_metadata_path", + wraps=cls._get_project_table_path, + ): cls.cloud_cache = VisualBehaviorOphysProjectCache.from_s3_cache( - cache_dir=tempdir.name) + cache_dir=tempdir.name + ) def teardown_class(self): self.tempdir.cleanup() @@ -218,32 +262,33 @@ def _get_behavior_session(self, behavior_session_id, lims_db): equipment=None, stimulus_frame_rate=None, session_type=SessionType( - self.session_type_map[behavior_session_id]), - behavior_session_uuid=None + self.session_type_map[behavior_session_id] + ), + behavior_session_uuid=None, ) @classmethod def _get_project_table_path(cls, fname): - if fname == 'behavior_session_table': - return cls.test_dir / 'behavior_session_table.csv' - elif fname == 'ophys_session_table': - return cls.test_dir / 'ophys_session_table.csv' - elif fname == 'ophys_experiment_table': - return cls.test_dir / 'ophys_experiment_table.csv' - elif fname == 'ophys_cells_table': - return cls.test_dir / 'ophys_cells_table.csv' + if fname == "behavior_session_table": + return cls.test_dir / "behavior_session_table.csv" + elif fname == "ophys_session_table": + return cls.test_dir / "ophys_session_table.csv" + elif fname == "ophys_experiment_table": + return cls.test_dir / "ophys_experiment_table.csv" + elif fname == "ophys_cells_table": + return cls.test_dir / "ophys_cells_table.csv" @pytest.mark.requires_bamboo def test_behavior_session_table(self): with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): from_lims = self.lims_cache.get_behavior_session_table() from_lims = from_lims.drop(columns=list(SESSION_SUPPRESS)) from_s3 = self.cloud_cache.get_behavior_session_table() - from_s3 = from_s3.drop(columns=['file_id', 'file_path']) + from_s3 = from_s3.drop(columns=["file_id", "file_path"]) from_lims = from_lims.sort_index() from_s3 = from_s3.sort_index() @@ -253,8 +298,8 @@ def test_behavior_session_table(self): @pytest.mark.requires_bamboo def test_ophys_session_table(self): with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): from_lims = self.lims_cache.get_ophys_session_table() from_lims = from_lims.drop(columns=list(SESSION_SUPPRESS)) @@ -269,16 +314,18 @@ def test_ophys_session_table(self): @pytest.mark.requires_bamboo def test_ophys_experiments_table(self): with patch.object( - BehaviorMetadata, - 'from_lims', wraps=self._get_behavior_session): + BehaviorMetadata, "from_lims", wraps=self._get_behavior_session + ): from_lims = self.lims_cache.get_ophys_experiment_table() from_lims = from_lims.drop( - columns=list(OPHYS_EXPERIMENTS_SUPPRESS) + - list(OPHYS_EXPERIMENTS_SUPPRESS_FINAL), errors='ignore') + columns=list(OPHYS_EXPERIMENTS_SUPPRESS) + + list(OPHYS_EXPERIMENTS_SUPPRESS_FINAL), + errors="ignore", + ) from_s3 = self.cloud_cache.get_ophys_experiment_table() - from_s3 = from_s3.drop(columns=['file_id', 'file_path']) + from_s3 = from_s3.drop(columns=["file_id", "file_path"]) from_lims = from_lims.sort_index() from_s3 = from_s3.sort_index()