moltemplate bugfix update

This commit is contained in:
Axel Kohlmeyer 2017-08-24 07:12:45 -04:00
parent dea92fbf52
commit de0fdbed6c
2 changed files with 22 additions and 11 deletions

View File

@ -23,7 +23,15 @@ def main():
section_name = ''
if len(sys.argv) == 3:
section_name = sys.argv[1]
module_name = sys.argv[2].rstrip('.py')
bond_pattern_module_name = sys.argv[2]
# If the file name ends in ".py", then strip off this suffix.
# The next line does not work. Too lazy do care why.
# bond_pattern_module_name=bond_pattern_module_name.rstrip('.py')
# Do this instead
pc = bond_pattern_module_name.rfind('.py')
if pc != -1:
bond_pattern_module_name = bond_pattern_module_name[0:pc]
else:
sys.stderr.write('Usage Example:\n\n'
' ' + g_program_name + ' Angles nbody_angles.py < angles.txt > new_angles.txt\n\n'
@ -41,8 +49,9 @@ def main():
# Load that now.
# search locations
package_opts = [[module_name, __package__],
['nbody_alt_symmetry.'+module_name, __package__]]
package_opts = [[bond_pattern_module_name, __package__],
['nbody_alt_symmetry.'+bond_pattern_module_name,
__package__]]
if __package__:
for i, _ in enumerate(package_opts):
@ -59,7 +68,7 @@ def main():
if g is None:
sys.stderr.write('Error: Unable to locate file \"' +
module_name + '\"\n'
bond_pattern_module_name + '\"\n'
' (Did you mispell the file name?\n'
' Check the \"nbody_alternate_symmetry/\" directory.)\n')
sys.exit(-1)

View File

@ -14,9 +14,13 @@ setup(
url='https://github.com/jewettaij/moltemplate',
download_url='https://github.com/jewettaij/moltemplate/tarball/v2.2.1',
download_url='https://github.com/jewettaij/moltemplate/archive/v2.3.7.zip',
keywords=['simulation', 'LAMMPS', 'molecule', 'builder', 'ESPResSo'],
version='2.3.7',
keywords=['simulation', 'LAMMPS', 'molecule editor', 'molecule builder',
'ESPResSo'],
# BSD 3-Clause License:
# - http://choosealicense.com/licenses/bsd-3-clause
@ -28,8 +32,7 @@ setup(
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX :: Linux',
'Operating System :: Microsoft :: Windows'
],
'Operating System :: Microsoft :: Windows'],
scripts=['moltemplate/scripts/moltemplate.sh',
'moltemplate/scripts/cleanup_moltemplate.sh',
@ -58,13 +61,12 @@ setup(
'raw2data.py=moltemplate.raw2data:main',
'remove_duplicate_atoms.py=moltemplate.remove_duplicate_atoms:main',
'remove_duplicates_nbody.py=moltemplate.remove_duplicates_nbody:main',
'renumber_DATA_first_column.py=moltemplate.renumber_DATA_first_column:main',
'tinkerparm2lt.py=moltemplate.tinkerparm2lt.py']},
'renumber_DATA_first_column.py=moltemplate.renumber_DATA_first_column:main']},
package_data={'moltemplate': ['force_fields/*.lt']},
# install_requires=['numpy', 'scipy', 'biopython'],
setup_requires=['pytest-runner'],
tests_require=['pytest', 'pandas'],
tests_require=['pytest'],
zip_safe=True,
include_package_data=True
)