From ff55126f7e319f5c4a7631a528dfcb8b71178693 Mon Sep 17 00:00:00 2001 From: Mike Henry <11765982+mikemhenry@users.noreply.github.com> Date: Thu, 24 Aug 2023 22:32:22 -0700 Subject: [PATCH] Fix/issue 1196 (#1229) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * CI miscellaneous fixes (#1217) * CI minor fixes. Allow codecov to fail. * bump ci --------- Co-authored-by: Mike Henry <11765982+mikemhenry@users.noreply.github.com> * added dels to contexts * Update perses/app/setup_relative_calculation.py --------- Co-authored-by: Iván Pulido <2949729+ijpulidos@users.noreply.github.com> --- perses/app/setup_relative_calculation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/perses/app/setup_relative_calculation.py b/perses/app/setup_relative_calculation.py index c43ff6054..46974c01a 100644 --- a/perses/app/setup_relative_calculation.py +++ b/perses/app/setup_relative_calculation.py @@ -753,7 +753,7 @@ def run_setup(setup_options, serialize_systems=True, build_samplers=True): def run(yaml_filename=None, override_string=None): cli_tool_name = sys.argv[0].split(os.sep)[-1] if cli_tool_name == "perses-relative": - warnings.warn("perses-relative will be removed in 0.11, see https://github.com/choderalab/perses/tree/main/examples/new-cli for new CLI tool", FutureWarning) + warning.warn("perses-relative will be removed in 0.11, see https://github.com/choderalab/perses/tree/main/examples/new-cli for new CLI tool", FutureWarning) _logger.info("Beginning Setup...") if yaml_filename is None: try: @@ -954,6 +954,7 @@ def run(yaml_filename=None, override_string=None): logZ[phase] = hss_run._logZ[-1] - hss_run._logZ[0] free_energies[phase] = hss_run._last_mbar_f_k[-1] - hss_run._last_mbar_f_k[0] _logger.info(f"\t\tFinished phase {phase}") + del hss[phase].energy_context_cache, hss[phase].sampler_context_cache for phase in free_energies: print(f"Comparing ligand {setup_options['old_ligand_index']} to {setup_options['new_ligand_index']}") @@ -984,6 +985,7 @@ def run(yaml_filename=None, override_string=None): _logger.info(f"\n\n") _logger.info(f"\t\tFinished phase {phase}") + del hss[phase].energy_context_cache, hss[phase].sampler_context_cache def _resume_run(setup_options): @@ -1018,6 +1020,7 @@ def _resume_run(setup_options): logZ[phase] = simulation._logZ[-1] - simulation._logZ[0] free_energies[phase] = simulation._last_mbar_f_k[-1] - simulation._last_mbar_f_k[0] _logger.info(f"\t\tFinished phase {phase}") + del simulation.sampler_context_cache, simulation.energy_context_cache for phase in free_energies: print(f"Comparing ligand {setup_options['old_ligand_index']} to {setup_options['new_ligand_index']}") print(f"{phase} phase has a free energy of {free_energies[phase]}") @@ -1041,6 +1044,7 @@ def _resume_run(setup_options): simulation.extend(n_iterations=left_to_do) _logger.info(f"\n\n") _logger.info(f"\t\tFinished phase {phase}") + del simulation.sampler_context_cache, simulation.energy_context_cache else: raise("Can't resume")