Skip to content

Commit a756c6b

Browse files
committed
run with / without fixture
1 parent a262669 commit a756c6b

File tree

2 files changed

+48
-27
lines changed

2 files changed

+48
-27
lines changed

.github/workflows/pytest-memory.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,5 @@ jobs:
4141
echo "# Raw data" >> report.md
4242
echo "Activate in workflow file" >> report.md
4343
# cat table.md >> report.md
44-
cml-send-comment --pr --update report.md
44+
# cml-send-comment --pr --update report.md
45+
cml-send-comment report.md

CI/memory_scaling/test_memory.py

+46-26
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
)
1111
from mdsuite.file_io import script_input
1212

13-
# mdsuite.config.memory_fraction = 1.0
14-
# mdsuite.config.memory_scaling_test = True
13+
mdsuite.config.memory_fraction = 1.0
14+
mdsuite.config.memory_scaling_test = True
1515

1616

1717
def get_project(tmp_path, n_configs, n_parts) -> mdsuite.Project:
@@ -56,38 +56,58 @@ def get_project(tmp_path, n_configs, n_parts) -> mdsuite.Project:
5656
return project
5757

5858

59-
@pytest.mark.parametrize("n_parts", [x for x in range(10, 300, 10)])
60-
@pytest.mark.memory
61-
def test_adf(tmp_path, n_parts):
62-
project = get_project(tmp_path, n_configs=5, n_parts=n_parts)
63-
_ = project.run.AngularDistributionFunction(number_of_configurations=2, plot=False)
64-
65-
66-
@pytest.mark.parametrize("n_parts", [x for x in range(100, 12000, 200)])
59+
@pytest.mark.parametrize("n_parts", [x for x in range(100, 10000, 200)])
6760
@pytest.mark.memory
6861
def test_rdf(tmp_path, n_parts):
6962
project = get_project(tmp_path, n_configs=15, n_parts=n_parts)
7063
_ = project.run.RadialDistributionFunction(number_of_configurations=10, plot=False)
7164

7265

73-
@pytest.mark.parametrize("n_configs", [x for x in range(100, 12000, 200)])
74-
@pytest.mark.memory
75-
def test_einstein_diffusion(tmp_path, n_configs):
76-
# TODO What do we want to actually loop over
77-
project = get_project(tmp_path, n_configs=n_configs, n_parts=100)
78-
_ = project.run.EinsteinDiffusionCoefficients(plot=False)
66+
@pytest.fixture(params=[x for x in range(100, 10000, 200)])
67+
def rdf_project(tmp_path, request):
68+
project = get_project(tmp_path, n_configs=15, n_parts=request.param)
69+
return project
7970

8071

81-
@pytest.mark.parametrize("data_range", [x for x in range(10, 10000, 200)])
8272
@pytest.mark.memory
83-
def test_einstein_diffusion_data_range(tmp_path, data_range):
84-
project = get_project(tmp_path, n_configs=12000, n_parts=100)
85-
_ = project.run.EinsteinDiffusionCoefficients(plot=False, data_range=data_range)
73+
def test_rdf_w_fixt(rdf_project):
74+
_ = rdf_project.run.RadialDistributionFunction(
75+
number_of_configurations=10, plot=False
76+
)
8677

8778

88-
@pytest.mark.parametrize("n_configs", [x for x in range(500, 12000, 200)])
89-
@pytest.mark.memory
90-
def test_gk_diffusion(tmp_path, n_configs):
91-
# TODO What do we want to actually loop over
92-
project = get_project(tmp_path, n_configs=n_configs, n_parts=100)
93-
_ = project.run.GreenKuboDiffusionCoefficients(plot=False)
79+
# @pytest.mark.parametrize("n_parts", [x for x in range(10, 300, 10)])
80+
# @pytest.mark.memory
81+
# def test_adf(tmp_path, n_parts):
82+
# project = get_project(tmp_path, n_configs=5, n_parts=n_parts)
83+
# _ = project.run.AngularDistributionFunction(number_of_configurations=2, plot=False)
84+
#
85+
#
86+
# @pytest.mark.parametrize("n_parts", [x for x in range(100, 12000, 200)])
87+
# @pytest.mark.memory
88+
# def test_rdf(tmp_path, n_parts):
89+
# project = get_project(tmp_path, n_configs=15, n_parts=n_parts)
90+
# _ = project.run.RadialDistributionFunction(number_of_configurations=10, plot=False)
91+
#
92+
#
93+
# @pytest.mark.parametrize("n_configs", [x for x in range(100, 12000, 200)])
94+
# @pytest.mark.memory
95+
# def test_einstein_diffusion(tmp_path, n_configs):
96+
# # TODO What do we want to actually loop over
97+
# project = get_project(tmp_path, n_configs=n_configs, n_parts=100)
98+
# _ = project.run.EinsteinDiffusionCoefficients(plot=False)
99+
#
100+
#
101+
# @pytest.mark.parametrize("data_range", [x for x in range(10, 10000, 200)])
102+
# @pytest.mark.memory
103+
# def test_einstein_diffusion_data_range(tmp_path, data_range):
104+
# project = get_project(tmp_path, n_configs=12000, n_parts=100)
105+
# _ = project.run.EinsteinDiffusionCoefficients(plot=False, data_range=data_range)
106+
#
107+
#
108+
# @pytest.mark.parametrize("n_configs", [x for x in range(500, 12000, 200)])
109+
# @pytest.mark.memory
110+
# def test_gk_diffusion(tmp_path, n_configs):
111+
# # TODO What do we want to actually loop over
112+
# project = get_project(tmp_path, n_configs=n_configs, n_parts=100)
113+
# _ = project.run.GreenKuboDiffusionCoefficients(plot=False)

0 commit comments

Comments
 (0)