44-----
55
66This is a `py.test <http://pytest.org >`__ plugin to facilitate the
7- generation and comparison of arrays produced during tests (this is a
7+ generation and comparison of data arrays produced during tests (this is a
88spin-off from
99`pytest-arraydiff <https://github.com/astrofrog/pytest-arraydiff >`__).
1010
11- The basic idea is that you can write a test that generates a Numpy
12- array . You can then either run the tests in a mode to ** generate **
13- reference files from the arrays, or you can run the tests in
14- **comparison ** mode, which will compare the results of the tests to the
15- reference ones within some tolerance.
11+ The basic idea is that you can write a test that generates a Numpy array (or
12+ other related objects depending on the format) . You can then either run the
13+ tests in a mode to ** generate ** reference files from the arrays, or you can run
14+ the tests in **comparison ** mode, which will compare the results of the tests to
15+ the reference ones within some tolerance.
1616
1717At the moment, the supported file formats for the reference files are:
1818
19- - The FITS format (requires `astropy <http://www.astropy.org >`__)
2019- A plain text-based format (baed on Numpy ``loadtxt `` output)
20+ - The FITS format (requires `astropy <http://www.astropy.org >`__). With this
21+ format, tests can return either a Numpy array for a FITS HDU object.
2122
2223For more information on how to write tests to do this, see the **Using **
2324section below.
@@ -66,7 +67,7 @@ function returns a plain Numpy array:
6667 def test_succeeds():
6768 return np.arange(3 * 5 * 4).reshape((3, 5, 4))
6869
69- To generate the reference FITS files, run the tests with the
70+ To generate the reference data files, run the tests with the
7071``--arraydiff-generate-path `` option with the name of the directory
7172where the generated files should be placed:
7273
@@ -79,7 +80,7 @@ be interpreted as being relative to where you are running ``py.test``.
7980Make sure you manually check the reference images to ensure they are
8081correct.
8182
82- Once you are happy with the generated FITS files, you should move them
83+ Once you are happy with the generated data files, you should move them
8384to a sub-directory called ``reference `` relative to the test files (this
8485name is configurable, see below). You can also generate the baseline
8586images directly in the right directory.
0 commit comments