Skip to content

Commit

Permalink
Revert accidental commits to master
Browse files Browse the repository at this point in the history
  • Loading branch information
aamster committed Dec 8, 2021
1 parent 86ee3d6 commit 2e17977
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -436,13 +436,13 @@ def metrics(self):
raise NotImplementedError()

def empty_metrics_table(self):
empty_array = np.empty((self.unit_count, len(self.METRICS_COLUMNS)))
# pandas can have issues interpreting type and makes the column 'object' type, this should enforce the
# correct data type for each column
empty_array = np.empty(self.unit_count, dtype=np.dtype(self.METRICS_COLUMNS))
empty_array[:] = np.nan

return pd.DataFrame(empty_array, index=self.unit_ids).rename_axis('unit_id')

df = pd.DataFrame(empty_array,
index=pd.Index(self.unit_ids, name='unit_id'),
columns=[x[0] for x in self.METRICS_COLUMNS])
df = df.astype(dict(self.METRICS_COLUMNS))
return df

def _find_stimuli(self):
raise NotImplementedError()
Expand Down
8 changes: 4 additions & 4 deletions allensdk/test_utilities/custom_comparators.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ def safe_df_comparison(expected: pd.DataFrame,
msg += '\nindex mismatch in non-null when checking '
msg += f'{col}\n'
for index_val in expected_valid.index.values:
e = expected_valid.loc[index_val, col]
o = obtained_valid.loc[index_val, col]
if isinstance(e, pd.Series):
e = expected_valid.at[index_val, col]
o = obtained_valid.at[index_val, col]
if isinstance(e, np.ndarray):
e = list(e)
if isinstance(o, pd.Series):
if isinstance(o, np.ndarray):
o = list(o)
if not e == o:
msg += f'\n{col}\n'
Expand Down

0 comments on commit 2e17977

Please sign in to comment.