Skip to content

Commit

Permalink
Merge pull request #136 from george0st/change
Browse files Browse the repository at this point in the history
Tune tests
  • Loading branch information
george0st authored Apr 2, 2024
2 parents 185de1a + 188d01d commit f61b877
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
2 changes: 1 addition & 1 deletion 01-model/model.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": "."
}
Expand Down
2 changes: 1 addition & 1 deletion generator/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Store the version here so:

__version__ = '0.1.8'
__version__ = '0.1.9'
34 changes: 33 additions & 1 deletion tests/test_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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"

Expand All @@ -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"

Expand All @@ -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

0 comments on commit f61b877

Please sign in to comment.