Skip to content

Commit

Permalink
Fix/issue 1196 (#1229)
Browse files Browse the repository at this point in the history
* CI miscellaneous fixes (#1217)

* CI minor fixes. Allow codecov to fail.

* bump ci

---------

Co-authored-by: Mike Henry <[email protected]>

* added dels to contexts

* Update perses/app/setup_relative_calculation.py

---------

Co-authored-by: Iván Pulido <[email protected]>
  • Loading branch information
mikemhenry and ijpulidos authored Aug 25, 2023
1 parent f6ee190 commit ff55126
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion perses/app/setup_relative_calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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']}")
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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]}")
Expand All @@ -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")

Expand Down

0 comments on commit ff55126

Please sign in to comment.