Skip to content

Commit

Permalink
Merge pull request #48 from arm61/sansona-master
Browse files Browse the repository at this point in the history
Building on #47
  • Loading branch information
Andrew McCluskey authored Jun 3, 2019
2 parents 785aa2c + d417247 commit 303f8cc
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
# built documents.
#
# The short X.Y version.
version = '1.3.2'
version = '1.3.3'
# The full version, including alpha/beta/rc tags.
release = version

Expand Down
6 changes: 3 additions & 3 deletions pylj/forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,13 @@ def buckingham(dr, constants, force=False):
float: array_like
The potential energy or force between the particles.
"""

if force:
return constants[0] * constants[1] * np.exp(
-constants[1] * dr) - 6 * constants[2] / np.power(dr, 7)
- np.multiply(constants[1], dr)) - 6 * constants[2] / np.power(
dr, 7)
else:
return constants[0] * np.exp(
-constants[1] * dr) - constants[2] / np.power(dr, 6)
- np.multiply(constants[1], dr)) - constants[2] / np.power(dr, 6)


def square_well(dr, constants, max_val=np.inf, force=False):
Expand Down
11 changes: 11 additions & 0 deletions pylj/tests/test_forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,21 @@ def test_lennard_jones_sigma_epsilon_force(self):
def test_buckingham_energy(self):
a = forcefields.buckingham(2.0, [1.0, 1.0, 1.0])
assert_almost_equal(a, 0.1197103832)
b = forcefields.buckingham([2.0], [1.0, 1.0, 1.0])
assert_almost_equal(b, 0.1197103832)
c = forcefields.buckingham([2.0, 4.0], [1.0, 1.0, 1.0])
assert_almost_equal(c, [0.1197103832, 0.0180715])
d = forcefields.buckingham([2.0, 4.0, 5.0], [0.01, 0.01, 0.01])
assert_almost_equal(d, [0.0096457, 0.0096055, 0.0095117])

def test_buckingham_force(self):
a = forcefields.buckingham(2.0, [1.0, 1.0, 1.0], force=True)
assert_almost_equal(a, 0.08846028324)
b = forcefields.buckingham([2.0], [1.0, 1.0, 1.0], force=True)
assert_almost_equal(b, 0.08846028324)
c = forcefields.buckingham(
[2.0, 1.0, 4.0], [1.5, 0.1, 2.0], force=True)
assert_almost_equal(c, [0.0290596, -11.8642744, 0.0998156])

def test_square_well_energy(self):
a = forcefields.square_well(2.0, [1.0, 1.5, 2.0])
Expand Down
2 changes: 1 addition & 1 deletion pylj/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def __version__(): # pragma: no cover
"""This will print the number of the pylj version currently in use."""
major = 1
minor = 3
micro = 2
micro = 3
print("pylj-{:d}.{:d}.{:d}".format(major, minor, micro))


Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
jupyter
cython
numpy
numpy>=1.16
matplotlib==2.2.3
numba
coverage
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# versioning
MAJOR = 1
MINOR = 3
MICRO = 2
MICRO = 3
ISRELEASED = True
VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)

Expand Down

0 comments on commit 303f8cc

Please sign in to comment.