@@ -0,0 +1,2403 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0A# Copyright (c) 2016 J%C3%A9r%C3%A9mie DECOCK (http://www.jdhp.org)%0A%0A# This script is provided under the terms and conditions of the MIT license:%0A# Permission is hereby granted, free of charge, to any person obtaining a copy%0A# of this software and associated documentation files (the %22Software%22), to deal%0A# in the Software without restriction, including without limitation the rights%0A# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0A# copies of the Software, and to permit persons to whom the Software is%0A# furnished to do so, subject to the following conditions:%0A# The above copyright notice and this permission notice shall be included in%0A# all copies or substantial portions of the Software.%0A# THE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0A# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0A# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE%0A# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER%0A# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,%0A# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN%0A# THE SOFTWARE.%0A%0A%22%22%22%0AThis module contains unit tests for the %22benchmark.assess%22 module.%0A%22%22%22%0A%0Afrom datapipe.benchmark.assess import normalize%0A%0Aimport numpy as np%0A%0Aimport unittest%0A%0Aclass TestAssess(unittest.TestCase):%0A    %22%22%22%0A    Contains unit tests for the %22benchmark.assess%22 module.%0A    %22%22%22%0A%0A    # Test the %22normalize%22 function ###########################################%0A%0A    def test_normalize(self):%0A        %22%22%22Check the output of the %22normalize%22 function.%22%22%22%0A%0A        # Input image #################%0A%0A        # %5B%5B128 128 128 128%5D%0A        #  %5B128  64 256 256%5D%0A        #  %5B128 128 128 128%5D%5D%0A%0A        input_img = np.array(%5B%5B100, 200, 200, 100%5D,%0A                              %5B100, 300, 300, 100%5D,%0A                              %5B100, 200, 200, 100%5D%5D)%0A%0A        # Output image ################%0A%0A        output_img = normalize(input_img)%0A%0A        # Expected output image #######%0A%0A        expected_output_img = np.array(%5B%5B0., 0.5, 0.5, 0.%5D,%0A                                        %5B0., 1.0, 1.0, 0.%5D,%0A                                        %5B0., 0.5, 0.5, 0.%5D%5D)%0A%0A        np.testing.assert_array_equal(output_img, expected_output_img)%0A    %0A%0Aif __name__ == '__main__':%0A    unittest.main()%0A%0A

Add a unit test.