4
4
-----
5
5
6
6
This 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
8
8
spin-off from
9
9
`pytest-arraydiff <https://github.com/astrofrog/pytest-arraydiff >`__).
10
10
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.
16
16
17
17
At the moment, the supported file formats for the reference files are:
18
18
19
- - The FITS format (requires `astropy <http://www.astropy.org >`__)
20
19
- 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.
21
22
22
23
For more information on how to write tests to do this, see the **Using **
23
24
section below.
@@ -66,7 +67,7 @@ function returns a plain Numpy array:
66
67
def test_succeeds():
67
68
return np.arange(3 * 5 * 4).reshape((3, 5, 4))
68
69
69
- To generate the reference FITS files, run the tests with the
70
+ To generate the reference data files, run the tests with the
70
71
``--arraydiff-generate-path `` option with the name of the directory
71
72
where the generated files should be placed:
72
73
@@ -79,7 +80,7 @@ be interpreted as being relative to where you are running ``py.test``.
79
80
Make sure you manually check the reference images to ensure they are
80
81
correct.
81
82
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
83
84
to a sub-directory called ``reference `` relative to the test files (this
84
85
name is configurable, see below). You can also generate the baseline
85
86
images directly in the right directory.
0 commit comments