From d7a5e729c3f05dd53a9432acb23c5392aeb1c4a3 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 6 May 2024 14:58:02 -0400 Subject: [PATCH 1/5] CI add repository_dispatch event for pymatgen_ci_trigger in which case pmg is installed from the POSTed commit SHA (usually master) --- .github/workflows/testing.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index c8fbffcae6..622d37e895 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -6,6 +6,8 @@ on: tags: ["v*"] pull_request: workflow_dispatch: + repository_dispatch: + types: [pymatgen-ci-trigger] jobs: lint: @@ -40,7 +42,6 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install dependencies # ERROR: Cannot install atomate2 and atomate2[strict,tests]==0.0.1 because these package versions have conflicting dependencies. # The conflict is caused by: @@ -59,6 +60,10 @@ jobs: pip install torch-runstats pip install --no-deps nequip + - name: Install pymatgen from master if triggered by pymatgen repo dispatch + if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger' + run: pip install --upgrade 'git+https://github.com/materialsproject/pymatgen@${{ github.event.client_payload.pymatgen_ref }}' + - name: Test env: MP_API_KEY: ${{ secrets.MP_API_KEY }} From 304508605c44fb8d7288d63f3f870d3e3fc61efb Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 6 May 2024 19:17:40 -0400 Subject: [PATCH 2/5] try pip --no-cache-dir --- .github/workflows/testing.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 622d37e895..e025e729af 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -55,10 +55,10 @@ jobs: mkdir -p ~/.abinit/pseudos cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos # ase needed to get FrechetCellFilter used by ML force fields - pip install git+https://gitlab.com/ase/ase - pip install .[strict,tests,abinit] - pip install torch-runstats - pip install --no-deps nequip + pip install --no-cache-dir git+https://gitlab.com/ase/ase + pip install --no-cache-dir .[strict,tests,abinit] + pip install --no-cache-dir torch-runstats + pip install --no-cache-dir --no-deps nequip - name: Install pymatgen from master if triggered by pymatgen repo dispatch if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger' From ec4726c3f4d9b515da69b2844b0846d805a347f6 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 6 May 2024 19:49:39 -0400 Subject: [PATCH 3/5] skip failing M3GNet tests see CI run https://github.com/materialsproject/atomate2/actions/runs/8977131960/job/24655309669 --- tests/forcefields/flows/test_eos.py | 6 ++++-- tests/forcefields/test_jobs.py | 8 ++++++++ tests/forcefields/test_md.py | 5 +++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tests/forcefields/flows/test_eos.py b/tests/forcefields/flows/test_eos.py index ef7f565663..4f66e384cb 100644 --- a/tests/forcefields/flows/test_eos.py +++ b/tests/forcefields/flows/test_eos.py @@ -3,11 +3,13 @@ from jobflow import run_locally from monty.serialization import loadfn -from atomate2.forcefields.flows.eos import CHGNetEosMaker, M3GNetEosMaker, MACEEosMaker +from atomate2.forcefields.flows.eos import CHGNetEosMaker, MACEEosMaker _mlff_to_maker = { "CHGNet": CHGNetEosMaker, - "M3GNet": M3GNetEosMaker, + # M3GNet skipped on 2024-05-06 by @janosh due to failing with + # ValueError: Bad serialized model or bad model name + # "M3GNet": M3GNetEosMaker, "MACE": MACEEosMaker, } diff --git a/tests/forcefields/test_jobs.py b/tests/forcefields/test_jobs.py index 310a9132ca..dde7e679c6 100644 --- a/tests/forcefields/test_jobs.py +++ b/tests/forcefields/test_jobs.py @@ -102,6 +102,10 @@ def test_chgnet_relax_maker(si_structure: Structure, relax_cell: bool): assert Path(responses[job.uuid][1].output.dir_name).exists() +@pytest.mark.skip( + "skipped on 2024-05-06 by @janosh due to failing with " + "ValueError: Bad serialized model or bad model name" +) def test_m3gnet_static_maker(si_structure): task_doc_kwargs = {"ionic_step_data": ("structure", "energy")} @@ -120,6 +124,10 @@ def test_m3gnet_static_maker(si_structure): assert output1.forcefield_version == get_imported_version("matgl") +@pytest.mark.skip( + "skipped on 2024-05-06 by @janosh due to failing with " + "ValueError: Bad serialized model or bad model name" +) def test_m3gnet_relax_maker(si_structure): # translate one atom to ensure a small number of relaxation steps are taken si_structure.translate_sites(0, [0, 0, 0.1]) diff --git a/tests/forcefields/test_md.py b/tests/forcefields/test_md.py index d8d6a1cc97..47ae4c33bc 100644 --- a/tests/forcefields/test_md.py +++ b/tests/forcefields/test_md.py @@ -15,14 +15,15 @@ from atomate2.forcefields.md import ( CHGNetMDMaker, GAPMDMaker, - M3GNetMDMaker, MACEMDMaker, NequipMDMaker, ) name_to_maker = { "CHGNet": CHGNetMDMaker, - "M3GNet": M3GNetMDMaker, + # M3GNet skipped on 2024-05-06 by @janosh due to failing with + # ValueError: Bad serialized model or bad model name + # "M3GNet": M3GNetMDMaker, "MACE": MACEMDMaker, "GAP": GAPMDMaker, "Nequip": NequipMDMaker, From 0fa635672c6d0cc75312d9dee60483f8fee645d1 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Mon, 6 May 2024 20:10:59 -0400 Subject: [PATCH 4/5] fix partial M3GNet test skipping --- tests/forcefields/test_md.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/forcefields/test_md.py b/tests/forcefields/test_md.py index 47ae4c33bc..49a867b2e0 100644 --- a/tests/forcefields/test_md.py +++ b/tests/forcefields/test_md.py @@ -30,7 +30,16 @@ } -@pytest.mark.parametrize("ff_name", ["CHGNet", "M3GNet", "MACE", "GAP", "Nequip"]) +@pytest.mark.parametrize( + "ff_name", + [ + "CHGNet", + # "M3GNet", + "MACE", + "GAP", + "Nequip", + ], +) def test_ml_ff_md_maker(ff_name, si_structure, sr_ti_o3_structure, test_dir, clean_dir): n_steps = 5 From 5b9c5f77b4a7b3827041728d47e760d53c92e5d0 Mon Sep 17 00:00:00 2001 From: Janosh Riebesell Date: Sat, 11 May 2024 17:26:38 -0400 Subject: [PATCH 5/5] unskip all M3GNetMDMaker tests --- .github/workflows/testing.yml | 22 ++++++++++++++++++---- tests/forcefields/flows/test_eos.py | 6 ++---- tests/forcefields/test_jobs.py | 8 -------- tests/forcefields/test_md.py | 13 +++---------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 3054f7c1ab..2f1e31a4f6 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -42,16 +42,30 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Install enumlib + run: | + cd .. + git clone --recursive https://github.com/msg-byu/enumlib.git + cd enumlib/symlib/src + export F90=gfortran + make + cd ../../src + make enum.x + sudo mv enum.x /usr/local/bin/ + cd .. + sudo cp aux_src/makeStr.py /usr/local/bin/ + continue-on-error: true # This is not critical to succeed. + - name: Install dependencies run: | python -m pip install --upgrade pip mkdir -p ~/.abinit/pseudos cp -r tests/test_data/abinit/pseudos/ONCVPSP-PBE-SR-PDv0.4 ~/.abinit/pseudos # ase needed to get FrechetCellFilter used by ML force fields - pip install --no-cache-dir git+https://gitlab.com/ase/ase - pip install --no-cache-dir .[strict,tests,abinit] - pip install --no-cache-dir torch-runstats - pip install --no-cache-dir --no-deps nequip + pip install git+https://gitlab.com/ase/ase + pip install .[strict,tests,abinit] + pip install torch-runstats + pip install --no-deps nequip==0.5.6 - name: Install pymatgen from master if triggered by pymatgen repo dispatch if: github.event_name == 'repository_dispatch' && github.event.action == 'pymatgen-ci-trigger' diff --git a/tests/forcefields/flows/test_eos.py b/tests/forcefields/flows/test_eos.py index 4f66e384cb..ef7f565663 100644 --- a/tests/forcefields/flows/test_eos.py +++ b/tests/forcefields/flows/test_eos.py @@ -3,13 +3,11 @@ from jobflow import run_locally from monty.serialization import loadfn -from atomate2.forcefields.flows.eos import CHGNetEosMaker, MACEEosMaker +from atomate2.forcefields.flows.eos import CHGNetEosMaker, M3GNetEosMaker, MACEEosMaker _mlff_to_maker = { "CHGNet": CHGNetEosMaker, - # M3GNet skipped on 2024-05-06 by @janosh due to failing with - # ValueError: Bad serialized model or bad model name - # "M3GNet": M3GNetEosMaker, + "M3GNet": M3GNetEosMaker, "MACE": MACEEosMaker, } diff --git a/tests/forcefields/test_jobs.py b/tests/forcefields/test_jobs.py index dde7e679c6..310a9132ca 100644 --- a/tests/forcefields/test_jobs.py +++ b/tests/forcefields/test_jobs.py @@ -102,10 +102,6 @@ def test_chgnet_relax_maker(si_structure: Structure, relax_cell: bool): assert Path(responses[job.uuid][1].output.dir_name).exists() -@pytest.mark.skip( - "skipped on 2024-05-06 by @janosh due to failing with " - "ValueError: Bad serialized model or bad model name" -) def test_m3gnet_static_maker(si_structure): task_doc_kwargs = {"ionic_step_data": ("structure", "energy")} @@ -124,10 +120,6 @@ def test_m3gnet_static_maker(si_structure): assert output1.forcefield_version == get_imported_version("matgl") -@pytest.mark.skip( - "skipped on 2024-05-06 by @janosh due to failing with " - "ValueError: Bad serialized model or bad model name" -) def test_m3gnet_relax_maker(si_structure): # translate one atom to ensure a small number of relaxation steps are taken si_structure.translate_sites(0, [0, 0, 0.1]) diff --git a/tests/forcefields/test_md.py b/tests/forcefields/test_md.py index e190df2e49..321593d804 100644 --- a/tests/forcefields/test_md.py +++ b/tests/forcefields/test_md.py @@ -15,15 +15,14 @@ from atomate2.forcefields.md import ( CHGNetMDMaker, GAPMDMaker, + M3GNetMDMaker, MACEMDMaker, NequipMDMaker, ) name_to_maker = { "CHGNet": CHGNetMDMaker, - # M3GNet skipped on 2024-05-06 by @janosh due to failing with - # ValueError: Bad serialized model or bad model name - # "M3GNet": M3GNetMDMaker, + "M3GNet": M3GNetMDMaker, "MACE": MACEMDMaker, "GAP": GAPMDMaker, "Nequip": NequipMDMaker, @@ -32,13 +31,7 @@ @pytest.mark.parametrize( "ff_name", - [ - "CHGNet", - # "M3GNet", - "MACE", - "GAP", - "Nequip", - ], + ["CHGNet", "M3GNet", "MACE", "GAP", "Nequip"], ) def test_ml_ff_md_maker(ff_name, si_structure, sr_ti_o3_structure, test_dir, clean_dir): n_steps = 5