diff --git a/docs/source/conf.py b/docs/source/conf.py index 719b49c..8aea869 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 diff --git a/pylj/forcefields.py b/pylj/forcefields.py index 5eca8a9..90b1c2d 100644 --- a/pylj/forcefields.py +++ b/pylj/forcefields.py @@ -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): diff --git a/pylj/tests/test_forcefields.py b/pylj/tests/test_forcefields.py index 15a6fed..0b643aa 100644 --- a/pylj/tests/test_forcefields.py +++ b/pylj/tests/test_forcefields.py @@ -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]) diff --git a/pylj/util.py b/pylj/util.py index 8d4c81b..cb63813 100644 --- a/pylj/util.py +++ b/pylj/util.py @@ -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)) diff --git a/requirements.txt b/requirements.txt index 617045e..d2f5a9a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ jupyter cython -numpy +numpy>=1.16 matplotlib==2.2.3 numba coverage diff --git a/setup.py b/setup.py index 090b72d..c2b242d 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ # versioning MAJOR = 1 MINOR = 3 -MICRO = 2 +MICRO = 3 ISRELEASED = True VERSION = '%d.%d.%d' % (MAJOR, MINOR, MICRO)