autowisp.tests.h5_test_case module

Class Inheritance Diagram

Inheritance diagram of AutoWISPTestCase, DRTestCase, DataReductionFile, H5TestCase

Define class to compare groups in DR files.

class autowisp.tests.h5_test_case.DRTestCase(methodName='runTest')[source]

Bases: H5TestCase

Inheritance diagram of autowisp.tests.h5_test_case.DRTestCase

H5TestCase aware of row-order ambiguity in SourceExtraction groups.

_build_srcextract_reorder(dr_fname1, dr_fname2, group_name)[source]

Return permutation aligning dr_fname2 sources with dr_fname1.

_find_sources_group(root, group_name)[source]

Return path of subgroup of group_name holding source columns.

assert_groups_match(dr_fname1, dr_fname2, group_name, ignore, reorder=None)[source]

Compute SourceExtraction reorder, then delegate to H5TestCase.

class autowisp.tests.h5_test_case.H5TestCase(methodName='runTest')[source]

Bases: AutoWISPTestCase

Inheritance diagram of autowisp.tests.h5_test_case.H5TestCase

Add assert for comparing groups in HDF5 files.

_project_relative(dr_fname, value)[source]

Return value as a path relative to whichever project_home dr_fname lives in (test_directory or processing_directory).

value may be bytes (h5py string attrs) or str; the result is returned as str. If dr_fname does not lie under either project_home the value is returned unchanged.

assert_groups_match(dr_fname1, dr_fname2, group_name, ignore, reorder=None)[source]

Check if two DR files have the same groups.

Parameters:

reorder (numpy.ndarray or None) – Optional integer permutation applied to dr_fname2 datasets along axis 0 before comparison. Only applied to datasets whose leading dimension equals len(reorder).

run_step_test(step_name, inputs, compare, *, ignore=None, output_type='DR')[source]

Run a test of a single step that updates the DR files.

Parameters:
  • step_name (str) – The name of the step being tested

  • inputs ([]) – List of the directories or files needed by the step. The first entry (with full path added) is passed as input to the step.

  • compare ([]) – List of the HDF5 groups to compare in order to ensure the step produced correct results,

  • ignore (callable) – Function that returns true on any dataset or group in the HDF5 file that should not be compared when it is under the groups specified in compare

  • tput_type (str) – The type of output files produced by the step (i.e. whic files should be compared),