diff --git a/ElM2D/ElM2D.py b/ElM2D/ElM2D.py index c2e4d0f..0f7fac9 100644 --- a/ElM2D/ElM2D.py +++ b/ElM2D/ElM2D.py @@ -422,9 +422,19 @@ def import_embedding(self, path): def featurize(self, compositions, how="mean"): elmd_obj = ElMD(metric=self.metric) - vectors = np.ndarray((len(compositions), len(elmd_obj.periodic_tab[self.metric]))) - for i, formula in enumerate(compositions): - vectors[i] = ElMD(formula, metric=self.metric, feature_pooling=how).feature_vector + vectors = np.ndarray((len(compositions), len(elmd_obj.periodic_tab[self.metric]["H"]))) + + if self.verbose: + print("Constructing compositionally weighted feature vectors for each composition") + for i, formula in tqdm(list(enumerate(compositions))): + vectors[i] = ElMD(formula, metric=self.metric, feature_pooling=how).feature_vector + + print("Complete") + + + else: + for i, formula in enumerate(compositions): + vectors[i] = ElMD(formula, metric=self.metric, feature_pooling=how).feature_vector return vectors \ No newline at end of file diff --git a/setup.py b/setup.py index 9d2866a..f84221a 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,13 @@ setup( name = 'ElM2D', packages = ['ElM2D'], - version = '0.3.3', + version = '0.3.4', license='GPL3', description = 'A high performance mapping class to embed large datasets of ionic compositions with respect to the ElMD metric.', author = 'Cameron Hagreaves', author_email = 'cameron.h@rgreaves.me.uk', url = 'https://github.com/lrcfmd/ElM2D/', - download_url = 'https://github.com/lrcfmd/ElM2D/archive/0.3.3.tar.gz', + download_url = 'https://github.com/lrcfmd/ElM2D/archive/0.3.4.tar.gz', keywords = ['ChemInformatics', 'Materials Science', 'Machine Learning', 'Materials Representation'], install_requires=[ 'cython',