Skip to content

Commit 85e062e

Browse files
authored
Remove pkl files (#116)
* Doesn't generate pkl files anymore * Increase epochs so test doesn't fail * Fix lint * Fix lint
1 parent 1ecefec commit 85e062e

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

tests/integration/test_ctgan.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
model are not checked.
1010
"""
1111

12+
import tempfile as tf
13+
1214
import numpy as np
1315
import pandas as pd
1416

@@ -120,9 +122,10 @@ def test_save_load():
120122

121123
ctgan = CTGANSynthesizer(epochs=1)
122124
ctgan.fit(data, discrete_columns)
123-
ctgan.save("test_ctgan.pkl")
124125

125-
ctgan = CTGANSynthesizer.load("test_ctgan.pkl")
126+
with tf.TemporaryDirectory() as temporary_directory:
127+
ctgan.save(temporary_directory + "test_tvae.pkl")
128+
ctgan = CTGANSynthesizer.load(temporary_directory + "test_tvae.pkl")
126129

127130
sampled = ctgan.sample(1000)
128131
assert set(sampled.columns) == {'continuous', 'discrete'}

tests/integration/test_tvae.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
model are not checked.
1010
"""
1111

12+
import tempfile as tf
13+
1214
import numpy as np
1315
import pandas as pd
1416

@@ -70,11 +72,12 @@ def test_save_load():
7072
})
7173
discrete_columns = ['discrete']
7274

73-
tvae = TVAESynthesizer(epochs=1)
75+
tvae = TVAESynthesizer(epochs=10)
7476
tvae.fit(data, discrete_columns)
75-
tvae.save("test_tvae.pkl")
7677

77-
tvae = TVAESynthesizer.load("test_tvae.pkl")
78+
with tf.TemporaryDirectory() as temporary_directory:
79+
tvae.save(temporary_directory + "test_tvae.pkl")
80+
tvae = TVAESynthesizer.load(temporary_directory + "test_tvae.pkl")
7881

7982
sampled = tvae.sample(1000)
8083
assert set(sampled.columns) == {'continuous', 'discrete'}

0 commit comments

Comments
 (0)