cyrusyc commited on
Commit
78cdc34
1 Parent(s): 1c7cd6c

add eSCN; refactor app.py

Browse files
mlip_arena/tasks/diatomics/escn/homonuclear-diatomics.json CHANGED
The diff for this file is too large to render. See raw diff
 
mlip_arena/tasks/diatomics/run.ipynb CHANGED
The diff for this file is too large to render. See raw diff
 
mlip_arena/tasks/registry.yaml CHANGED
@@ -1,9 +1,22 @@
1
- nacl:
2
- username: cyrusyc
3
- datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
4
- alexandria:
5
- username: cyrusyc
6
- datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
7
- qmof:
8
- username: cyrusyc
9
- datetime: 2024-03-25T14:30:00 # TODO: Fake datetime
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Homonuclear diatomics:
2
+ category: Fundamentals
3
+ task-page: homonuclear-diatomics
4
+ task-layout: wide
5
+ rank-page: homonuclear-diatomics
6
+ last-update: 2024-09-19
7
+ High pressure stability:
8
+ category: Molecular dynamics
9
+ task-page: stability
10
+ task-layout: centered
11
+ rank-page: stability
12
+ Combustion:
13
+ category: Molecular dynamics
14
+ task-page: combustion
15
+ task-layout: centered
16
+ rank-page: combustion
17
+ # nacl:
18
+ # last-update: 2024-03-25T14:30:00 # TODO: Fake datetime
19
+ # alexandria:
20
+ # last-update: 2024-03-25T14:30:00 # TODO: Fake datetime
21
+ # qmof:
22
+ # last-update: 2024-03-25T14:30:00 # TODO: Fake datetime
serve/app.py CHANGED
@@ -1,5 +1,9 @@
 
 
1
  import streamlit as st
2
 
 
 
3
  # if "logged_in" not in st.session_state:
4
  # st.session_state.logged_in = False
5
 
@@ -17,36 +21,33 @@ import streamlit as st
17
  # logout_page = st.Page(logout, title="Log out", icon=":material/logout:")
18
 
19
  leaderboard = st.Page(
20
- "leaderboard.py", title="Leaderboard", icon=":material/trophy:"
21
  )
22
- # bugs = st.Page("models/bugs.py", title="Bug reports", icon=":material/bug_report:")
23
- # alerts = st.Page(
24
- # "models/alerts.py", title="System alerts", icon=":material/notification_important:"
25
- # )
26
 
27
  search = st.Page("tools/search.py", title="Search", icon=":material/search:")
28
  history = st.Page("tools/history.py", title="History", icon=":material/history:")
29
  ptable = st.Page("tools/ptable.py", title="Periodic table", icon=":material/gradient:")
30
 
31
- diatomics = st.Page("tasks/homonuclear-diatomics.py", title="Homonuclear diatomics", icon=":material/target:", default=True)
32
- stability = st.Page("tasks/stability.py", title="High pressure stability", icon=":material/target:")
33
- combustion = st.Page("tasks/combustion.py", title="Combustion", icon=":material/target:")
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
 
36
- # if st.session_state.logged_in:
37
- pg = st.navigation(
38
- {
39
- # "Account": [logout_page],
40
- "": [leaderboard],
41
- "Fundamentals": [diatomics],
42
- "Molecular Dynamics": [stability, combustion],
43
- # "Tools": [ptable],
44
- }
45
- )
46
- # else:
47
- # pg = st.navigation([login_page])
48
 
49
- if pg in [stability, combustion]:
 
 
50
  st.set_page_config(
51
  layout="centered",
52
  page_title="MLIP Arena",
@@ -55,7 +56,7 @@ if pg in [stability, combustion]:
55
  menu_items={
56
  "About": "https://github.com/atomind-ai/mlip-arena",
57
  "Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
58
- }
59
  )
60
  else:
61
  st.set_page_config(
@@ -66,9 +67,12 @@ else:
66
  menu_items={
67
  "About": "https://github.com/atomind-ai/mlip-arena",
68
  "Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
69
- }
70
  )
71
 
72
- st.toast("MLIP Arena is currently in **pre-alpha**. The results are not stable. Please interpret them with care. Contributions are welcome. For more information, visit https://github.com/atomind-ai/mlip-arena.", icon="🍞")
 
 
 
73
 
74
  pg.run()
 
1
+ from collections import defaultdict
2
+
3
  import streamlit as st
4
 
5
+ from mlip_arena.tasks import REGISTRY as TASKS
6
+
7
  # if "logged_in" not in st.session_state:
8
  # st.session_state.logged_in = False
9
 
 
21
  # logout_page = st.Page(logout, title="Log out", icon=":material/logout:")
22
 
23
  leaderboard = st.Page(
24
+ "leaderboard.py", title="Leaderboard", icon=":material/trophy:", default=True
25
  )
 
 
 
 
26
 
27
  search = st.Page("tools/search.py", title="Search", icon=":material/search:")
28
  history = st.Page("tools/history.py", title="History", icon=":material/history:")
29
  ptable = st.Page("tools/ptable.py", title="Periodic table", icon=":material/gradient:")
30
 
 
 
 
31
 
32
+ nav = defaultdict(list)
33
+ nav[""].append(leaderboard)
34
+
35
+ wide_pages, centered_pages = [], []
36
+
37
+ for task in TASKS:
38
+ page = st.Page(
39
+ f"tasks/{TASKS[task]['task-page']}.py", title=task, icon=":material/target:"
40
+ )
41
+ nav[TASKS[task]["category"]].append(page)
42
+ if TASKS[task]["task-layout"] == "wide":
43
+ wide_pages.append(page)
44
+ else:
45
+ centered_pages.append(page)
46
 
 
 
 
 
 
 
 
 
 
 
 
 
47
 
48
+ pg = st.navigation(nav)
49
+
50
+ if pg in centered_pages:
51
  st.set_page_config(
52
  layout="centered",
53
  page_title="MLIP Arena",
 
56
  menu_items={
57
  "About": "https://github.com/atomind-ai/mlip-arena",
58
  "Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
59
+ },
60
  )
61
  else:
62
  st.set_page_config(
 
67
  menu_items={
68
  "About": "https://github.com/atomind-ai/mlip-arena",
69
  "Report a bug": "https://github.com/atomind-ai/mlip-arena/issues/new",
70
+ },
71
  )
72
 
73
+ st.toast(
74
+ "MLIP Arena is currently in **pre-alpha**. The results are not stable. Please interpret them with care. Contributions are welcome. For more information, visit https://github.com/atomind-ai/mlip-arena.",
75
+ icon="🍞",
76
+ )
77
 
78
  pg.run()
serve/leaderboard.py CHANGED
@@ -3,11 +3,12 @@ from pathlib import Path
3
  import pandas as pd
4
  import streamlit as st
5
 
6
- from mlip_arena.models import REGISTRY
 
7
 
8
  DATA_DIR = Path("mlip_arena/tasks/diatomics")
9
 
10
- dfs = [pd.read_json(DATA_DIR / REGISTRY[model].get("family") / "homonuclear-diatomics.json") for model in REGISTRY]
11
  df = pd.concat(dfs, ignore_index=True)
12
 
13
 
@@ -22,11 +23,11 @@ table = pd.DataFrame(columns=[
22
  "Code",
23
  "Paper",
24
  "First Release",
25
- ])
26
 
27
- for model in REGISTRY:
28
  rows = df[df["method"] == model]
29
- metadata = REGISTRY.get(model, {})
30
  new_row = {
31
  "Model": model,
32
  "Element Coverage": len(rows["name"].unique()),
@@ -61,7 +62,7 @@ MLIP Arena is a platform for benchmarking foundation machine learning interatomi
61
  The benchmarks are designed to evaluate the readiness and reliability of open-source, open-weight models to reproduce the qualitatively or quantitatively correct physics.
62
  """, unsafe_allow_html=True)
63
 
64
- # st.header("Summary", divider=True)
65
 
66
  st.dataframe(
67
  s,
@@ -79,3 +80,8 @@ st.dataframe(
79
  ),
80
  },
81
  )
 
 
 
 
 
 
3
  import pandas as pd
4
  import streamlit as st
5
 
6
+ from mlip_arena.models import REGISTRY as MODELS
7
+ from mlip_arena.tasks import REGISTRY as TASKS
8
 
9
  DATA_DIR = Path("mlip_arena/tasks/diatomics")
10
 
11
+ dfs = [pd.read_json(DATA_DIR / MODELS[model].get("family") / "homonuclear-diatomics.json") for model in MODELS]
12
  df = pd.concat(dfs, ignore_index=True)
13
 
14
 
 
23
  "Code",
24
  "Paper",
25
  "First Release",
26
+ ])
27
 
28
+ for model in MODELS:
29
  rows = df[df["method"] == model]
30
+ metadata = MODELS.get(model, {})
31
  new_row = {
32
  "Model": model,
33
  "Element Coverage": len(rows["name"].unique()),
 
62
  The benchmarks are designed to evaluate the readiness and reliability of open-source, open-weight models to reproduce the qualitatively or quantitatively correct physics.
63
  """, unsafe_allow_html=True)
64
 
65
+
66
 
67
  st.dataframe(
68
  s,
 
80
  ),
81
  },
82
  )
83
+
84
+
85
+ for task in TASKS:
86
+ st.header(task, divider=True)
87
+ # st.write("Results for the task are not available yet.")