Skip to content

Commit

Permalink
Merge pull request #10 from chrisjsewell/add-pypi-build
Browse files Browse the repository at this point in the history
Improve `structure_generate`
  • Loading branch information
abelcarreras authored Jun 26, 2019
2 parents 43f42d7 + e0d98fa commit 8660201
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 231 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
*.swp
~*
*~
build/
dist/
.project
*.egg*
.DS_Store
Expand Down
13 changes: 12 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ matrix:
- python: 3.6
env: TEST_TYPE="version"
- python: 3.6
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="django"
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="django" PYPI_DEPLOY=true
- python: 2.7
env: TEST_TYPE="pytest" TEST_AIIDA_BACKEND="django"
- python: 3.6
Expand Down Expand Up @@ -81,3 +81,14 @@ script:
# after_success:
# - coveralls

deploy:
- provider: pypi
distributions: "sdist bdist_wheel"
user: cjsewell
password:
secure: Jrqfy5jCez0BKUi5dBi+pXxRBlmF24T53ZL6FumhKOTXgsjk8hp723GGJ4iJwdmnDBPQX029cJ0ebwZrNjTCI538TNDQaT+f2B7pUp0HG5qreWhbYQaMEU20wPvvyIbiI3Wei87PvouV2OHLelWj9/Q8Gy7GHQr1+66g/H83E27WgG56Qer3HcGCcUHZ03iByq640eF1ipqMs276pI9/tzeiCPqnOo5tlB2Nb+5McKtMoBnB8zn8930FxkYY3BijZWTN2fiEMx9ezDQDutGiZ6HU9c8ZJhw4A0pAETVIbdZAWcHyqnAknruX3q4eb8JKzKCEMBSiH4YS/0Sl5In4jTkrhTCiWLr5ViNDor9P+XNW6pgNS1BSdePj+gQ+E1v/+DMgnHJ4pcch2aILYAvF7R8txxEc+5xVtalGK0KjNXs+2eK/57Fqpozy2SnqfqlV1DeS+fo+/LAvyl0p7Gxt/mJCQgpHZOrcEsfW0PC2WsVmn0E5n7HAivTd3tqeY8z97KtQHiKGNa0SMzUvO7Gt9AxXtXG1sdQBJgdCO9iYpsk37WIlCsmzJM+w9cxbU69/QkKLPvr+PSxy6A3FeWKKonJ6uSlALl6rljOqutDlAKjIrsfSlykm9UPBS6yy2Ist2YJF6YRmeiaEA+3MGArZONaEmxOiau06BmtzFSMf7CM=
on:
branch: master
tags: true
condition: $PYPI_DEPLOY = true
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[![Build Status](https://travis-ci.org/abelcarreras/aiida-lammps.svg?branch=master)](https://travis-ci.org/abelcarreras/aiida-lammps)
[![PyPI](https://img.shields.io/pypi/v/aiida-lammps.svg)](https://pypi.python.org/pypi/aiida-lammps/)

# AiiDA LAMMPS plugin

Expand All @@ -14,6 +15,7 @@ Note: `lammps.combinate` requires `aiida-phonopy` (https://github.com/abelcarrer
plugin to work, DynaPhoPy can be found in: https://github.com/abelcarreras/aiida-phonopy

- [AiiDA LAMMPS plugin](#AiiDA-LAMMPS-plugin)
- [Installation](#Installation)
- [Built-in Potential Support](#Built-in-Potential-Support)
- [Examples](#Examples)
- [Code Setup](#Code-Setup)
Expand All @@ -23,6 +25,14 @@ plugin to work, DynaPhoPy can be found in: https://github.com/abelcarreras/aiida
- [Optimisation Calculation](#Optimisation-Calculation)
- [MD Calculation](#MD-Calculation)

## Installation

To install from pypi:

```shell
pip install aiida-lammps
```

## Built-in Potential Support

- EAM
Expand Down
2 changes: 1 addition & 1 deletion aiida_lammps/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0b3"
__version__ = "0.4.1b3"
15 changes: 11 additions & 4 deletions aiida_lammps/calculations/lammps/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class BaseLammpsCalculation(CalcJob):
_DEFAULT_OUTPUT_INFO_FILE_NAME = "system_info.dump"
_DEFAULT_OUTPUT_RESTART_FILE_NAME = 'lammps.restart'

_retrieve_list = ['log.lammps']
_retrieve_list = []
_retrieve_temporary_list = []
_cmdline_params = ['-in', _INPUT_FILE_NAME]
_stdout_name = None
Expand All @@ -123,6 +123,8 @@ def define(cls, spec):
help='lammps potential')
spec.input('parameters', valid_type=Dict,
help='the parameters', required=False)
spec.input('metadata.options.cell_transform_filename',
valid_type=six.string_types, default="cell_transform.npy")
spec.input('metadata.options.output_filename',
valid_type=six.string_types, default=cls._DEFAULT_OUTPUT_FILE_NAME)
spec.input('metadata.options.trajectory_name',
Expand Down Expand Up @@ -199,8 +201,11 @@ def prepare_for_submission(self, tempfolder):
potential_txt = self.inputs.potential.get_potential_file()

# Setup structure
structure_txt = generate_lammps_structure(self.inputs.structure,
self.inputs.potential.atom_style)
structure_txt, struct_transform = generate_lammps_structure(
self.inputs.structure, self.inputs.potential.atom_style)

with open(tempfolder.get_abs_path(self.options.cell_transform_filename), 'w+b') as handle:
np.save(handle, struct_transform)

if "parameters" in self.inputs:
parameters = self.inputs.parameters
Expand Down Expand Up @@ -255,7 +260,9 @@ def prepare_for_submission(self, tempfolder):

calcinfo = CalcInfo()
calcinfo.uuid = self.uuid
calcinfo.retrieve_list = self._retrieve_list
calcinfo.retrieve_list = self._retrieve_list + [
self.options.output_filename,
self.options.cell_transform_filename]
calcinfo.retrieve_temporary_list = self._retrieve_temporary_list
calcinfo.codes_info = [codeinfo]

Expand Down
Loading

0 comments on commit 8660201

Please sign in to comment.