From 19dc506ebe3b9e1d22f5d5a88ee24f82df65f780 Mon Sep 17 00:00:00 2001 From: Andrew Jewett Date: Sat, 11 Apr 2020 20:04:58 -0700 Subject: [PATCH] fixed a bug in "interpolate_curve.py" (preventing scaling of coordinates correctly by the 2nd argument) --- doc/doc_genpoly_lt.md | 2 +- moltemplate/genpoly_lt.py | 6 +++--- moltemplate/interpolate_curve.py | 14 +++++++------- moltemplate/scripts/moltemplate.sh | 4 ++-- setup.py | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/doc/doc_genpoly_lt.md b/doc/doc_genpoly_lt.md index 5921032d..6200713e 100644 --- a/doc/doc_genpoly_lt.md +++ b/doc/doc_genpoly_lt.md @@ -273,7 +273,7 @@ from the terminal) and a python library. The former is documented below. arguments are integer offsets. To point monomer i in the direction connecting it to the following monomer (i+1), use -dir-indices 0 1. arguments are integer offsets. To point monomer i in the direction - connecting it to the previous monomer (i-1), use -dir-indices 0 -1. + connecting it to the previous monomer (i-1), use -dir-indices -1 0. (Note: If the -polymer-directions argument is used, and the current polymer has a direction of -1, the indices ia, ib will be flipped.) For circular polymers, the indices will be wrapped appropriately. diff --git a/moltemplate/genpoly_lt.py b/moltemplate/genpoly_lt.py index 716bc037..7b030118 100755 --- a/moltemplate/genpoly_lt.py +++ b/moltemplate/genpoly_lt.py @@ -585,9 +585,9 @@ def ChooseDirections(self, coords): else: for i in range(1, N - 1): for d in range(0, 3): - self.direction_vects[i][d] = coords[ - i + self.settings.dir_index_offsets[1]][d] - coords[ - i + self.settings.dir_index_offsets[0]][d] + self.direction_vects[i][d] = (coords[i + self.settings.dir_index_offsets[1]][d] + - + coords[i + self.settings.dir_index_offsets[0]][d]) for d in range(0, 3): self.direction_vects[0][d] = coords[1][d] - coords[0][d] diff --git a/moltemplate/interpolate_curve.py b/moltemplate/interpolate_curve.py index 4324300f..582e0730 100755 --- a/moltemplate/interpolate_curve.py +++ b/moltemplate/interpolate_curve.py @@ -6,8 +6,8 @@ # All rights reserved. g_program_name = __file__.split('/')[-1] # = 'interpolate_curve.py' -g_version_str = '0.3.0' -g_date_str = '2019-12-12' +g_version_str = '0.3.1' +g_date_str = '2020-4-11' g_usage_str = """ Usage: @@ -355,13 +355,13 @@ def main(): if (i_new < n_new-1): for d in range(0, g_dim): - x_new[i_new][d] = scale*(x_orig[i_orig][d] - + - i_remainder*(x_orig[i_orig+1][d]- - x_orig[i_orig][d])) + x_new[i_new][d] = (x_orig[i_orig][d] + + + i_remainder*(x_orig[i_orig+1][d]- + x_orig[i_orig][d])) else: for d in range(0, g_dim): - x_new[i_new][d] = scale*x_orig[n_orig-1][d] + x_new[i_new][d] = x_orig[n_orig-1][d] else: x_new = ResampleCurve(x_orig, n_new, spline_exponent_alpha) diff --git a/moltemplate/scripts/moltemplate.sh b/moltemplate/scripts/moltemplate.sh index fe810599..b7b22598 100755 --- a/moltemplate/scripts/moltemplate.sh +++ b/moltemplate/scripts/moltemplate.sh @@ -6,8 +6,8 @@ # Copyright (c) 2013 G_PROGRAM_NAME="moltemplate.sh" -G_VERSION="2.17.3" -G_DATE="2020-4-07" +G_VERSION="2.17.4" +G_DATE="2020-4-11" echo "${G_PROGRAM_NAME} v${G_VERSION} ${G_DATE}" >&2 echo "" >&2 diff --git a/setup.py b/setup.py index 0482c917..4e981cec 100644 --- a/setup.py +++ b/setup.py @@ -45,9 +45,9 @@ url='https://github.com/jewettaij/moltemplate', - download_url='https://github.com/jewettaij/moltemplate/archive/v2.17.3.zip', + download_url='https://github.com/jewettaij/moltemplate/archive/v2.17.4.zip', - version='2.17.3', + version='2.17.4', keywords=['simulation', 'LAMMPS', 'molecule editor', 'molecule builder', 'ESPResSo'],