Skip to content

Commit

Permalink
Fixed syntax for new version
Browse files Browse the repository at this point in the history
  • Loading branch information
SurgeArrester committed Mar 7, 2021
1 parent f6c4873 commit 8477660
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
13 changes: 10 additions & 3 deletions ElM2D/ElM2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def _process_list(self, formula_list, n_proc):
self.input_mat = np.ndarray(shape=(len(formula_list), 103), dtype=np.float64)

for i, formula in enumerate(formula_list):
self.input_mat[i] = ElMD(formula, metric=self.metric).vector_form
self.input_mat[i] = ElMD(formula, metric=self.metric).ratio_vector

# Create input pairings
if self.verbose:
Expand Down Expand Up @@ -386,9 +386,13 @@ def _pool_ElMD(self, input_tuple):
Uses multiprocessing module to call the numba compiled EMD function
'''
distances = np.ndarray(len(input_tuple))

elmd_obj = ElMD(metric=self.metric)

for i, (input_1, input_2) in enumerate(input_tuple):
distances[i] = EMD(self.input_mat[input_1], self.input_mat[input_2])
distances[i] = EMD(self.input_mat[input_1],
self.input_mat[input_2],
elmd_obj.lookup,
elmd_obj.periodic_tab[self.metric])

return distances

Expand All @@ -398,6 +402,9 @@ def __repr__(self):
else:
return f"ElM2D()"

def features(self):


def export_dm(self, path):
np.savetxt(path, self.dm, delimiter=",")

Expand Down
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.1',
version = '0.3.2',
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.1.tar.gz',
download_url = 'https://github.com/lrcfmd/ElM2D/archive/0.3.2.tar.gz',
keywords = ['ChemInformatics', 'Materials Science', 'Machine Learning', 'Materials Representation'],
install_requires=[
'cython',
Expand Down

0 comments on commit 8477660

Please sign in to comment.