conftest.py 650 B

1234567891011121314151617181920
  1. import os
  2. import pandas
  3. SUBJECTS_DIR = os.path.join(os.path.dirname(__file__), 'subjects')
  4. def assert_volume_frames_equal(left: pandas.DataFrame, right: pandas.DataFrame):
  5. sort_by = list(filter(lambda n: n in left,
  6. ['subject', 'volume_mm^3', 'analysis_id', 'correction']))
  7. left.sort_values(sort_by, inplace=True)
  8. right.sort_values(sort_by, inplace=True)
  9. left.reset_index(inplace=True, drop=True)
  10. right.reset_index(inplace=True, drop=True)
  11. pandas.util.testing.assert_frame_equal(
  12. left=left,
  13. right=right,
  14. # ignore the order of index & columns
  15. check_like=True,
  16. )