From f871f863d9685c7825233e4f2dbb3896bfc11e5b Mon Sep 17 00:00:00 2001 From: Sarath Menon Date: Fri, 23 Feb 2024 17:35:59 +0100 Subject: [PATCH] add input config save --- calphy/phase.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/calphy/phase.py b/calphy/phase.py index 3fd84c3..aa87e6c 100644 --- a/calphy/phase.py +++ b/calphy/phase.py @@ -28,6 +28,8 @@ import numpy as np import yaml import copy +import os +import shutil import pyscal3.traj_process as ptp from calphy.integrators import * @@ -50,6 +52,15 @@ class Phase: def __init__(self, calculation=None, simfolder=None, log_to_screen=False): self.calc = copy.deepcopy(calculation) + + #serialise input + indict = {"calculations": [self.calc.dict()]} + with open(os.path.join(simfolder, 'input_file.yml'), 'w') as fout: + yaml.safe_dump(indict, fout) + + #serialise input configuration + shutil.copy(self.calc.lattice, os.path.join(simfolder, 'input_configuration.data')) + self.simfolder = simfolder self.log_to_screen = log_to_screen