File tree Expand file tree Collapse file tree 5 files changed +31
-11
lines changed
elemental_slab_oxygen_adsorption Expand file tree Collapse file tree 5 files changed +31
-11
lines changed Original file line number Diff line number Diff line change 1212 struct_from_scatter ,
1313)
1414from ml_peg .app .utils .load import read_plot
15- from ml_peg .calcs .models .models import MODELS
15+ from ml_peg .models .get_models import get_model_names
16+ from ml_peg .models .models import current_models
1617
18+ MODELS = get_model_names (current_models )
1719BENCHMARK_NAME = "Li diffusion"
1820DOCS_URL = "https://ddmms.github.io/ml-peg/user_guide/benchmarks/nebs.html#li-diffusion"
1921DATA_PATH = APP_ROOT / "data" / "nebs" / "li_diffusion"
Original file line number Diff line number Diff line change 1212DATA_PATH = Path (__file__ ).parent / "data"
1313
1414
15- def run_app (category : str = "*" , port : int = 8050 , debug : bool = False ) -> None :
15+ def run_app (
16+ models : None | str | list = None ,
17+ category : str = "*" ,
18+ port : int = 8050 ,
19+ debug : bool = False ,
20+ ) -> None :
1621 """
1722 Set port and run Dash application.
1823
1924 Parameters
2025 ----------
26+ models
27+ Models to build interactive features for. Default is None, corresponding to all
28+ current models.
2129 category
2230 Category to build app for. Default is `*`, corresponding to all categories.
2331 port
2432 Port to run application on. Default is 8050.
2533 debug
2634 Whether to run with Dash debugging. Default is `True`.
2735 """
36+ from ml_peg .models import models as ml_peg_models
37+
38+ ml_peg_models .current_models = models
39+
2840 full_app = Dash (__name__ , assets_folder = DATA_PATH )
2941 build_full_app (full_app , category = category )
3042
Original file line number Diff line number Diff line change 1313 struct_from_scatter ,
1414)
1515from ml_peg .app .utils .load import read_plot
16- from ml_peg .calcs .models .models import MODELS
16+ from ml_peg .models .get_models import get_model_names
17+ from ml_peg .models .models import current_models
1718
19+ MODELS = get_model_names (current_models )
1820BENCHMARK_NAME = "OC157"
1921DOCS_URL = "https://ddmms.github.io/ml-peg/user_guide/benchmarks/surfaces.html#oc157"
2022DATA_PATH = APP_ROOT / "data" / "surfaces" / "OC157"
@@ -29,13 +31,13 @@ def register_callbacks(self) -> None:
2931 DATA_PATH / "figure_rel_energies.json" , id = f"{ BENCHMARK_NAME } -figure"
3032 )
3133
32- structs_dir = DATA_PATH / list ( MODELS . keys ()) [0 ]
34+ structs_dir = DATA_PATH / MODELS [0 ]
3335
3436 # Assets dir will be parent directory
3537 structs = list (
3638 np .repeat (
3739 [
38- f"assets/surfaces/OC157/{ list ( MODELS . keys ()) [0 ]} /{ i } .xyz"
40+ f"assets/surfaces/OC157/{ MODELS [0 ]} /{ i } .xyz"
3941 for i in range (len (list (structs_dir .glob ("*.xyz" ))))
4042 ],
4143 3 ,
Original file line number Diff line number Diff line change 1212 struct_from_scatter ,
1313)
1414from ml_peg .app .utils .load import read_plot
15- from ml_peg .calcs .models .models import MODELS
15+ from ml_peg .models .get_models import get_model_names
16+ from ml_peg .models .models import current_models
1617
18+ MODELS = get_model_names (current_models )
1719BENCHMARK_NAME = "S24"
1820DOCS_URL = "https://ddmms.github.io/ml-peg/user_guide/benchmarks/surfaces.html#s24"
1921DATA_PATH = APP_ROOT / "data" / "surfaces" / "S24"
@@ -29,11 +31,11 @@ def register_callbacks(self) -> None:
2931 id = f"{ BENCHMARK_NAME } -figure" ,
3032 )
3133
32- structs_dir = DATA_PATH / list ( MODELS . keys ()) [0 ]
34+ structs_dir = DATA_PATH / MODELS [0 ]
3335
3436 # Assets dir will be parent directory
3537 structs = [
36- f"assets/surfaces/S24/{ list ( MODELS . keys ()) [0 ]} /{ struct_file .stem } .xyz"
38+ f"assets/surfaces/S24/{ MODELS [0 ]} /{ struct_file .stem } .xyz"
3739 for struct_file in sorted (structs_dir .glob ("*.xyz" ))
3840 ]
3941
Original file line number Diff line number Diff line change 1212 struct_from_scatter ,
1313)
1414from ml_peg .app .utils .load import read_plot
15- from ml_peg .calcs .models .models import MODELS
15+ from ml_peg .models .get_models import get_model_names
16+ from ml_peg .models .models import current_models
1617
18+ MODELS = get_model_names (current_models )
1719BENCHMARK_NAME = "Elemental Slab Oxygen Adsorption"
1820DOCS_URL = "https://ddmms.github.io/ml-peg/user_guide/benchmarks/surfaces.html#elemental-slab-oxygen-adsorption"
1921DATA_PATH = APP_ROOT / "data" / "surfaces" / "elemental_slab_oxygen_adsorption"
@@ -29,11 +31,11 @@ def register_callbacks(self) -> None:
2931 id = f"{ BENCHMARK_NAME } -figure" ,
3032 )
3133
32- structs_dir = DATA_PATH / list ( MODELS . keys ()) [0 ]
34+ structs_dir = DATA_PATH / MODELS [0 ]
3335
3436 # Assets dir will be parent directory
3537 structs = [
36- f"assets/surfaces/elemental_slab_oxygen_adsorption/{ list ( MODELS . keys ()) [0 ]} /{ struct_file .stem } .xyz"
38+ f"assets/surfaces/elemental_slab_oxygen_adsorption/{ MODELS [0 ]} /{ struct_file .stem } .xyz"
3739 for struct_file in sorted (structs_dir .glob ("*.xyz" ))
3840 ]
3941
You can’t perform that action at this time.
0 commit comments