Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SurgeArrester committed Feb 27, 2021
1 parent 5e98ad0 commit 95f7540
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
2 changes: 0 additions & 2 deletions ElM2D/ElM2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@
import plotly.express as px
import plotly.io as pio

def main():
df =

class ElM2D():
'''
Expand Down
44 changes: 43 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,44 @@
# ElM2D
A mapping class to construct ElM2D plots from lists of compositions in a high performance manner
A high performance mapping class to construct ElM2D plots from larger datasets of ionic compositions.

Recommended installation through `pip`

```
pip install ElM2D
```

## Usage

### Sorting

To sort a list of compositions into an ordering of chemical similarity call

```python
from ElM2D import ElM2D
...

comps = df["formula"].to_numpy()
sorted_indices = ElM2D().sort_compositions(comps)
sorted_comps = comps[sorted_indices]
```

### Embedding

Embeddings can be constructed through either the UMAP or PCA methods of dimensionality reduction. The embedded points are accessible via the `embedding` property. Higher dimensional embeddings can be created with the `n_components` parameter.

```python
mapper = ElMD()
embedding = mapper.fit_transform(df["formula"])
embedding = mapper.fit_transform(df["formula"], how="PCA", n_components=7)
```

These embeddings may be visualized within a jupyter notebook, or exported to HTML to view in the web browser.

```python
mapper.fit_transform(df["formula"])
mapper.plot() # Returns a figure for viewing in notebooks
...
mapper.plot("ElM2D_Plot_UMAP.html") # Returns a figure and saves as ElM2D_Plot_UMAP.html
```


4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
setup(
name = 'ElM2D',
packages = ['ElM2D'],
version = '0.1.0',
version = '0.1.1',
license='GPL3',
description = 'A mapping class to perform the ElMD metric on datasets on ionic compositions',
description = 'A 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/',
Expand Down

0 comments on commit 95f7540

Please sign in to comment.