From b93d3a866ac274382bab797ad2470c905efd9b53 Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Fri, 30 Jul 2021 15:46:08 +0200 Subject: [PATCH 1/5] Update __init__.py --- pyiron_atomistics/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyiron_atomistics/__init__.py b/pyiron_atomistics/__init__.py index 9c0804a3c..c173cb87f 100644 --- a/pyiron_atomistics/__init__.py +++ b/pyiron_atomistics/__init__.py @@ -1,6 +1,7 @@ __version__ = "0.1" __all__ = [] + from pyiron_atomistics.project import Project from pyiron_atomistics.atomistics.structure.atoms import ase_to_pyiron, pyiron_to_ase, Atoms from pyiron_base import Notebook, install_dialog, JOB_CLASS_DICT From bfaacabe5d446ec16c5d6478eb20b47bf4bcd5cd Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Fri, 30 Jul 2021 16:36:46 +0200 Subject: [PATCH 2/5] Delete test_murnaghan_non_modal.py --- .../master/test_murnaghan_non_modal.py | 76 ------------------- 1 file changed, 76 deletions(-) delete mode 100644 tests/atomistics/master/test_murnaghan_non_modal.py diff --git a/tests/atomistics/master/test_murnaghan_non_modal.py b/tests/atomistics/master/test_murnaghan_non_modal.py deleted file mode 100644 index 181409abf..000000000 --- a/tests/atomistics/master/test_murnaghan_non_modal.py +++ /dev/null @@ -1,76 +0,0 @@ -# coding: utf-8 -# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department -# Distributed under the terms of "New BSD License", see the LICENSE file. - -import os -from pyiron_atomistics.atomistics.structure.atoms import CrystalStructure -from pyiron_base import Project -import unittest - - -def convergence_goal(self, **qwargs): - import numpy as np - - eps = 0.2 - if "eps" in qwargs: - eps = qwargs["eps"] - erg_lst = self.get_from_childs("output/generic/energy") - var = 1000 * np.var(erg_lst) - # print(var / len(erg_lst)) - if var / len(erg_lst) < eps: - return True - ham_prev = self[-1] - job_name = self.first_child_name() + "_" + str(len(self)) - ham_next = ham_prev.restart(job_name=job_name) - return ham_next - - -class TestMurnaghan(unittest.TestCase): - @classmethod - def setUpClass(cls): - cls.file_location = os.path.dirname(os.path.abspath(__file__)) - cls.project = Project( - os.path.join(cls.file_location, "testing_murnaghan_non_modal") - ) - cls.basis = CrystalStructure( - element="Fe", bravais_basis="bcc", lattice_constant=2.8 - ) - cls.project.remove_jobs_silently(recursive=True) - # cls.project.remove_jobs(recursive=True) - # self.project.set_logging_level('INFO') - - @classmethod - def tearDownClass(cls): - file_location = os.path.dirname(os.path.abspath(__file__)) - project = Project(os.path.join(file_location, "testing_murnaghan_non_modal")) - project.remove_jobs_silently(recursive=True) - project.remove(enable=True, enforce=True) - - def test_run(self): - # Even though the test is completed successful - ham = self.project.create_job( - self.project.job_type.AtomisticExampleJob, "job_test" - ) - ham.structure = self.basis - ham.server.run_mode.non_modal = True - job_ser = self.project.create_job( - self.project.job_type.SerialMaster, "murn_iter" - ) - job_ser.append(ham) - job_ser.server.run_mode.non_modal = True - job_ser.set_goal(convergence_goal, eps=0.4) - murn = self.project.create_job("Murnaghan", "murnaghan") - murn.ref_job = job_ser - murn.input["num_points"] = 3 - murn.server.run_mode.non_modal = True - murn.run() - self.assertFalse(job_ser.status.finished) - self.project.wait_for_job(murn, interval_in_s=5, max_iterations=50) - self.assertTrue(murn.status.finished) - murn.remove() - job_ser.remove() - self.project.remove(enable=True, enforce=True) - - -if __name__ == "__main__": - unittest.main() From d28f4b5446b3957bf3463a644c62fecfe2f05e6c Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Fri, 30 Jul 2021 19:33:35 +0200 Subject: [PATCH 3/5] Update unittests.yml --- .github/workflows/unittests.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/unittests.yml b/.github/workflows/unittests.yml index b5484b761..8465dca5e 100644 --- a/.github/workflows/unittests.yml +++ b/.github/workflows/unittests.yml @@ -20,6 +20,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} - uses: conda-incubator/setup-miniconda@v2 with: auto-update-conda: true From 39ca48037f357252addfcb02d77161572c004246 Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Sat, 31 Jul 2021 11:55:56 +0200 Subject: [PATCH 4/5] Revert "Delete test_murnaghan_non_modal.py" This reverts commit bfaacabe --- .../master/test_murnaghan_non_modal.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tests/atomistics/master/test_murnaghan_non_modal.py diff --git a/tests/atomistics/master/test_murnaghan_non_modal.py b/tests/atomistics/master/test_murnaghan_non_modal.py new file mode 100644 index 000000000..181409abf --- /dev/null +++ b/tests/atomistics/master/test_murnaghan_non_modal.py @@ -0,0 +1,76 @@ +# coding: utf-8 +# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department +# Distributed under the terms of "New BSD License", see the LICENSE file. + +import os +from pyiron_atomistics.atomistics.structure.atoms import CrystalStructure +from pyiron_base import Project +import unittest + + +def convergence_goal(self, **qwargs): + import numpy as np + + eps = 0.2 + if "eps" in qwargs: + eps = qwargs["eps"] + erg_lst = self.get_from_childs("output/generic/energy") + var = 1000 * np.var(erg_lst) + # print(var / len(erg_lst)) + if var / len(erg_lst) < eps: + return True + ham_prev = self[-1] + job_name = self.first_child_name() + "_" + str(len(self)) + ham_next = ham_prev.restart(job_name=job_name) + return ham_next + + +class TestMurnaghan(unittest.TestCase): + @classmethod + def setUpClass(cls): + cls.file_location = os.path.dirname(os.path.abspath(__file__)) + cls.project = Project( + os.path.join(cls.file_location, "testing_murnaghan_non_modal") + ) + cls.basis = CrystalStructure( + element="Fe", bravais_basis="bcc", lattice_constant=2.8 + ) + cls.project.remove_jobs_silently(recursive=True) + # cls.project.remove_jobs(recursive=True) + # self.project.set_logging_level('INFO') + + @classmethod + def tearDownClass(cls): + file_location = os.path.dirname(os.path.abspath(__file__)) + project = Project(os.path.join(file_location, "testing_murnaghan_non_modal")) + project.remove_jobs_silently(recursive=True) + project.remove(enable=True, enforce=True) + + def test_run(self): + # Even though the test is completed successful + ham = self.project.create_job( + self.project.job_type.AtomisticExampleJob, "job_test" + ) + ham.structure = self.basis + ham.server.run_mode.non_modal = True + job_ser = self.project.create_job( + self.project.job_type.SerialMaster, "murn_iter" + ) + job_ser.append(ham) + job_ser.server.run_mode.non_modal = True + job_ser.set_goal(convergence_goal, eps=0.4) + murn = self.project.create_job("Murnaghan", "murnaghan") + murn.ref_job = job_ser + murn.input["num_points"] = 3 + murn.server.run_mode.non_modal = True + murn.run() + self.assertFalse(job_ser.status.finished) + self.project.wait_for_job(murn, interval_in_s=5, max_iterations=50) + self.assertTrue(murn.status.finished) + murn.remove() + job_ser.remove() + self.project.remove(enable=True, enforce=True) + + +if __name__ == "__main__": + unittest.main() From 5e0926ae2e11b2b7c2978e29f3c159ab74061311 Mon Sep 17 00:00:00 2001 From: Niklas Siemer <70580458+niklassiemer@users.noreply.github.com> Date: Mon, 2 Aug 2021 08:46:55 +0200 Subject: [PATCH 5/5] Fix sphinx (#304) --- .ci_support/environment-notebooks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci_support/environment-notebooks.yml b/.ci_support/environment-notebooks.yml index d86d05177..181455980 100644 --- a/.ci_support/environment-notebooks.yml +++ b/.ci_support/environment-notebooks.yml @@ -7,7 +7,7 @@ dependencies: - nglview - papermill - seaborn - - sphinxdft >=2.7.0 + - sphinxdft >=3.0 - sphinxdft-data - iprpy-data - pyiron-data >=0.0.14