Skip to content

Commit d6313a7

Browse files
committed
Temp
1 parent d3e42cb commit d6313a7

File tree

62 files changed

+2123
-967
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2123
-967
lines changed

conftest.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
import pytest
1010

11+
from ml_peg.models import models
12+
1113

1214
def pytest_addoption(parser):
1315
"""Add flag to run tests for extra MLIPs."""
@@ -20,15 +22,19 @@ def pytest_addoption(parser):
2022
parser.addoption(
2123
"--models",
2224
action="store",
23-
default="all",
24-
help="MLIPs, in comma-separated list. Default: 'all'.",
25+
default=None,
26+
help="MLIPs, in comma-separated list. Default: None.",
2527
)
2628

2729

2830
def pytest_configure(config):
29-
"""Configure pytest to include marker for extra MLIPs."""
31+
"""Configure pytest to custom markers and CLI inputs."""
32+
# Create custom marker for slow tests
3033
config.addinivalue_line("markers", "slow: mark test as slow calculations")
3134

35+
# Set current models from CLI input
36+
models.current_models = config.getoption("--models")
37+
3238

3339
def pytest_collection_modifyitems(config, items):
3440
"""Skip tests if marker applied to unit tests."""
@@ -39,9 +45,3 @@ def pytest_collection_modifyitems(config, items):
3945
for item in items:
4046
if "slow" in item.keywords:
4147
item.add_marker(skip_slow)
42-
43-
44-
@pytest.fixture
45-
def models(request):
46-
"""Get models option."""
47-
return request.config.getoption("--models")

ml_peg/analysis/nebs/li_diffusion/analyse_li_diffusion.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
from ml_peg.analysis.utils.decorators import build_table, plot_scatter
1111
from ml_peg.app import APP_ROOT
1212
from ml_peg.calcs import CALCS_ROOT
13-
from ml_peg.calcs.models.models import MODELS
13+
from ml_peg.models.get_models import get_model_names
14+
from ml_peg.models.models import current_models
1415

16+
MODELS = get_model_names(current_models)
1517
CALC_PATH = CALCS_ROOT / "nebs" / "li_diffusion" / "outputs"
1618
OUT_PATH = APP_ROOT / "data" / "nebs" / "li_diffusion"
1719

ml_peg/analysis/surfaces/OC157/analyse_OC157.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
from ml_peg.analysis.utils.utils import mae
1111
from ml_peg.app import APP_ROOT
1212
from ml_peg.calcs import CALCS_ROOT
13-
from ml_peg.calcs.models.models import MODELS
13+
from ml_peg.models.get_models import get_model_names
14+
from ml_peg.models.models import current_models
1415

16+
MODELS = get_model_names(current_models)
1517
CALC_PATH = CALCS_ROOT / "surfaces" / "OC157" / "outputs"
1618
OUT_PATH = APP_ROOT / "data" / "surfaces" / "OC157"
1719

ml_peg/analysis/surfaces/S24/analyse_S24.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from ml_peg.analysis.utils.utils import mae
1010
from ml_peg.app import APP_ROOT
1111
from ml_peg.calcs import CALCS_ROOT
12-
from ml_peg.calcs.models.models import MODELS
12+
from ml_peg.models.get_models import get_model_names
13+
from ml_peg.models.models import current_models
1314

15+
MODELS = get_model_names(current_models)
1416
CALC_PATH = CALCS_ROOT / "surfaces" / "S24" / "outputs"
1517
OUT_PATH = APP_ROOT / "data" / "surfaces" / "S24"
1618

ml_peg/analysis/surfaces/elemental_slab_oxygen_adsorption/analyse_elemental_slab_oxygen_adsorption.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,10 @@
99
from ml_peg.analysis.utils.utils import mae
1010
from ml_peg.app import APP_ROOT
1111
from ml_peg.calcs import CALCS_ROOT
12-
from ml_peg.calcs.models.models import MODELS
12+
from ml_peg.models.get_models import get_model_names
13+
from ml_peg.models.models import current_models
1314

15+
MODELS = get_model_names(current_models)
1416
CALC_PATH = CALCS_ROOT / "surfaces" / "elemental_slab_oxygen_adsorption" / "outputs"
1517
OUT_PATH = APP_ROOT / "data" / "surfaces" / "elemental_slab_oxygen_adsorption"
1618

ml_peg/app/nebs/li_diffusion/app_li_diffusion.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
struct_from_scatter,
1313
)
1414
from ml_peg.app.utils.load import read_plot
15-
from ml_peg.calcs.models.models import MODELS
15+
from ml_peg.models.models import MODELS
1616

1717
BENCHMARK_NAME = "Li diffusion"
1818
DATA_PATH = APP_ROOT / "data" / "nebs" / "li_diffusion"

ml_peg/app/surfaces/OC157/app_OC157.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
struct_from_scatter,
1414
)
1515
from ml_peg.app.utils.load import read_plot
16-
from ml_peg.calcs.models.models import MODELS
16+
from ml_peg.models.models import MODELS
1717

1818
BENCHMARK_NAME = "OC157"
1919
DATA_PATH = APP_ROOT / "data" / "surfaces" / "OC157"

ml_peg/app/surfaces/S24/app_S24.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
struct_from_scatter,
1313
)
1414
from ml_peg.app.utils.load import read_plot
15-
from ml_peg.calcs.models.models import MODELS
15+
from ml_peg.models.models import MODELS
1616

1717
BENCHMARK_NAME = "S24"
1818
DATA_PATH = APP_ROOT / "data" / "surfaces" / "S24"

ml_peg/app/surfaces/elemental_slab_oxygen_adsorption/app_elemental_slab_oxygen_adsorption.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
struct_from_scatter,
1313
)
1414
from ml_peg.app.utils.load import read_plot
15-
from ml_peg.calcs.models.models import MODELS
15+
from ml_peg.models.models import MODELS
1616

1717
BENCHMARK_NAME = "Elemental Slab Oxygen Adsorption"
1818
DATA_PATH = APP_ROOT / "data" / "surfaces" / "elemental_slab_oxygen_adsorption"

ml_peg/calcs/models/models.py

Lines changed: 0 additions & 271 deletions
This file was deleted.

0 commit comments

Comments
 (0)