Skip to content

Commit a6a9b2a

Browse files
committed
Add more detailed error message for an exception
1 parent 389806f commit a6a9b2a

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

allensdk/brain_observatory/behavior/session_apis/data_io/behavior_lims_api.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ def _get_ids(self) -> Dict[str, Optional[Union[int, List[int]]]]:
9999
"""
100100
ids_response = self.lims_db.select(query)
101101
if len(ids_response) > 1 or len(ids_response) < 1:
102-
raise OneResultExpectedError
102+
raise OneResultExpectedError(
103+
f"Expected length one result, received: "
104+
f"{ids_response} results from query")
103105
ids_dict = ids_response.iloc[0].to_dict()
104106

105107
# Get additional ids if also an ophys session

allensdk/brain_observatory/behavior/session_apis/data_io/behavior_ophys_lims_api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def get_ophys_experiment_df() -> pd.DataFrame:
151151

152152
@staticmethod
153153
def get_containers_df(only_passed=True) -> pd.DataFrame:
154+
"""Get a DataFrame of experiment containers"""
154155

155156
api = (credential_injector(LIMS_DB_CREDENTIAL_MAP)
156157
(PostgresQueryMixin)())
@@ -174,6 +175,8 @@ def get_containers_df(only_passed=True) -> pd.DataFrame:
174175
@classmethod
175176
def get_api_list_by_container_id(cls, container_id
176177
) -> List["BehaviorOphysLimsApi"]:
178+
"""Return a list of BehaviorOphysLimsApi instances for all
179+
ophys experiments"""
177180
df = cls.get_ophys_experiment_df()
178181
container_selector = df['container_id'] == container_id
179182
oeid_list = df[container_selector]['ophys_experiment_id'].values

0 commit comments

Comments
 (0)