From 4909fc2fe130d1221b81a84908db300d2bc2ec95 Mon Sep 17 00:00:00 2001 From: Luke2Sky Date: Fri, 6 Oct 2023 20:34:04 -0300 Subject: [PATCH 1/2] Fixed Multi-Component Hydrogen Bond Propensity outdated README.md. --- scripts/multi_component_hydrogen_bond_propensity/ReadMe.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/multi_component_hydrogen_bond_propensity/ReadMe.md b/scripts/multi_component_hydrogen_bond_propensity/ReadMe.md index ef53848..546648c 100644 --- a/scripts/multi_component_hydrogen_bond_propensity/ReadMe.md +++ b/scripts/multi_component_hydrogen_bond_propensity/ReadMe.md @@ -42,6 +42,8 @@ optional arguments: the working directory for the calculation -c COFORMER_LIBRARY, --coformer_library COFORMER_LIBRARY the directory of the desired coformer library + -f FAILURE_DIRECTORY, --failure_directory FAILURE_DIRECTORY + The location where the failures file should be generated ``` The default coformer library is the one supplied with your Mercury install From 4e2c2d92095bab230bb3db89dc244674f49e5840 Mon Sep 17 00:00:00 2001 From: Luke2Sky Date: Fri, 6 Oct 2023 21:51:25 -0300 Subject: [PATCH 2/2] Fixed something I perceive as a bug: the chart file that looks to be outside the for loop for coformers is being generated inside a coformer's folder. Changed its location to work_directory variable. I also removed a debug print that I forgot in there in the previous pull request. --- .../multi_component_hydrogen_bond_propensity_report.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/multi_component_hydrogen_bond_propensity/multi_component_hydrogen_bond_propensity_report.py b/scripts/multi_component_hydrogen_bond_propensity/multi_component_hydrogen_bond_propensity_report.py index af167ff..c7a10e5 100644 --- a/scripts/multi_component_hydrogen_bond_propensity/multi_component_hydrogen_bond_propensity_report.py +++ b/scripts/multi_component_hydrogen_bond_propensity/multi_component_hydrogen_bond_propensity_report.py @@ -358,7 +358,6 @@ def main(structure, work_directory, failure_directory, library, csdrefcode): tdata = get_mc_scores(propensities, crystal.identifier) json.dump(tdata, file) mc_dictionary[coformer_name] = get_mc_scores(propensities, crystal.identifier) - print(get_mc_scores(propensities, crystal.identifier)) except RuntimeError: print("Propensity calculation failure for %s!" % coformer_name) mc_dictionary[coformer_name] = ["N/A", "N/A", "N/A", "N/A", "N/A", crystal.identifier] @@ -367,7 +366,7 @@ def main(structure, work_directory, failure_directory, library, csdrefcode): # Make sense of the outputs of all the calculations mc_hbp_screen = sorted(mc_dictionary.items(), key=lambda e: 0 if e[1][0] == 'N/A' else e[1][0], reverse=True) diagram_file = make_diagram(api_molecule, work_directory) - chart_file = make_mc_chart(mc_hbp_screen, directory, api_molecule) + chart_file = make_mc_chart(mc_hbp_screen, work_directory, api_molecule) make_mc_report(structure, mc_hbp_screen, work_directory, diagram_file, chart_file) if failure_directory is not None: with open(os.path.join(failure_directory, 'failures.txt'), 'w', encoding='utf-8', newline='') as file: