Skip to content

Commit

Permalink
Merge pull request #269 from a-ws-m/black-formatting
Browse files Browse the repository at this point in the history
Black formatting

close #271
  • Loading branch information
orbeckst authored Aug 25, 2023
2 parents 3971e5d + 2ddf4cd commit 6449879
Show file tree
Hide file tree
Showing 50 changed files with 3,489 additions and 2,304 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Autoformat all files using `black`
8f061e7da99eb78353e9392d6929673da5b352a3
10 changes: 10 additions & 0 deletions .github/workflows/black.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: Lint

on: [push, pull_request]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: psf/black@stable
6 changes: 6 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"recommendations": [
"ms-python.black-formatter",
"ms-python.python"
]
}
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"[python]": {
"editor.formatOnSave": true
}
}
4 changes: 4 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,7 @@ their first commit. GitHub handle is optional.

- Cade Duckworth (cadeduckworth)

2023
----

- Alexander Moriarty (@a-ws-m)
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Add summary of changes for each release. Use ISO 8061 dates. Reference
GitHub issues numbers and PR numbers.

2023-??-?? 0.9.0
cadeduckworth, orbeckst, VOD555
cadeduckworth, orbeckst, VOD555, a-ws-m

Changes

Expand All @@ -24,6 +24,7 @@ Changes
* _prepare_universe and _conclude_universe removed from
EnsembleAnalysis.run() method, no longer needed (per comments, #199)
* internal log_banner() now uses logger as argument (PR #247)
* use `black` formatter for codebase (#271)

Enhancements

Expand Down
11 changes: 9 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
README for MDPOW
===================

|build| |cov| |docs| |zenodo|
|build| |cov| |docs| |black| |zenodo|

.. |P_ow| replace:: *P*\ :sub:`OW`
.. |P_cw| replace:: *P*\ :sub:`CW`
Expand Down Expand Up @@ -74,9 +74,14 @@ Source code
*MDPOW* is open source and published under the `GNU General Public License
v3`_. Source code is available at https://github.com/Becksteinlab/MDPOW .

We use `black`_ for uniform code formatting.

.. _`GNU General Public License v3`:
http://www.gnu.org/licenses/gpl-3.0.html

.. _`black`: https://github.com/psf/black


Footnotes
---------

Expand All @@ -99,6 +104,8 @@ Footnotes
:target: https://zenodo.org/badge/latestdoi/44999898
:alt: Zenodo


.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black

.. _INSTALL: INSTALL.rst
22 changes: 15 additions & 7 deletions doc/examples/benzene/session.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
import mdpow.equil

S = mdpow.equil.WaterSimulation(molecule="BNZ")
S.topology("benzene.itp")
S.solvate(struct="benzene.pdb")
S.energy_minimize()
S.MD_relaxed(runtime=5) # should be at least 1e3 ps for production not just 5 ps
S.MD_relaxed(runtime=5) # should be at least 1e3 ps for production not just 5 ps

# run simulation externally or use MDrunner
# (see docs for using mpi etc)
import gromacs
r = gromacs.run.MDrunner(dirname=S.dirs['MD_relaxed'], deffnm="md", c="md.pdb", cpi=True, append=True, v=True)
r.run() # runs mdrun in the python shell

r = gromacs.run.MDrunner(
dirname=S.dirs["MD_relaxed"], deffnm="md", c="md.pdb", cpi=True, append=True, v=True
)
r.run() # runs mdrun in the python shell


S.MD(runtime=10, qscript=['local.sh']) # should be at least 10e3 ps for production, not just 10 ps
S.MD(
runtime=10, qscript=["local.sh"]
) # should be at least 10e3 ps for production, not just 10 ps
# run simulation
r = gromacs.run.MDrunner(dirname=S.dirs['MD_NPT'], deffnm="md", c="md.pdb", cpi=True, append=True, v=True)
r.run() # runs mdrun in the python shell
r = gromacs.run.MDrunner(
dirname=S.dirs["MD_NPT"], deffnm="md", c="md.pdb", cpi=True, append=True, v=True
)
r.run() # runs mdrun in the python shell


import mdpow.fep

gwat = mdpow.fep.Ghyd(simulation=S, runtime=10)
gwat.setup()

# run multiple simulations on cluster



O = mdpow.equil.OctanolSimulation(molecule="BNZ")
O.topology("benzene.itp")
O.solvate(struct="benzene.pdb")
Expand Down
Loading

0 comments on commit 6449879

Please sign in to comment.