-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into add-api-breaking-detection
- Loading branch information
Showing
75 changed files
with
1,500 additions
and
313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ on: | |
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
shell: bash -leo pipefail {0} | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
"""A script to fix up rbfe_results.tar.gz | ||
Useful if Settings are ever changed in a backwards-incompatible way | ||
Will expect "rbfe_results.tar.gz" in this directory, will overwrite this file | ||
""" | ||
from gufe.tokenization import JSON_HANDLER | ||
import glob | ||
import json | ||
from openfe.protocols import openmm_rfe | ||
import os.path | ||
import tarfile | ||
|
||
|
||
def untar(fn): | ||
"""extract tarfile called *fn*""" | ||
with tarfile.open(fn) as f: | ||
f.extractall() | ||
|
||
|
||
def retar(loc, name): | ||
"""create tar.gz called *name* of directory *loc*""" | ||
with tarfile.open(name, mode='w:gz') as f: | ||
f.add(loc, arcname=os.path.basename(loc)) | ||
|
||
|
||
def replace_settings(fn, new_settings): | ||
"""replace settings instances in *fn* with *new_settings*""" | ||
with open(fn, 'r') as f: | ||
data = json.load(f) | ||
|
||
for k in data['protocol_result']['data']: | ||
data['protocol_result']['data'][k][0]['inputs']['settings'] = new_settings | ||
|
||
for k in data['unit_results']: | ||
data['unit_results'][k]['inputs']['settings'] = new_settings | ||
|
||
with open(fn, 'w') as f: | ||
json.dump(data, f, cls=JSON_HANDLER.encoder) | ||
|
||
|
||
def fix_rbfe_results(): | ||
untar('rbfe_results.tar.gz') | ||
|
||
# generate valid settings as defaults | ||
new_settings = openmm_rfe.RelativeHybridTopologyProtocol.default_settings() | ||
|
||
# walk over all result jsons | ||
for fn in glob.glob('./results/*json'): | ||
# replace instances of settings within with valid settings | ||
replace_settings(fn, new_settings) | ||
|
||
retar('results', 'rbfe_results.tar.gz') | ||
|
||
|
||
if __name__ == '__main__': | ||
fix_rbfe_results() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"path": "../ExampleNotebooks/cookbook/rfe_alchemical_planners.ipynb" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.. _userguide_cli_interface: | ||
|
||
CLI Interface | ||
============= | ||
|
||
|
6 changes: 4 additions & 2 deletions
6
docs/guide/models/execution.rst → docs/guide/execution/execution_theory.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
.. _userguide_execution: | ||
|
||
Execution | ||
--------- | ||
========= | ||
|
||
Given a :class:`.Transformation`, the easiest way to run it is to use the | ||
:func:`.execute_DAG` method. This will take the `.Transformation` object | ||
and execute its `.ProtocolUnit` instances serially. Once complete it will | ||
return a :class:`.ProtocolDAGResult`. Multiple ProtocolDAGResults from a given | ||
transformation can be analyzed together with :meth:`.Protocol.gather` to | ||
create a :class:`.ProtocolResult`. | ||
|
||
|
||
.. TODO: add information about failures etc... | ||
With a :class:`.Transformation` defined, the next step is to execute this. | ||
The easiest way to run it is to use the :ref:`quickrun CLI tool <userguide_quickrun>`. | ||
More advanced options are available through first considering the | ||
:ref:`theory of the execution model<userguide_execution_theory>` | ||
then :ref:`reading on the available Python functions<reference_execution>`. | ||
|
||
.. toctree:: | ||
quickrun_execution | ||
execution_theory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
.. _userguide_quickrun: | ||
|
||
Execution with Quickrun | ||
======================= | ||
|
||
The planning and preparation of a campaign of alchemical simulations using the ``openfe`` package is intended to be | ||
achievable on a local workstation in a matter of minutes. | ||
The **execution** of these simulations however requires a large amount of computational power, | ||
and beyond running single calculations locally, | ||
is intended to be distributed across a HPC environment. | ||
Doing this requires storing and sending the details of the simulation from the local workstation to a HPC environment, | ||
this can be done via the :func:`.Transformation.dump` function which | ||
:ref:`creates a saved "json" version of the data<dumping_transformations>`. | ||
These serialised "json" files are the currency of executing a campaign of simulations, | ||
and contain all the information required to execute a single simulation. | ||
|
||
To read this information and execute the simulation, the command line interface provides a ``quickrun`` command, | ||
the full details of which are given in :ref:`the CLI reference section<cli_quickrun>`. | ||
Briefly, this command takes a "json" simulation as an input and will then execute the simulation contained within, | ||
therefore this command would execute a simulation saved to a file called "transformation.json". | ||
|
||
:: | ||
|
||
openfe quickrun transformation.json -o results.json | ||
|
||
|
||
Which will produce a results file called ``results.json``. | ||
|
||
Executing within a job submission script | ||
---------------------------------------- | ||
|
||
It is likely that computational jobs will be submitted to a queueing engine, such as slurm. | ||
The ``quickrun`` command can be integrated into as: | ||
|
||
:: | ||
|
||
#!/bin/bash | ||
|
||
#SBATCH --job-name="openfe job" | ||
#SBATCH --mem-per-cpu=2G | ||
|
||
# activate an appropriate conda environment, or any "module load" commands required to | ||
conda activate openfe_env | ||
|
||
openfe quickrun transformation.json -o results.json | ||
|
||
|
||
See Also | ||
-------- | ||
|
||
For details on inspecting these results, refer to :ref:`userguide_results`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.