Skip to content

Commit

Permalink
Added loading bars to featurize
Browse files Browse the repository at this point in the history
  • Loading branch information
SurgeArrester committed Mar 7, 2021
1 parent 22dc500 commit 3c284ec
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
16 changes: 13 additions & 3 deletions ElM2D/ElM2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 3c284ec

Please sign in to comment.