Skip to content
Snippets Groups Projects
Commit bf97c377 authored by Chris Smith's avatar Chris Smith
Browse files

Added allowed methods to cluster class

parent 8adefbc7
No related branches found
No related tags found
1 merge request!10Decomposition and other stuff
......@@ -18,7 +18,7 @@ from ..io_utils import getAvailableMem
from ..hdf_utils import getAuxData, getDataSet, getH5DsetRefs, linkRefs
from ..io_hdf5 import ioHDF5
from ...viz.plot_utils import plot1DSpectrum, plot2DSpectrogram, plotHistgrams
from pycroscopy.processing.proc_utils import buildHistogram
from ...processing.proc_utils import buildHistogram
import h5py
#%%############################################################################
......
......@@ -32,12 +32,15 @@ class Cluster(object):
*args and **kwargs : arguments to be passed to the estimator
"""
allowed_methods = ['AgglomerativeClustering','Birch','KMeans',
'MiniBatchKMeans','SpectralClustering']
# check if h5_main is a valid object - is it a hub?
if not checkIfMain(h5_main):
raise TypeError('Supplied dataset is not a pycroscopy main dataset')
if method_name == 'FeatureAgglomeration':
raise TypeError('Cannot work with FeatureAgglomeration just yet')
if method_name not in allowed_methods:
raise TypeError('Cannot work with {} just yet'.format(method_name))
self.h5_main = h5_main
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment