예제 #1
0
    def test_notebook_2018_2019(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        def valid(cell):
            if "nuplet[1] = 5" in cell:
                return False
            if "dico[0]  ##" in cell:
                return False
            if "dico[ [4,6] ] = 6" in cell:
                return False
            return True

        self.assertTrue(src.ensae_teaching_cs is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "notebook_eleves", "2018-2019")
        test_notebook_execution_coverage(
            __file__,
            "",
            folder,
            valid=valid,
            this_module_name="ensae_teaching_cs",
            fLOG=fLOG,
            copy_files=['titanic.csv/titanic.csv'])
예제 #2
0
    def test_notebook_search_images(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        with redirect_stderr(StringIO()):
            try:
                from keras.applications.mobilenet import MobileNet  # pylint: disable=E0401
                assert MobileNet is not None
            except (SyntaxError, ModuleNotFoundError) as e:
                warnings.warn(
                    "tensorflow is probably not available yet on python 3.7: {0}"
                    .format(e))
                return

        self.assertTrue(mlinsights is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "explore")
        test_notebook_execution_coverage(
            __file__,
            "keras",
            folder,
            'mlinsights',
            copy_files=["data/dog-cat-pixabay.zip"],
            fLOG=fLOG)
 def test_notebook_maxtrix_dictionary(self):
     folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                           "notebooks", "td1a")
     test_notebook_execution_coverage(__file__,
                                      "matrix_dictionary",
                                      folder,
                                      this_module_name="ensae_teaching_cs",
                                      fLOG=fLOG)
 def test_run_slide(self):
     fLOG(__file__, self._testMethodName,
          OutputPrint=__name__ == "__main__")
     self.assertTrue(python3_module_template is not None)
     folder = os.path.join(os.path.dirname(__file__),
                           "..", "..", "_doc", "notebooks")
     test_notebook_execution_coverage(
         __file__, "slide", folder, 'python3_module_template', copy_files=[], fLOG=fLOG)
 def test_notebook_(self):
     folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                           "notebooks", "td2a_ml")
     test_notebook_execution_coverage(__file__,
                                      "ml_lasso_rf_grid_search",
                                      folder,
                                      this_module_name="ensae_teaching_cs",
                                      fLOG=fLOG)
 def test_notebook_data_irep(self):
     folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                           "notebooks", "data")
     test_notebook_execution_coverage(__file__,
                                      "irep",
                                      folder,
                                      this_module_name="ensae_teaching_cs",
                                      fLOG=fLOG)
예제 #7
0
    def test_notebook_search_images(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(mlinsights is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "explore")
        test_notebook_execution_coverage(__file__, "torch", folder, 'mlinsights',
                                         copy_files=["data/dog-cat-pixabay.zip"], fLOG=fLOG)
    def test_notebook_expose_reduce(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(sparkouille is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "expose")
        test_notebook_execution_coverage(__file__, "reduce", folder,
                                         this_module_name="sparkouille", fLOG=fLOG)
예제 #9
0
    def test_notebook_search(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "lectures")
        test_notebook_execution_coverage(
            __file__, "search", folder, 'papierstat', copy_files=[], fLOG=fLOG)
예제 #10
0
    def test_notebook_example_pyquickhelper(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks")
        test_notebook_execution_coverage(__file__, "compare_python_distribution", folder,
                                         'pyquickhelper', fLOG=fLOG,
                                         copy_files=["README.txt"])
    def test_notebook_tsp(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(ensae_teaching_cs is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "expose")
        test_notebook_execution_coverage(__file__, "TSP", folder,
                                         this_module_name="ensae_teaching_cs", fLOG=fLOG)
    def test_notebook_torch_perceptron_convolution_mnist(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(ensae_teaching_dl is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "101")
        test_notebook_execution_coverage(__file__, "300_Convolution", folder,
                                         this_module_name="ensae_teaching_dl", fLOG=fLOG)
예제 #13
0
    def test_notebook_tsp(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(ensae_teaching_cs is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "1a")
        test_notebook_execution_coverage(__file__, "coloriage", folder,
                                         this_module_name="ensae_teaching_cs", fLOG=fLOG)
    def test_notebook_onnx_pdist(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertNotEmpty(mlprodict is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks")
        test_notebook_execution_coverage(__file__, "onnx_operator_cost", folder,
                                         this_module_name="mlprodict", fLOG=fLOG)
예제 #15
0
    def test_notebook_quantile(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(mlinsights is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "sklearn")
        test_notebook_execution_coverage(
            __file__, "quantile", folder, 'mlinsights', fLOG=fLOG)
예제 #16
0
    def test_notebook_artificiel(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(pandas_streaming is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks")
        test_notebook_execution_coverage(
            __file__, "first_steps", folder, 'pandas_streaming', copy_files=[], fLOG=fLOG)
예제 #17
0
    def test_notebook_sklearn(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(jupytalk is not None)
        self.assertTrue(jyquickhelper is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "2019", "sklearn")
        test_notebook_execution_coverage(
            __file__, "sklearn", folder, 'jupytalk', copy_files=[], fLOG=fLOG)
예제 #18
0
    def test_notebook_artificiel(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "lectures")
        test_notebook_execution_coverage(
            __file__, "artificiel", folder, 'papierstat', copy_files=[], fLOG=fLOG,
            filter_name=lambda n: 'token' not in n and 'multiclass' not in n)
예제 #19
0
    def test_notebook_visualisation_enedis_bokeh(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        import pyensae
        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "visualisation")
        test_notebook_execution_coverage(
            __file__, "enedis_cartes_bokeh", folder, 'papierstat', copy_files=[], fLOG=fLOG,
            modules=[pyensae])
    def test_notebook_csharp_in_notebook(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(csharpy is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks")
        test_notebook_execution_coverage(__file__,
                                         "csharp_in_notebook",
                                         folder,
                                         this_module_name="csharpy",
                                         fLOG=fLOG)
예제 #21
0
    def test_notebook_topk(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        self.assertNotEmpty(mlprodict is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks")
        to_copy = ["800px-Tour_Eiffel_Wikimedia_Commons_(cropped).jpg"]
        test_notebook_execution_coverage(__file__, "transfer_learning", folder,
                                         this_module_name="mlprodict", fLOG=fLOG,
                                         copy_files=to_copy)
    def test_notebook_pydata_pydy(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        import pymyinstall
        self.assertTrue(jupytalk is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "2016", "pydata")
        test_notebook_execution_coverage(__file__, "pydy", folder,
                                         this_module_name="jupytalk", fLOG=fLOG,
                                         copy_files=["pydy.svg"], modules=[pymyinstall])
    def test_notebook_sklearn_grammar(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertNotEmpty(mlprodict is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks")
        test_notebook_execution_coverage(__file__,
                                         "sklearn_grammar",
                                         folder,
                                         this_module_name="mlprodict",
                                         fLOG=fLOG,
                                         copy_files=["README.txt"])
예제 #24
0
    def test_notebook_example_pyquickhelper(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(pymlbenchmark is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks")
        test_notebook_execution_coverage(__file__,
                                         "context",
                                         folder,
                                         this_module_name="pymlbenchmark",
                                         fLOG=fLOG,
                                         copy_files=["README.txt"])
    def test_notebook_artificiel_token(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        import nltk
        nltk.download('punkt')
        nltk.download('stopwords')

        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "lectures")
        test_notebook_execution_coverage(
            __file__, "artificiel_tokenize", folder, 'papierstat', copy_files=[], fLOG=fLOG)
예제 #26
0
    def test_notebook_msexp_onnx(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        import pymyinstall
        self.assertTrue(jupytalk is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "2018", "msexp")
        files = [_ for _ in os.listdir(
            folder) if '.png' in _ or '.csv' in _ or '.jpg' in _]
        test_notebook_execution_coverage(__file__, "onnx", folder,
                                         this_module_name="jupytalk", fLOG=fLOG,
                                         copy_files=files, modules=[pymyinstall])
예제 #27
0
    def test_notebook_encours_wines_2019(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "encours")
        test_notebook_execution_coverage(__file__,
                                         "2019",
                                         folder,
                                         'papierstat',
                                         copy_files=[],
                                         fLOG=fLOG,
                                         filter_name=lambda n: "2019" in n)
    def test_notebook_training(self):
        from pyquickhelper.ipythonhelper import test_notebook_execution_coverage
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(onnxcustom is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks")
        test_notebook_execution_coverage(__file__,
                                         "training",
                                         folder,
                                         'onnxcustom',
                                         copy_files=[],
                                         fLOG=fLOG)
    def test_notebook_sentiment(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        def valid(cell):
            if "dico[0]  ##" in cell:
                return False
            return True

        self.assertTrue(ensae_teaching_cs is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "td2a_ml")
        test_notebook_execution_coverage(__file__, "sentiment", folder, valid=valid,
                                         this_module_name="ensae_teaching_cs", fLOG=fLOG)
    def test_notebook_pydata_pydy(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        import pymyinstall
        self.assertTrue(jupytalk is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "2016", "pydata")
        test_notebook_execution_coverage(__file__,
                                         "pydy",
                                         folder,
                                         this_module_name="jupytalk",
                                         fLOG=fLOG,
                                         copy_files=["pydy.svg"],
                                         modules=[pymyinstall])
예제 #31
0
    def test_run_re2(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        import jyquickhelper as jyq  # pylint: disable=C0415
        self.assertNotEmpty(jyq)
        self.assertNotEmpty(wrapclib)

        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks")
        test_notebook_execution_coverage(__file__,
                                         "re2",
                                         folder,
                                         this_module_name='wrapclib',
                                         fLOG=fLOG)
예제 #32
0
    def test_notebook_sql_map_reduce(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        import pymyinstall  # pylint: disable=C0415
        self.assertTrue(sparkouille is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "sql")
        test_notebook_execution_coverage(__file__,
                                         "sql_map_reduce",
                                         folder,
                                         this_module_name="sparkouille",
                                         fLOG=fLOG,
                                         copy_files=["README.txt"],
                                         modules=[pymyinstall])
예제 #33
0
    def test_notebook_lectures_linreg(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(papierstat is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "lectures")
        test_notebook_execution_coverage(__file__,
                                         "logreg",
                                         folder,
                                         'papierstat',
                                         copy_files=[],
                                         fLOG=fLOG,
                                         filter_name=lambda n: "" in n,
                                         valid=lambda cell: sys.platform !=
                                         "win32" or "dtreeviz" not in cell)
예제 #34
0
    def test_notebook_logregclus(self):
        fLOG(__file__,
             self._testMethodName,
             OutputPrint=__name__ == "__main__")

        self.assertTrue(mlinsights is not None)
        folder = os.path.join(os.path.dirname(__file__), "..", "..", "_doc",
                              "notebooks", "sklearn")
        try:
            test_notebook_execution_coverage(__file__,
                                             "logistic_regression_clustering",
                                             folder,
                                             'mlinsights',
                                             fLOG=fLOG)
        except Exception as e:
            if compare_module_version(sklver, "0.24") < 0:
                return
            raise e
    def test_notebook_2018_2019(self):
        fLOG(
            __file__,
            self._testMethodName,
            OutputPrint=__name__ == "__main__")

        def valid(cell):
            if "nuplet[1] = 5" in cell:
                return False
            if "dico[0]  ##" in cell:
                return False
            if "dico[ [4,6] ] = 6" in cell:
                return False
            return True

        self.assertTrue(ensae_teaching_cs is not None)
        folder = os.path.join(os.path.dirname(__file__),
                              "..", "..", "_doc", "notebooks", "notebook_eleves", "2018-2019")
        test_notebook_execution_coverage(__file__, "", folder, valid=valid,
                                         this_module_name="ensae_teaching_cs", fLOG=fLOG,
                                         copy_files=['titanic.csv/titanic.csv'])