conftest.py 704 B

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