Skip to content

Commit

Permalink
add input config save
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Feb 23, 2024
1 parent b9d94e0 commit f871f86
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions calphy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 *
Expand All @@ -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

Expand Down

0 comments on commit f871f86

Please sign in to comment.