Skip to content

Commit

Permalink
Formatting and numpydoc style
Browse files Browse the repository at this point in the history
  • Loading branch information
jngrad committed Aug 30, 2019
1 parent 8d00819 commit 8fb8097
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 105 deletions.
16 changes: 11 additions & 5 deletions samples/grand_canonical.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,16 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
This example script performs a grand canonical simulation of a system in contact with a salt reservoir and ensures constant chemical potential.
It takes two command line arguments as input: 1) the reservoir salt concentration in units of 1/sigma^3 and 2) the excess chemical potential of the reservoir in units of kT.
The excess chemical potential of the reservoir needs to be determined prior to running the grand canonical simulation using the script called widom_insertion.py which simulates a part of the reservoir at the prescribed salt concentration. Be aware that the reservoir excess chemical potential depends on all interactions in the reservoir system.
This example script performs a grand canonical simulation of a system in contact
with a salt reservoir and ensures constant chemical potential.
It takes two command line arguments as input: 1) the reservoir salt concentration
in units of 1/sigma^3 and 2) the excess chemical potential of the reservoir in
units of kT.
The excess chemical potential of the reservoir needs to be determined prior to
running the grand canonical simulation using the script called widom_insertion.py
which simulates a part of the reservoir at the prescribed salt concentration.
Be aware that the reservoir excess chemical potential depends on all interactions
in the reservoir system.
"""
import numpy as np
import argparse
Expand Down Expand Up @@ -81,8 +88,7 @@
for type_1 in types:
for type_2 in types:
system.non_bonded_inter[type_1, type_2].lennard_jones.set_params(
epsilon=lj_eps, sigma=lj_sig,
cutoff=lj_cut, shift="auto")
epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto")

RE = reaction_ensemble.ReactionEnsemble(
temperature=temperature, exclusion_radius=2.0, seed=3)
Expand Down
9 changes: 5 additions & 4 deletions samples/widom_insertion.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
"""
This example script measures the excess chemical potential of a charged WCA fluid via Widom's insertion method.
As input this script requires you to provide particle number density in units of 1/sigma^3.
This example script measures the excess chemical potential of a charged WCA
fluid via Widom's insertion method.
As input this script requires you to provide particle number density in units
of 1/sigma^3.
"""
import numpy as np
import argparse
Expand Down Expand Up @@ -79,8 +81,7 @@
for type_1 in types:
for type_2 in types:
system.non_bonded_inter[type_1, type_2].lennard_jones.set_params(
epsilon=lj_eps, sigma=lj_sig,
cutoff=lj_cut, shift="auto")
epsilon=lj_eps, sigma=lj_sig, cutoff=lj_cut, shift="auto")

p3m = electrostatics.P3M(prefactor=2.0, accuracy=1e-3)
system.actors.add(p3m)
Expand Down
Loading

0 comments on commit 8fb8097

Please sign in to comment.