Spaces:
Running
Running
add stability data, update page
Browse fileshandle large files
handle large files
- .gitattributes +1 -0
- .gitignore +2 -0
- mlip_arena/models/__init__.py +9 -2
- mlip_arena/models/registry.yaml +1 -1
- mlip_arena/tasks/stability/chgnet/chloride-salts.json +1 -0
- mlip_arena/tasks/stability/equiformer/chloride-salts.json +1 -0
- mlip_arena/tasks/stability/mace-mp/chloride-salts.json +1 -0
- mlip_arena/tasks/stability/run.py +1 -0
- pyproject.toml +1 -0
- serve/tasks/homonuclear-diatomics.py +2 -0
- serve/tasks/stability.py +47 -7
.gitattributes
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
.json filter=lfs diff=lfs merge=lfs -text
|
.gitignore
CHANGED
@@ -2,8 +2,10 @@ tests/
|
|
2 |
*.out
|
3 |
*.ipynb
|
4 |
*.extxyz
|
|
|
5 |
mlip_arena/tasks/*/*/*/
|
6 |
|
|
|
7 |
# Byte-compiled / optimized / DLL files
|
8 |
__pycache__/
|
9 |
*.py[cod]
|
|
|
2 |
*.out
|
3 |
*.ipynb
|
4 |
*.extxyz
|
5 |
+
*.traj
|
6 |
mlip_arena/tasks/*/*/*/
|
7 |
|
8 |
+
|
9 |
# Byte-compiled / optimized / DLL files
|
10 |
__pycache__/
|
11 |
*.py[cod]
|
mlip_arena/models/__init__.py
CHANGED
@@ -13,6 +13,7 @@ from torch import nn
|
|
13 |
with open(Path(__file__).parent / "registry.yaml") as f:
|
14 |
REGISTRY = yaml.safe_load(f)
|
15 |
|
|
|
16 |
class MLIP(
|
17 |
nn.Module,
|
18 |
PyTorchModelHubMixin,
|
@@ -25,6 +26,7 @@ class MLIP(
|
|
25 |
def forward(self, x):
|
26 |
return self.model(x)
|
27 |
|
|
|
28 |
class MLIPCalculator(MLIP, Calculator):
|
29 |
name: str
|
30 |
implemented_properties: list[str] = ["energy", "forces", "stress"]
|
@@ -39,7 +41,9 @@ class MLIPCalculator(MLIP, Calculator):
|
|
39 |
calculator_kwargs: dict = {},
|
40 |
):
|
41 |
MLIP.__init__(self, model=model) # Initialize MLIP part
|
42 |
-
Calculator.__init__(
|
|
|
|
|
43 |
# Additional initialization if needed
|
44 |
# self.name: str = self.__class__.__name__
|
45 |
# self.device = device or torch.device(
|
@@ -49,7 +53,10 @@ class MLIPCalculator(MLIP, Calculator):
|
|
49 |
# self.implemented_properties = ["energy", "forces", "stress"]
|
50 |
|
51 |
def calculate(
|
52 |
-
self,
|
|
|
|
|
|
|
53 |
):
|
54 |
"""Calculate energies and forces for the given Atoms object"""
|
55 |
super().calculate(atoms, properties, system_changes)
|
|
|
13 |
with open(Path(__file__).parent / "registry.yaml") as f:
|
14 |
REGISTRY = yaml.safe_load(f)
|
15 |
|
16 |
+
|
17 |
class MLIP(
|
18 |
nn.Module,
|
19 |
PyTorchModelHubMixin,
|
|
|
26 |
def forward(self, x):
|
27 |
return self.model(x)
|
28 |
|
29 |
+
|
30 |
class MLIPCalculator(MLIP, Calculator):
|
31 |
name: str
|
32 |
implemented_properties: list[str] = ["energy", "forces", "stress"]
|
|
|
41 |
calculator_kwargs: dict = {},
|
42 |
):
|
43 |
MLIP.__init__(self, model=model) # Initialize MLIP part
|
44 |
+
Calculator.__init__(
|
45 |
+
self, restart=restart, atoms=atoms, directory=directory, **calculator_kwargs
|
46 |
+
) # Initialize ASE Calculator part
|
47 |
# Additional initialization if needed
|
48 |
# self.name: str = self.__class__.__name__
|
49 |
# self.device = device or torch.device(
|
|
|
53 |
# self.implemented_properties = ["energy", "forces", "stress"]
|
54 |
|
55 |
def calculate(
|
56 |
+
self,
|
57 |
+
atoms: Atoms,
|
58 |
+
properties: list[str],
|
59 |
+
system_changes: list = all_changes,
|
60 |
):
|
61 |
"""Calculate energies and forces for the given Atoms object"""
|
62 |
super().calculate(atoms, properties, system_changes)
|
mlip_arena/models/registry.yaml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
MACE-MP(M):
|
4 |
module: externals
|
5 |
class: MACE_MP_Medium
|
6 |
-
family: mace
|
7 |
username: cyrusyc # HF username
|
8 |
last-update: 2024-03-25T14:30:00
|
9 |
datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
|
|
|
3 |
MACE-MP(M):
|
4 |
module: externals
|
5 |
class: MACE_MP_Medium
|
6 |
+
family: mace-mp
|
7 |
username: cyrusyc # HF username
|
8 |
last-update: 2024-03-25T14:30:00
|
9 |
datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
|
mlip_arena/tasks/stability/chgnet/chloride-salts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[{"material_id":"mp-568540","formula":"Ag135Cl135Hg108P216","method":"CHGNet","natoms":594,"total_time_seconds":878.366427,"total_steps":340,"steps_per_second":0.3870821898,"seconds_per_step":2.5834306676,"seconds_per_step_per_atom":0.0043492099},{"material_id":"mp-28361","formula":"Al72Cd36Cl288","method":"CHGNet","natoms":396,"total_time_seconds":2024.840096,"total_steps":49990,"steps_per_second":24.6883692686,"seconds_per_step":0.0405049029,"seconds_per_step_per_atom":0.0001022851},{"material_id":"mp-566301","formula":"As48Cl16O192Pb80","method":"CHGNet","natoms":336,"total_time_seconds":2443.199102,"total_steps":49990,"steps_per_second":20.4608785093,"seconds_per_step":0.0488737568,"seconds_per_step_per_atom":0.0001454576},{"material_id":"mp-553919","formula":"Ag162Cl27F81Mo54O189","method":"CHGNet","natoms":513,"total_time_seconds":49.747983,"total_steps":210,"steps_per_second":4.2212766696,"seconds_per_step":0.2368951571,"seconds_per_step_per_atom":0.0004617839},{"material_id":"mp-567334","formula":"Ag64B384Cl384","method":"CHGNet","natoms":832,"total_time_seconds":6094.657858,"total_steps":4020,"steps_per_second":0.6595940402,"seconds_per_step":1.5160840443,"seconds_per_step_per_atom":0.0018222164},{"material_id":"mp-637206","formula":"Al64Bi64Cl256Se64","method":"CHGNet","natoms":448,"total_time_seconds":2102.670703,"total_steps":49990,"steps_per_second":23.7745263339,"seconds_per_step":0.0420618264,"seconds_per_step_per_atom":0.000093888},{"material_id":"mp-27346","formula":"Al48Cl192Hg72","method":"CHGNet","natoms":312,"total_time_seconds":620.864262,"total_steps":190,"steps_per_second":0.3060250229,"seconds_per_step":3.2677066421,"seconds_per_step_per_atom":0.0104734187},{"material_id":"mp-680722","formula":"As32Cl64O272Pb224","method":"CHGNet","natoms":592,"total_time_seconds":153.997307,"total_steps":540,"steps_per_second":3.5065548257,"seconds_per_step":0.2851801981,"seconds_per_step_per_atom":0.0004817233},{"material_id":"mp-567734","formula":"Al32As96Cl128Se128","method":"CHGNet","natoms":384,"total_time_seconds":1934.45237,"total_steps":49990,"steps_per_second":25.8419389256,"seconds_per_step":0.0386967868,"seconds_per_step_per_atom":0.0001007729},{"material_id":"mp-672352","formula":"Al48Cl288I144","method":"CHGNet","natoms":480,"total_time_seconds":697.476109,"total_steps":1940,"steps_per_second":2.7814572786,"seconds_per_step":0.3595237675,"seconds_per_step_per_atom":0.0007490078},{"material_id":"mp-27863","formula":"Al100Cl100O100","method":"CHGNet","natoms":300,"total_time_seconds":2977.600956,"total_steps":1181,"steps_per_second":0.3966280296,"seconds_per_step":2.5212539848,"seconds_per_step_per_atom":0.0084041799}]
|
mlip_arena/tasks/stability/equiformer/chloride-salts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[{"material_id":"mp-25469","formula":"Al54Cl162","method":"EquiformerV2(OC22)","natoms":216,"total_time_seconds":1289.686627,"total_steps":49990,"steps_per_second":38.7613540789,"seconds_per_step":0.0257988923,"seconds_per_step_per_atom":0.0001194393},{"material_id":"mp-568540","formula":"Ag135Cl135Hg108P216","method":"EquiformerV2(OC22)","natoms":594,"total_time_seconds":855.203801,"total_steps":340,"steps_per_second":0.3975660534,"seconds_per_step":2.5153052971,"seconds_per_step_per_atom":0.0042345207},{"material_id":"mp-568923","formula":"B96Ba192Cl96N192","method":"EquiformerV2(OC22)","natoms":576,"total_time_seconds":799.132371,"total_steps":11900,"steps_per_second":14.891149992,"seconds_per_step":0.0671539808,"seconds_per_step_per_atom":0.0001165868},{"material_id":"mp-568443","formula":"Al32Cl128V16","method":"EquiformerV2(OC22)","natoms":176,"total_time_seconds":1179.514714,"total_steps":49990,"steps_per_second":42.3818367051,"seconds_per_step":0.0235950133,"seconds_per_step_per_atom":0.0001340626},{"material_id":"mp-28361","formula":"Al72Cd36Cl288","method":"EquiformerV2(OC22)","natoms":396,"total_time_seconds":516.631174,"total_steps":1301,"steps_per_second":2.5182375077,"seconds_per_step":0.3971031314,"seconds_per_step_per_atom":0.0010027857},{"material_id":"mp-1214746","formula":"Ba48Cl168Dy24","method":"EquiformerV2(OC22)","natoms":240,"total_time_seconds":1189.535266,"total_steps":40720,"steps_per_second":34.2318560566,"seconds_per_step":0.0292125556,"seconds_per_step_per_atom":0.000121719},{"material_id":"mp-22993","formula":"Ag64Cl64O256","method":"EquiformerV2(OC22)","natoms":384,"total_time_seconds":2998.510846,"total_steps":49990,"steps_per_second":16.6716088643,"seconds_per_step":0.0599822134,"seconds_per_step_per_atom":0.0001562037},{"material_id":"mp-566301","formula":"As48Cl16O192Pb80","method":"EquiformerV2(OC22)","natoms":336,"total_time_seconds":7681.971428,"total_steps":3123,"steps_per_second":0.4065362686,"seconds_per_step":2.4598051322,"seconds_per_step_per_atom":0.0073208486},{"material_id":"mp-555805","formula":"Al36Cl252S36","method":"EquiformerV2(OC22)","natoms":324,"total_time_seconds":2034.579734,"total_steps":49990,"steps_per_second":24.5701847731,"seconds_per_step":0.0406997346,"seconds_per_step_per_atom":0.0001256165},{"material_id":"mp-1214988","formula":"Ag16Cl208Mo96","method":"EquiformerV2(OC22)","natoms":320,"total_time_seconds":1770.09089,"total_steps":49990,"steps_per_second":28.2414876447,"seconds_per_step":0.0354088996,"seconds_per_step_per_atom":0.0001106528},{"material_id":"mp-567334","formula":"Ag64B384Cl384","method":"EquiformerV2(OC22)","natoms":832,"total_time_seconds":3567.962024,"total_steps":4214,"steps_per_second":1.1810663823,"seconds_per_step":0.8466924594,"seconds_per_step_per_atom":0.0010176592},{"material_id":"mp-638061","formula":"Al48Cl192In48","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":1576.40944,"total_steps":49990,"steps_per_second":31.7113046468,"seconds_per_step":0.0315344957,"seconds_per_step_per_atom":0.0001094948},{"material_id":"mp-560833","formula":"B72Cl24O240Pb144","method":"EquiformerV2(OC22)","natoms":480,"total_time_seconds":3217.219664,"total_steps":49990,"steps_per_second":15.5382613626,"seconds_per_step":0.0643572647,"seconds_per_step_per_atom":0.0001340776},{"material_id":"mp-560549","formula":"Au64Cl64O192Se64","method":"EquiformerV2(OC22)","natoms":384,"total_time_seconds":2518.062072,"total_steps":49990,"steps_per_second":19.8525685907,"seconds_per_step":0.0503713157,"seconds_per_step_per_atom":0.0001311753},{"material_id":"mp-637206","formula":"Al64Bi64Cl256Se64","method":"EquiformerV2(OC22)","natoms":448,"total_time_seconds":1762.787761,"total_steps":1895,"steps_per_second":1.0750017909,"seconds_per_step":0.9302310084,"seconds_per_step_per_atom":0.0020764085},{"material_id":"mp-510724","formula":"As72Cl24O216Pb120","method":"EquiformerV2(OC22)","natoms":432,"total_time_seconds":2746.961559,"total_steps":49990,"steps_per_second":18.1982888826,"seconds_per_step":0.0549502212,"seconds_per_step_per_atom":0.0001271996},{"material_id":"mp-551456","formula":"Ba80Cl40Cu40O80","method":"EquiformerV2(OC22)","natoms":240,"total_time_seconds":48569.923768,"total_steps":1294,"steps_per_second":0.0266420019,"seconds_per_step":37.5347169768,"seconds_per_step_per_atom":0.1563946541},{"material_id":"mp-23575","formula":"As32Cl96F192Se96","method":"EquiformerV2(OC22)","natoms":416,"total_time_seconds":7242.212461,"total_steps":3086,"steps_per_second":0.4261128787,"seconds_per_step":2.3467960016,"seconds_per_step_per_atom":0.0056413365},{"material_id":"mp-27346","formula":"Al48Cl192Hg72","method":"EquiformerV2(OC22)","natoms":312,"total_time_seconds":56.74321,"total_steps":320,"steps_per_second":5.6394412653,"seconds_per_step":0.1773225312,"seconds_per_step_per_atom":0.0005683414},{"material_id":"mp-30023","formula":"Al48Ba24Cl192","method":"EquiformerV2(OC22)","natoms":264,"total_time_seconds":1444.744189,"total_steps":49990,"steps_per_second":34.6012812376,"seconds_per_step":0.0289006639,"seconds_per_step_per_atom":0.0001094722},{"material_id":"mp-628665","formula":"Al64Bi64Cl256Te64","method":"EquiformerV2(OC22)","natoms":448,"total_time_seconds":1954.564983,"total_steps":49990,"steps_per_second":25.576023532,"seconds_per_step":0.0390991195,"seconds_per_step_per_atom":0.0000872748},{"material_id":"mp-28192","formula":"Au32Cl160S32","method":"EquiformerV2(OC22)","natoms":224,"total_time_seconds":9731.339255,"total_steps":59,"steps_per_second":0.0060628859,"seconds_per_step":164.9379534746,"seconds_per_step_per_atom":0.7363301494},{"material_id":"mp-28372","formula":"Au32Cl224Se32","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":1591.957321,"total_steps":49990,"steps_per_second":31.4015955959,"seconds_per_step":0.0318455155,"seconds_per_step_per_atom":0.0001105747},{"material_id":"mp-1204489","formula":"Al32Br32Cl128Sb64Te64","method":"EquiformerV2(OC22)","natoms":320,"total_time_seconds":1641.572844,"total_steps":49990,"steps_per_second":30.4525018081,"seconds_per_step":0.0328380245,"seconds_per_step_per_atom":0.0001026188},{"material_id":"mp-556418","formula":"Al36Cl108O72S36","method":"EquiformerV2(OC22)","natoms":252,"total_time_seconds":1476.543336,"total_steps":49990,"steps_per_second":33.856100787,"seconds_per_step":0.0295367741,"seconds_per_step_per_atom":0.0001172094},{"material_id":"mp-556587","formula":"Au32Cl224S32","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":1547.017976,"total_steps":49990,"steps_per_second":32.3137809486,"seconds_per_step":0.0309465488,"seconds_per_step_per_atom":0.0001074533},{"material_id":"mp-561268","formula":"As72Cl24O144Pb48","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":2060.350209,"total_steps":49990,"steps_per_second":24.2628654981,"seconds_per_step":0.0412152472,"seconds_per_step_per_atom":0.0001431085},{"material_id":"mp-32780","formula":"Au108Cl108","method":"EquiformerV2(OC22)","natoms":216,"total_time_seconds":1337.166632,"total_steps":49990,"steps_per_second":37.3850190423,"seconds_per_step":0.0267486824,"seconds_per_step_per_atom":0.0001238365},{"material_id":"mp-556705","formula":"As32Cl96F192S32","method":"EquiformerV2(OC22)","natoms":352,"total_time_seconds":2386.766314,"total_steps":49990,"steps_per_second":20.9446562518,"seconds_per_step":0.0477448753,"seconds_per_step_per_atom":0.0001356389},{"material_id":"mp-27647","formula":"Au72Cl216","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":1436.317195,"total_steps":49990,"steps_per_second":34.80428987,"seconds_per_step":0.0287320903,"seconds_per_step_per_atom":0.0000997642},{"material_id":"mp-651358","formula":"Ba48Cl168Er24","method":"EquiformerV2(OC22)","natoms":240,"total_time_seconds":1420.480535,"total_steps":49990,"steps_per_second":35.1923160989,"seconds_per_step":0.0284152938,"seconds_per_step_per_atom":0.0001183971},{"material_id":"mp-540628","formula":"Al64Cl256Te128","method":"EquiformerV2(OC22)","natoms":448,"total_time_seconds":2025.528538,"total_steps":49990,"steps_per_second":24.6799781204,"seconds_per_step":0.0405186745,"seconds_per_step_per_atom":0.0000904435},{"material_id":"mp-557103","formula":"B160Cl32O288Pb64","method":"EquiformerV2(OC22)","natoms":544,"total_time_seconds":3527.414988,"total_steps":40590,"steps_per_second":11.5070101301,"seconds_per_step":0.0869035474,"seconds_per_step_per_atom":0.0001597492},{"material_id":"mp-573751","formula":"Al48Cl336Te48","method":"EquiformerV2(OC22)","natoms":432,"total_time_seconds":1963.111202,"total_steps":49990,"steps_per_second":25.4646807318,"seconds_per_step":0.0392700781,"seconds_per_step_per_atom":0.000090903},{"material_id":"mp-680722","formula":"As32Cl64O272Pb224","method":"EquiformerV2(OC22)","natoms":592,"total_time_seconds":152.850709,"total_steps":540,"steps_per_second":3.5328589807,"seconds_per_step":0.2830568685,"seconds_per_step_per_atom":0.0004781366},{"material_id":"mp-567734","formula":"Al32As96Cl128Se128","method":"EquiformerV2(OC22)","natoms":384,"total_time_seconds":1609.555767,"total_steps":41500,"steps_per_second":25.7835117309,"seconds_per_step":0.0387844763,"seconds_per_step_per_atom":0.0001010012},{"material_id":"mp-570340","formula":"Ag48Au48Cl192","method":"EquiformerV2(OC22)","natoms":288,"total_time_seconds":1607.842826,"total_steps":49990,"steps_per_second":31.0913474822,"seconds_per_step":0.0321632892,"seconds_per_step_per_atom":0.0001116781},{"material_id":"mp-1190390","formula":"Ba54Cl108O432","method":"EquiformerV2(OC22)","natoms":594,"total_time_seconds":126.959062,"total_steps":370,"steps_per_second":2.9143252492,"seconds_per_step":0.3431326,"seconds_per_step_per_atom":0.0005776643},{"material_id":"mp-672352","formula":"Al48Cl288I144","method":"EquiformerV2(OC22)","natoms":480,"total_time_seconds":10.902331,"total_steps":390,"steps_per_second":35.7721665211,"seconds_per_step":0.0279546949,"seconds_per_step_per_atom":0.0000582389},{"material_id":"mp-27265","formula":"Au72Cl72O72","method":"EquiformerV2(OC22)","natoms":216,"total_time_seconds":1590.120361,"total_steps":49990,"steps_per_second":31.437871765,"seconds_per_step":0.031808769,"seconds_per_step_per_atom":0.0001472628},{"material_id":"mp-27863","formula":"Al100Cl100O100","method":"EquiformerV2(OC22)","natoms":300,"total_time_seconds":4939.446747,"total_steps":2315,"steps_per_second":0.4686759709,"seconds_per_step":2.1336703011,"seconds_per_step_per_atom":0.0071122343}]
|
mlip_arena/tasks/stability/mace-mp/chloride-salts.json
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
[{"material_id":"mp-567334","formula":"Ag64B384Cl384","method":"MACE-MP(M)","natoms":832,"total_time_seconds":3578.503151,"total_steps":40470,"steps_per_second":11.3091978105,"seconds_per_step":0.0884236015,"seconds_per_step_per_atom":0.0001062784},{"material_id":"mp-30273","formula":"Ac96Cl96O96","method":"MACE-MP(M)","natoms":288,"total_time_seconds":1974.313713,"total_steps":49990,"steps_per_second":25.3201908445,"seconds_per_step":0.0394941731,"seconds_per_step_per_atom":0.0001371325},{"material_id":"mp-573465","formula":"Ag320Cl64Te128","method":"MACE-MP(M)","natoms":512,"total_time_seconds":2296.972442,"total_steps":39000,"steps_per_second":16.9788715297,"seconds_per_step":0.0588967293,"seconds_per_step_per_atom":0.0001150327},{"material_id":"mp-27971","formula":"Ac48Cl144","method":"MACE-MP(M)","natoms":192,"total_time_seconds":1228.139194,"total_steps":49990,"steps_per_second":40.7038552668,"seconds_per_step":0.0245676974,"seconds_per_step_per_atom":0.0001279568},{"material_id":"mp-560328","formula":"Ag60Cl12P16S64","method":"MACE-MP(M)","natoms":152,"total_time_seconds":350.457564,"total_steps":14360,"steps_per_second":40.9750037525,"seconds_per_step":0.0244051228,"seconds_per_step_per_atom":0.00016056}]
|
mlip_arena/tasks/stability/run.py
CHANGED
@@ -277,6 +277,7 @@ def md(
|
|
277 |
|
278 |
def _callback(dyn: MolecularDynamics = md_runner) -> None:
|
279 |
step = last_step + dyn.nsteps
|
|
|
280 |
dyn.atoms.info["datetime"] = datetime.now()
|
281 |
dyn.atoms.info["step"] = step
|
282 |
if ensemble == "nve":
|
|
|
277 |
|
278 |
def _callback(dyn: MolecularDynamics = md_runner) -> None:
|
279 |
step = last_step + dyn.nsteps
|
280 |
+
dyn.atoms.info["restart"] = last_step
|
281 |
dyn.atoms.info["datetime"] = datetime.now()
|
282 |
dyn.atoms.info["step"] = step
|
283 |
if ensemble == "nve":
|
pyproject.toml
CHANGED
@@ -44,6 +44,7 @@ app = [
|
|
44 |
"streamlit",
|
45 |
"plotly",
|
46 |
"bokeh==2.4.3",
|
|
|
47 |
]
|
48 |
|
49 |
[project.urls]
|
|
|
44 |
"streamlit",
|
45 |
"plotly",
|
46 |
"bokeh==2.4.3",
|
47 |
+
"statsmodels"
|
48 |
]
|
49 |
|
50 |
[project.urls]
|
serve/tasks/homonuclear-diatomics.py
CHANGED
@@ -40,6 +40,8 @@ palette_name = vis.selectbox(
|
|
40 |
color_sequence = color_palettes[palette_name] # type: ignore
|
41 |
|
42 |
DATA_DIR = Path("mlip_arena/tasks/diatomics")
|
|
|
|
|
43 |
dfs = [pd.read_json(DATA_DIR / method.lower() / "homonuclear-diatomics.json") for method in methods]
|
44 |
df = pd.concat(dfs, ignore_index=True)
|
45 |
df.drop_duplicates(inplace=True, subset=["name", "method"])
|
|
|
40 |
color_sequence = color_palettes[palette_name] # type: ignore
|
41 |
|
42 |
DATA_DIR = Path("mlip_arena/tasks/diatomics")
|
43 |
+
if not methods:
|
44 |
+
st.stop()
|
45 |
dfs = [pd.read_json(DATA_DIR / method.lower() / "homonuclear-diatomics.json") for method in methods]
|
46 |
df = pd.concat(dfs, ignore_index=True)
|
47 |
df.drop_duplicates(inplace=True, subset=["name", "method"])
|
serve/tasks/stability.py
CHANGED
@@ -3,26 +3,66 @@ from pathlib import Path
|
|
3 |
import numpy as np
|
4 |
import pandas as pd
|
5 |
import plotly.colors as pcolors
|
|
|
6 |
import plotly.graph_objects as go
|
7 |
import streamlit as st
|
8 |
-
from ase.data import chemical_symbols
|
9 |
-
from ase.io import read, write
|
10 |
-
from plotly.subplots import make_subplots
|
11 |
-
from scipy.interpolate import CubicSpline
|
12 |
|
13 |
-
|
|
|
|
|
|
|
14 |
|
15 |
st.markdown("# Stability")
|
16 |
|
17 |
st.markdown("### Methods")
|
18 |
container = st.container(border=True)
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
-
DATA_DIR = Path("mlip_arena/tasks/stability")
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
|
25 |
|
|
|
|
|
|
|
|
|
|
|
26 |
|
|
|
27 |
|
28 |
|
|
|
3 |
import numpy as np
|
4 |
import pandas as pd
|
5 |
import plotly.colors as pcolors
|
6 |
+
import plotly.express as px
|
7 |
import plotly.graph_objects as go
|
8 |
import streamlit as st
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
from mlip_arena.models import REGISTRY
|
11 |
+
|
12 |
+
DATA_DIR = Path("mlip_arena/tasks/stability")
|
13 |
+
|
14 |
|
15 |
st.markdown("# Stability")
|
16 |
|
17 |
st.markdown("### Methods")
|
18 |
container = st.container(border=True)
|
19 |
+
models = container.multiselect("MLIPs", REGISTRY.keys(), ['MACE-MP(M)', "CHGNet", "EquiformerV2(OC22)"])
|
20 |
+
|
21 |
+
st.markdown("### Settings")
|
22 |
+
vis = st.container(border=True)
|
23 |
+
# Get all attributes from pcolors.qualitative
|
24 |
+
all_attributes = dir(pcolors.qualitative)
|
25 |
+
color_palettes = {attr: getattr(pcolors.qualitative, attr) for attr in all_attributes if isinstance(getattr(pcolors.qualitative, attr), list)}
|
26 |
+
color_palettes.pop("__all__", None)
|
27 |
+
|
28 |
+
palette_names = list(color_palettes.keys())
|
29 |
+
palette_colors = list(color_palettes.values())
|
30 |
+
|
31 |
+
palette_name = vis.selectbox(
|
32 |
+
"Color sequence",
|
33 |
+
options=palette_names, index=22
|
34 |
+
)
|
35 |
+
|
36 |
+
color_sequence = color_palettes[palette_name]
|
37 |
+
|
38 |
+
if not models:
|
39 |
+
st.stop()
|
40 |
+
|
41 |
+
families = [REGISTRY[str(model)]['family'] for model in models]
|
42 |
+
|
43 |
+
dfs = [pd.read_json(DATA_DIR / family.lower() / "chloride-salts.json") for family in families]
|
44 |
+
df = pd.concat(dfs, ignore_index=True)
|
45 |
+
df.drop_duplicates(inplace=True, subset=["material_id", "formula", "method"])
|
46 |
+
|
47 |
+
method_color_mapping = {method: color_sequence[i % len(color_sequence)] for i, method in enumerate(df["method"].unique())}
|
48 |
|
49 |
|
|
|
50 |
|
51 |
+
# fig = px.scatter(df, x="natoms", y="seconds_per_step", trendline="ols", trendline_options=dict(log_y=True), log_y=True)
|
52 |
+
fig = px.scatter(
|
53 |
+
df, x="natoms", y="steps_per_second",
|
54 |
+
color="method",
|
55 |
+
color_discrete_map=method_color_mapping,
|
56 |
+
trendline="ols", trendline_options=dict(log_x=True), log_x=True
|
57 |
+
)
|
58 |
|
59 |
|
60 |
+
event = st.plotly_chart(
|
61 |
+
fig,
|
62 |
+
key="stability",
|
63 |
+
on_select="rerun"
|
64 |
+
)
|
65 |
|
66 |
+
event
|
67 |
|
68 |
|