def test_Chemical_Element_to_and_from_hdf_with_None_Parent(self): pr = Project( os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_periodic_table")) basis = CrystalStructure(element="Ni", bravais_basis="fcc", lattice_constant=3.7) ham = pr.create_job(pr.job_type.Lammps, "lammps_test_2") test_ham = pr.create_job(pr.job_type.Lammps, "lammps_test_2") ham.structure = basis ham.to_hdf() test_ham.from_hdf() self.assertEqual(test_ham["input/structure/species"][0], ham["input/structure/species"][0]) ham.remove()
from pyiron_base import Project, __version__ pr = Project( "tests/static/backwards/V{}".format(__version__).replace(".", "_") ) job = pr.create_job(pr.job_type.ScriptJob, "scriptjob") # scriptjob requires an existing path, so just set this path, since we don't # intend on running our selves anyway job.script_path = __file__ job.input['test_argument'] = 42 job.save()
from pyiron_base import Project, PythonTemplateJob, __version__ class ToyJob(PythonTemplateJob): def __init__(self, project, job_name): super(ToyJob, self).__init__(project, job_name) self.input['input_energy'] = 100 def run_static(self): with self.project_hdf5.open("output/generic") as h5out: h5out["energy_tot"] = self.input["input_energy"] self.status.finished = True pr = Project("tests/static/backwards/V{}".format(__version__).replace( ".", "_")) job = pr.create_job(pr.job_type.ToyJob, "toy1") job.input["input_energy"] = 42 job.run() job = pr.create_job(pr.job_type.ToyJob, "toy2") job.input["input_energy"] = 23 job.run() tab = pr.create_table("toy_table") tab.add['name'] = lambda j: j.name tab.run()