Skip to content

Commit

Permalink
update github workflows and update installation instruction in readme (
Browse files Browse the repository at this point in the history
…#21)

* update github workflows and update installation instruction in readme

* update ubuntu runner versions

* update the minimal test in readme

* run workflows on multiple ubuntu versions

* only test on latest ubuntu

* update installation instruction

* update pyproject

* update mattersim banner

* update mattersim banner

---------

Co-authored-by: Han Yang <[email protected]>
  • Loading branch information
yanghan234 and yanghan-microsoft authored Nov 27, 2024
1 parent a6edc20 commit 1e75e36
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>
<p align="center">
<img src="docs/_static/mattersim-banner.jpg" alt="MatterSim logo" width="600"/>
<img src="docs/_static/mattersim-banner.png" alt="MatterSim logo" width="600"/>
</p>
</h1>

Expand All @@ -18,27 +18,32 @@ MatterSim is a deep learning atomistic model across elements, temperatures and p

## Installation
### Install from source code
Requirements:
- Python == 3.9
> [!WARNING]
> We strongly recommend that users install MatterSim using [mamba or micromamba](https://mamba.readthedocs.io/en/latest/index.html), because *conda* can be significantly slower when resolving the dependencies in environment.yaml.
To install the package, run the following command under the root of the folder:
```bash
conda env create -f environment.yaml
conda activate mattersim
mamba env create -f environment.yaml
mamba activate mattersim
pip install -e .
python setup.py build_ext --inplace
```

## Usage
### A minimal test
```python
import torch
from ase.build import bulk
from mattersim.forcefield.potential import Potential
from mattersim.datasets.utils.build import build_dataloader

potential = Potential.load(load_path="/path/to/checkpoint", device="cuda:0")
from ase.build import bulk
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
print(f"Running MatterSim on {device}")

potential = Potential.load(load_path="pretrained_models/mattersim-v1.0.0-1M.pth", device=device)
si = bulk("Si", "diamond", a=5.43)
dataloader = build_dataloader([si], only_inference=True, model_type=model_name)
dataloader = build_dataloader([si], only_inference=True)

predictions = potential.predict_properties(dataloader, include_forces=True, include_stresses=True)
print(predictions)
```
Expand Down
Binary file removed docs/_static/mattersim-banner.jpg
Binary file not shown.
Binary file added docs/_static/mattersim-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mattersim"
version = "1.0"
version = "1.0.0"
description = "MatterSim: A Deep Learning Atomistic Model Across Elements, Temperatures and Pressures."
authors = [
{name = "Han Yang", email = "[email protected]"},
Expand Down

0 comments on commit 1e75e36

Please sign in to comment.