pytest_gee.image_regression =========================== .. py:module:: pytest_gee.image_regression .. autoapi-nested-parse:: implementation of the ``image_regression`` fixture. Classes ------- .. autoapisummary:: pytest_gee.image_regression.ImageFixture Module Contents --------------- .. py:class:: ImageFixture(datadir, original_datadir, request) Bases: :py:obj:`pytest_regressions.image_regression.ImageRegressionFixture` Fixture for regression testing of :py:class:`ee.Image`. .. py:method:: check(data_image, diff_threshold = 0.1, expect_equal = True, basename = None, fullpath = None, scale = 30, viz_params = None, region = None, overlay = None) Check the given image against a previously recorded version, or generate a new file. This method will create a thumbnail version of the requested image. It is made to allow a human user to check the result of the Computation. The thumbnail will be computed on the fly using earthengine. This mean that the test must be reasonable in size and scale. We will perform no feasibility checks and your computation might crash if you are too greedy. The input image will be either a single band image (displayed using black&white colormap) or a 3 band image (displayed using as fake RGB bands). If the ``viz_params`` parameter is omitted then it will detect the available ands, and use default viz params. :param data_image: The image to check. The image needs to be clipped to a geometry or have an existing footprint. :param diff_threshold: The threshold for the difference between the expected and obtained images. :param expect_equal: If ``True`` the images are expected to be equal, otherwise they are expected to be different. :param basename: The basename of the file to test/record. If not given the name of the test is used. :param fullpath: complete path to use as a reference file. This option will ignore ``datadir`` fixture when reading *expected* files but will still use it to write *obtained* files. Useful if a reference file is located in the session data dir for example. :param scale: The scale to use for the thumbnail. :param viz_params: The visualization parameters to use for the thumbnail. If not given, the min and max values of the image will be used. :param region: The region to use for clipping the image. If not given, the image's region will be used. :param overlay: A FeatureCollection to draw on top of the image. The style will be taken from each Feature's "style" property.