diff --git a/01-model/model.json b/01-model/model.json index 95be353..1b5dd22 100644 --- a/01-model/model.json +++ b/01-model/model.json @@ -3,7 +3,7 @@ "description": "The machine learning meta-model with synthetic data (useful for MLOps/feature store), part of the quality gate concept.", "kind": "model", "spec": { - "version": "0.1.9", + "version": "0.2.0", "CSV_SEPARATOR": ",", "CSV_DECIMAL": "." } diff --git a/generator/version.py b/generator/version.py index 35e55b3..923f05d 100644 --- a/generator/version.py +++ b/generator/version.py @@ -1,3 +1,3 @@ # Store the version here so: -__version__ = '0.1.8' \ No newline at end of file +__version__ = '0.1.9' \ No newline at end of file diff --git a/tests/test_generator.py b/tests/test_generator.py index bf73f98..57d8a53 100644 --- a/tests/test_generator.py +++ b/tests/test_generator.py @@ -16,7 +16,7 @@ def setUpClass(cls): # setup the same dir for different unit test execution if os.path.split(os.getcwd())[-1]!="tests": os.chdir("tests") - print(f"!!! Change directory for test execution to '{os.getcwd()}' !!!") + print(f"ONLY INFO: Change directory for test execution to '{os.getcwd()}'.") shutil.rmtree(TestGenerator.OUTPUT_ADR, True) @@ -44,6 +44,26 @@ def test_generate_compress_smallbulk(self): self.assertTrue(os.path.exists(dir)) self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv.gz"))) + def test_generate_compress_smallbulk(self): + lbl="0-size-20,6-compress" + + generator = SyntheticData(os.path.join("..","01-model"),TestGenerator.OUTPUT_ADR, TestGenerator.OUTPUT_ADR) + generator.generate(label=lbl, count=20, bulk_max=6, compress=True) + + dir=path.join(TestGenerator.OUTPUT_ADR, lbl) + self.assertTrue(os.path.exists(dir)) + self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv.gz"))) + + def test_generate_compress_super_smallbulk(self): + lbl="0-size-s-10,6-compress" + + generator = SyntheticData(os.path.join("..","01-model"),TestGenerator.OUTPUT_ADR, TestGenerator.OUTPUT_ADR) + generator.generate(label=lbl, count=10, bulk_max=6, compress=True) + + dir=path.join(TestGenerator.OUTPUT_ADR, lbl) + self.assertTrue(os.path.exists(dir)) + self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv.gz"))) + def test_generate(self): lbl = "0-size-200,20" @@ -64,6 +84,16 @@ def test_generate_smallbulk(self): self.assertTrue(os.path.exists(dir)) self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv"))) + def test_generate_super_smallbulk(self): + lbl = "0-size-s-10,6" + + generator = SyntheticData(os.path.join("..","01-model"),TestGenerator.OUTPUT_ADR, TestGenerator.OUTPUT_ADR) + generator.generate(label=lbl, count=10, bulk_max=6, compress=False) + + dir = path.join(TestGenerator.OUTPUT_ADR, lbl) + self.assertTrue(os.path.exists(dir)) + self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv"))) + def test_generate_bigbulk(self): lbl = "0-size-2000,2000" @@ -73,3 +103,5 @@ def test_generate_bigbulk(self): dir = path.join(TestGenerator.OUTPUT_ADR, lbl) self.assertTrue(os.path.exists(dir)) self.assertTrue(os.path.exists(path.join(dir, f"{BasicCommunication.NAME}.csv"))) + + # TODO: Add batch size under limit, it will generate wrong dataset \ No newline at end of file