Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
Fixed Write Data Bug,
Now points added on the final iteration will also recalculate the model and add it to the LOG
  • Loading branch information
MattBurn committed Nov 19, 2019
1 parent 18273f2 commit 708061c
Showing 1 changed file with 15 additions and 11 deletions.
26 changes: 15 additions & 11 deletions ICHOR.py
Original file line number Diff line number Diff line change
Expand Up @@ -1574,15 +1574,15 @@ def write(self, write_data=True):
if len(self.jobs) == 0:
return

if SGE and write_data:
if SGE:
data_directory = FILE_STRUCTURE.get_file_path("jobs")
FileTools.mkdir(data_directory)
data_file = os.path.join(data_directory, self.type)
abs_data_file = os.path.abspath(data_file)

with open(data_file, "w") as f:
for job in self.jobs:
f.write(f"{job.data}\n")
if write_data:
with open(data_file, "w") as f:
for job in self.jobs:
f.write(f"{job.data}\n")

with open(self.fname, "w") as f:
# Settings / Flags
Expand Down Expand Up @@ -2334,9 +2334,16 @@ def run():
args["npoints"] = npoints
if "write_data" in func.__code__.co_varnames:
args["write_data"] = False
script_name, jid = func(jid)
script_name, jid = func(**args)
print(f"Submitted {script_name}: {jid}")

for func in order[:-1]:
args = {"jid": jid}
if "write_data" in func.__code__.co_varnames:
args["write_data"] = False
script_name, jid = func(**args)
print(f"Submitted {script_name}: {jid}")

SUBMITTED = False


Expand Down Expand Up @@ -3735,11 +3742,8 @@ def update_alpha(self):

true_values = []
for point in self[npoints:]:
true_values += [point.get_true_value("iqa", atoms=True)]

with open("test", "w") as f:
json.dump(true_values, f)

true_values += [point.get_true_value("iqa", atoms=True)]

data = {}
data["npoints"] = UsefulTools.nTrain()
data["cv_errors"] = cv_errors
Expand Down

0 comments on commit 708061c

Please sign in to comment.