From c9c35728a01b36f7af31f60526e8823e3eee8646 Mon Sep 17 00:00:00 2001 From: IAlibay Date: Tue, 23 Jul 2024 09:27:26 -0400 Subject: [PATCH] Fix issue 138 --- cookbook/choose_protocol.ipynb | 73 ++++++---------------------------- 1 file changed, 12 insertions(+), 61 deletions(-) diff --git a/cookbook/choose_protocol.ipynb b/cookbook/choose_protocol.ipynb index b8a1601..f118839 100644 --- a/cookbook/choose_protocol.ipynb +++ b/cookbook/choose_protocol.ipynb @@ -31,7 +31,7 @@ }, { "cell_type": "code", - "execution_count": 9, + "execution_count": 1, "id": "38b41f0a-d2a3-4231-bf08-1504d3824978", "metadata": { "slideshow": { @@ -82,7 +82,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 2, "id": "b0757f5f-e38f-43ac-b43f-ee2bbea95f0d", "metadata": { "slideshow": { @@ -135,7 +135,7 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": 3, "id": "96c32ead-a8d0-4283-950b-5d27c74ebf16", "metadata": { "slideshow": { @@ -163,7 +163,7 @@ }, { "cell_type": "code", - "execution_count": 12, + "execution_count": 4, "id": "8d5a6281-50f9-4062-8fa4-375ce2df1bd6", "metadata": { "slideshow": { @@ -252,7 +252,7 @@ }, { "cell_type": "code", - "execution_count": 13, + "execution_count": 5, "id": "2de6c6a9-bceb-4c9c-ae5a-3d88a72c801a", "metadata": { "slideshow": { @@ -288,7 +288,7 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 6, "id": "844e6fa5-f363-47fa-881d-00328faa601c", "metadata": { "slideshow": { @@ -401,7 +401,7 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 7, "id": "b499d852-4d7e-47c5-9342-31017baed37c", "metadata": { "nbsphinx": "hidden", @@ -410,59 +410,10 @@ }, "tags": [] }, - "outputs": [ - { - "ename": "AssertionError", - "evalue": "", - "output_type": "error", - "traceback": [ - "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", - "\u001b[0;31mAssertionError\u001b[0m Traceback (most recent call last)", - "Cell \u001b[0;32mIn[15], line 3\u001b[0m\n\u001b[1;32m 1\u001b[0m \u001b[38;5;66;03m# Double check that the above settings match the defaults - delete this cell if you configure things yourself!\u001b[39;00m\n\u001b[1;32m 2\u001b[0m \u001b[38;5;66;03m# See https://github.com/OpenFreeEnergy/ExampleNotebooks/issues/138\u001b[39;00m\n\u001b[0;32m----> 3\u001b[0m \u001b[38;5;28;01massert\u001b[39;00m settings \u001b[38;5;241m==\u001b[39m RelativeHybridTopologyProtocol\u001b[38;5;241m.\u001b[39mdefault_settings()\n", - "\u001b[0;31mAssertionError\u001b[0m: " - ] - } - ], - "source": [ - "# Double check that the above settings match the defaults - delete this cell if you configure things yourself!\n", - "# See https://github.com/OpenFreeEnergy/ExampleNotebooks/issues/138\n", - "#assert settings == RelativeHybridTopologyProtocol.default_settings()" - ] - }, - { - "cell_type": "code", - "execution_count": 17, - "id": "3a6d3f17-2049-4456-a315-ce40ebd8969c", - "metadata": {}, - "outputs": [ - { - "name": "stdout", - "output_type": "stream", - "text": [ - "forcefield_settings\n", - "forcefield_settings=OpenMMSystemGeneratorFFSettings(constraints='hbonds', rigid_water=True, hydrogen_mass=3.0, forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml', 'amber/tip3p_HFE_multivalent.xml', 'amber/phosaa10.xml'], small_molecule_forcefield='openff-2.0.0', nonbonded_cutoff=, nonbonded_method='PME') thermo_settings=ThermoSettings(temperature=, pressure=, ph=None, redox_potential=None) protocol_repeats=3 solvation_settings=OpenMMSolvationSettings(solvent_model='tip3p', solvent_padding=) partial_charge_settings=OpenFFPartialChargeSettings(partial_charge_method='am1bcc', off_toolkit_backend='ambertools', number_of_conformers=None, nagl_model=None) lambda_settings=LambdaSettings(lambda_functions='default', lambda_windows=11) alchemical_settings=AlchemicalSettings(softcore_LJ='gapsys', explicit_charge_correction_cutoff=, endstate_dispersion_correction=False, use_dispersion_correction=False, softcore_alpha=0.85, turn_off_core_unique_exceptions=False, explicit_charge_correction=False) simulation_settings=MultiStateSimulationSettings(equilibration_length=, production_length=, minimization_steps=5000, time_per_iteration=, real_time_analysis_interval=, early_termination_target_error=, real_time_analysis_minimum_time=, sampler_method='repex', sams_flatness_criteria='logZ-flatness', sams_gamma0=1.0, n_replicas=11) engine_settings=OpenMMEngineSettings(compute_platform=None) integrator_settings=IntegratorSettings(timestep=, langevin_collision_rate=, barostat_frequency=, remove_com=False, reassign_velocities=False, n_restart_attempts=20, constraint_tolerance=1e-06) output_settings=MultiStateOutputSettings(checkpoint_interval=, forcefield_cache='db.json', output_indices='not water', checkpoint_storage_filename='checkpoint.chk', output_filename='simulation.nc', output_structure='hybrid_system.pdb'), forcefield_settings != \n", - " forcefield_settings=OpenMMSystemGeneratorFFSettings(constraints='hbonds', rigid_water=True, hydrogen_mass=3.0, forcefields=['amber/ff14SB.xml', 'amber/tip3p_standard.xml', 'amber/tip3p_HFE_multivalent.xml', 'amber/phosaa10.xml'], small_molecule_forcefield='openff-2.1.1', nonbonded_cutoff=, nonbonded_method='PME') thermo_settings=ThermoSettings(temperature=, pressure=, ph=None, redox_potential=None) protocol_repeats=3 solvation_settings=OpenMMSolvationSettings(solvent_model='tip3p', solvent_padding=) partial_charge_settings=OpenFFPartialChargeSettings(partial_charge_method='am1bcc', off_toolkit_backend='ambertools', number_of_conformers=None, nagl_model=None) lambda_settings=LambdaSettings(lambda_functions='default', lambda_windows=11) alchemical_settings=AlchemicalSettings(softcore_LJ='gapsys', explicit_charge_correction_cutoff=, endstate_dispersion_correction=False, use_dispersion_correction=False, softcore_alpha=0.85, turn_off_core_unique_exceptions=False, explicit_charge_correction=False) simulation_settings=MultiStateSimulationSettings(equilibration_length=, production_length=, minimization_steps=5000, time_per_iteration=, real_time_analysis_interval=, early_termination_target_error=, real_time_analysis_minimum_time=, sampler_method='repex', sams_flatness_criteria='logZ-flatness', sams_gamma0=1.0, n_replicas=11) engine_settings=OpenMMEngineSettings(compute_platform=None) integrator_settings=IntegratorSettings(timestep=, langevin_collision_rate=, barostat_frequency=, remove_com=False, reassign_velocities=False, n_restart_attempts=20, constraint_tolerance=1e-06) output_settings=MultiStateOutputSettings(checkpoint_interval=, forcefield_cache='db.json', output_indices='not water', checkpoint_storage_filename='checkpoint.chk', output_filename='simulation.nc', output_structure='hybrid_system.pdb'), forcefield_settings\n", - "thermo_settings\n", - "protocol_repeats\n", - "solvation_settings\n", - "partial_charge_settings\n", - "lambda_settings\n", - "alchemical_settings\n", - "simulation_settings\n", - "engine_settings\n", - "integrator_settings\n", - "output_settings\n" - ] - } - ], + "outputs": [], "source": [ - "default_settings = RelativeHybridTopologyProtocol.default_settings()\n", - "\n", - "for name, s in settings:\n", - " print(name)\n", - "\n", - " if getattr(settings, name) != getattr(default_settings, name):\n", - " print(f\"{settings}, {name} != \\n {default_settings}, {name}\")" + "# Double check that the above settings match the defaults\n", + "assert settings == RelativeHybridTopologyProtocol.default_settings()" ] }, { @@ -483,7 +434,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "id": "32b9b58a-d7ea-4071-9046-53e6990a1faa", "metadata": { "slideshow": { @@ -521,7 +472,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.14" + "version": "3.12.4" }, "widgets": { "application/vnd.jupyter.widget-state+json": {