From d218ef0097174897634477bcc180b6268ba6c337 Mon Sep 17 00:00:00 2001 From: Paweł Redman Date: Sat, 25 Jul 2020 23:19:41 +0200 Subject: Ensure Python 2 compatibility. --- clustering.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'clustering.py') diff --git a/clustering.py b/clustering.py index 6df6643..d8b1ed9 100644 --- a/clustering.py +++ b/clustering.py @@ -9,7 +9,7 @@ from otsu2018 import load_Otsu2018_spectra, Otsu2018Tree if __name__ == '__main__': print('Loading spectral data...') - sds = load_Otsu2018_spectra('CommonData/spectrum_m.csv', every_nth=7) + sds = load_Otsu2018_spectra('CommonData/spectrum_m.csv', every_nth=100) shape = SpectralShape(380, 730, 10) print('Initializing the tree...') @@ -23,8 +23,9 @@ if __name__ == '__main__': print('Error before: %g' % before) print('Error after: %g' % after) - print('Saving the dataset...') - os.makedirs('datasets', exist_ok=True) + print('Saving the dataset...') + if not os.path.exists('datasets'): + os.makedirs('datasets') data = tree.to_dataset() data.to_file('datasets/otsu2018.npz') data.to_Python_file('datasets/otsu2018.py') -- cgit