earthlab / matplotcheck

A python package for checking and testing matplotlib plots. We use this for autograding student assignments but there are many other potential use cases including package testing (for packages with plots)!
https://matplotcheck.readthedocs.io
BSD 3-Clause "New" or "Revised" License
18 stars 8 forks source link

Add helper function for multiband arrays #187

Closed nkorinek closed 4 years ago

nkorinek commented 4 years ago

Add a helper function to help assert_image in raster tester test multi-band rasters. The rasters need to be transposed and the data needs to be bytescaled when plotted with ep.plot_rgb. The bytescale is done within ep.plot_rgb, and the transpotition is done by matplotlib. The current fix is to transform the example data using es.bytescale(threebandimage).transpose([1, 2, 0]). This could be added into a helper function to help with the assertion in assert_image. @lwasser

nkorinek commented 4 years ago

@lwasser we've decided against this in favor of using the axis object in conjunction with the new get_images() function merged here: https://github.com/earthlab/matplotcheck/pull/193 . This can be closed unless we decide further functionality is needed.