-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement batch_run #22
Conversation
@selimsami I think you have added some comments early this morning, but they are gone now. |
Yes I saw a problem somewhere but then I realized my solution was not good. I'll have another look soon. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice, I have some minor comments, it can be merged after they are implemented.
qforce/fragment.py
Outdated
@@ -357,26 +369,31 @@ def check_for_qm_data(self, job, config, mol, qm): | |||
|
|||
else: | |||
self.check_new_scan_data(job, mol, config, qm) | |||
self.write_have_or_missing(job) | |||
self.write_have_or_missing(job, config) | |||
nx.write_gpickle(self.graph, f"{self.dir}/identifier_{self.hash_idx}") | |||
self.write_xyz() | |||
with open(f"{self.dir}/qm_method_{self.hash_idx}", 'w') as file: | |||
json.dump(self.graph.graph['qm_method'], file, sort_keys=True, indent=4) | |||
|
|||
if not self.has_data: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if not (self.has_data or (config.batch_run and self.has_inp)):
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I don't quite understand this part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that was a bit ambiguous. I meant replace:
if not self.has_data:
self.make_qm_input(job, qm)
if not (config.batch_run and self.has_inp):
self.make_qm_input(job, qm)
with:
if not (self.has_data or (config.batch_run and self.has_inp)):
self.make_qm_input(job, qm)
qforce/fragment.py
Outdated
if self.has_data: | ||
status = 'have' | ||
else: | ||
status = 'missing' | ||
|
||
if config.batch_run and self.has_inp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be an elif before the else above
qforce/fragment.py
Outdated
|
||
check_and_notify(job, config.scan, len(unique_dihedrals), len(fragments)) | ||
check_and_notify(job, config.scan, len(unique_dihedrals), len(fragments), | ||
len(generated)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not too important but: I use line length of max 100, would be good to be consistent with that. (might apply elsewhere also)
qforce/fragment.py
Outdated
for name, atomids in unique_dihedrals.items(): | ||
frag = Fragment(job, config, mol, qm, atomids, name) | ||
if frag.has_data: | ||
fragments.append(frag) | ||
if frag.has_inp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elif config.batch_run and frag.has_inp:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config here is the fragment config and doesn't have the batch_run attribute.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hmm I think it's the general config. Then you need: config.scan.batch_run
qforce/fragment.py
Outdated
@@ -60,6 +63,8 @@ def check_and_notify(job, config, n_unique, n_have): | |||
print("All scan data is available. Fitting the dihedrals...\n") | |||
else: | |||
print(f"{n_missing} of them are missing the scan data.") | |||
if config.batch_run: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if n_generated > 0:
print(f"{n_generated} of them generated previously (Batch run enabled).")
if n_missing - n_generated > 0:
print(f"QM input files for them are created in: {job.frag_dir}")
@selimsami Thanks for the review. I have addressed the points that I can address. |
@selimsami Thanks for the review, all of the points have been addressed. |
FIx #15
The test is written against the qforce-example selimsami/qforce_examples#1