Skip to content

Commit

Permalink
Port to SimPhoNy v4
Browse files Browse the repository at this point in the history
* Rename SimLammps to SimLAMMPS.

* Upgrade wrapper logic to the SimPhoNy v4 API.

* Update examples to the SimPhoNy v4 API.

* Port the SimLAMMPS ontology to OWL, as SimPhoNy v4 dropped support for YAML ontologies.

* Change directory structure.

* Update `README.md`. Update copyright year, change contact point to SimPhoNy mailing list, remove compatibility table (this information is on `setup.py`), change installation section, change docker section, remove directory structure section.

* Update LICENSE (changed to GPLv2).

* Rename package to `simphony-osp-simlammps`. Add classifiers and additional fields in `setup.py`. Do not use `packageinfo.py`, which has been deleted. Update entry points in `setup.py`.

* Add @pablo-de-andres and @kysrpex as CODEOWNERS.

* Use `pre-commit in the repository`.

* Remove `gitlab-ci.yml`.

* Add GitHub CI, including tests with tox for Python 3.7-3.10.

* Update dockerfile, change maintainer to `simphony@fraunhofer.iwm.de`. Delete `Dockerfile copy`.

* Revision of wrapper files: change mentions of "CUDS" to "ontology individual" or similar terms. Add type hints to most functions. Remove type hints from the docstrings.

* Removed copyright notice on `utils.py` as it is already on the `README.md`, and will be in the license file once one is provided.

* Add a consistency check on `commit` before modifying the LAMMPS data structures, to avoid leaving them on an inconsistent state if the commit fails or if the user sets a state that leads to inconsistencies.

* Change domain simphony-project.eu to simphony-osp.eu.
  • Loading branch information
kysrpex committed Sep 16, 2022
1 parent bf1503c commit 50072b9
Show file tree
Hide file tree
Showing 31 changed files with 1,978 additions and 1,428 deletions.
4 changes: 4 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# follows the same pattern as .gitignore files
# file/mask username1/email1 ... usernameN/emailN

* @pablo-de-andres @kysrpex
41 changes: 41 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on: pull_request

jobs:
PEP8:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3

- name: Flake8
run: flake8 . --ignore=E203,W503 --docstring-convention=google

# Includes isort, black and other checks, see `.pre-commit.config.yaml`.
- name: pre-commit
run: pre-commit run --all-files

complexity:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3

- name: Radon
run: |
radon cc -s -a .,
radon mi -s .
security:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3

- name: Bandit
run: bandit -r osp --skip B101

testing:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: tox
run: tox
31 changes: 0 additions & 31 deletions .gitlab-ci.yml

This file was deleted.

53 changes: 26 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,30 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
hooks:
- id: check-json
- id: check-yaml
- id: pretty-format-json
args:
- --autofix
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: check-json
- id: check-yaml
- id: pretty-format-json
args:
- --autofix
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 22.3.0
hooks:
- id: black
args: [--line-length, "79"]
additional_dependencies: ['click==8.0.4']

- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
additional_dependencies: ['click==8.0.4']
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [--profile, black, --filter-files]

- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: [--profile, black, --filter-files]

- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.1
hooks:
- id: pyupgrade
args: [--py37-plus]
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.9
LABEL maintainer="pablo.de.andres@fraunhofer.iwm.de"
LABEL maintainer="simphony@fraunhofer.iwm.de"

# Install requirements
RUN apt-get update && \
Expand All @@ -15,7 +15,7 @@ RUN cmake -C ../cmake/presets/basic.cmake -D BUILD_SHARED_LIBS=on -D LAMMPS_EXC
cmake --install .

# Install osp-core
RUN pip install osp-core
RUN pip install simphony-osp

# Install simlammps
WORKDIR /simphony/wrappers/simlammps
Expand Down
15 changes: 0 additions & 15 deletions Dockerfile copy

This file was deleted.

151 changes: 151 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

109 changes: 55 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,74 +1,75 @@
# Simlammps
[![pipeline status](https://gitlab.cc-asp.fraunhofer.de/simphony/wrappers/simlammps/badges/master/pipeline.svg)](https://gitlab.cc-asp.fraunhofer.de/simphony/wrappers/simlammps/commits/master)
[![coverage report](https://gitlab.cc-asp.fraunhofer.de/simphony/wrappers/simlammps/badges/master/coverage.svg)](https://gitlab.cc-asp.fraunhofer.de/simphony/wrappers/simlammps/commits/master)
# SimLAMMPS

Wrapper for LAMMPS developed by the SimPhoNy group at Fraunhofer IWM
SimLAMMPS is a SimPhoNy wrapper that enables the use of the LAMMPS molecular
dynamics simulation engine on the SimPhoNy Open Simulation Platform.

Copyright (c) 2014-2019, Adham Hashibon and Materials Informatics Team at Fraunhofer IWM.
All rights reserved.
Redistribution and use are limited to the scope agreed with the end user.
No parts of this software may be used outside of this context.
No redistribution is allowed without explicit written permission.
**Disclaimer**: We are **not** affiliated nor associated with the
[authors of LAMMPS](https://docs.lammps.org/Intro_authors.html).

Contact: [Pablo de Andres](mailto:pablo.de.andres@iwm.fraunhofer.de)

## Requirements
## Installation

The SimLammps wrapper is built on top of the [OSP core](https://github.com/simphony/osp-core) package.
The following table describes the version compatibility between these two packages.
This wrapper requires a working LAMMPS installation. If you are running
Ubuntu or CentOS, you are lucky, as we have prepared a
script that can install it for you.
```
./install_engine.sh
```

|__SimLammps__|__OSP core__|
|:-----------:|:----------:|
| 3.4.x | 3.5.x-beta |
| 3.3.x | 3.3.4-beta |
| 3.2.x | 3.3.0-beta |
| 3.1.x | 3.2.x-beta |
| 3.0.x | 3.1.x-beta |
| 2.0.0 | 2.0.x |
| 0.0.1 | 1.x.x |
If you are running a different distribution or operating system, you will
have to install it yourself. Please make sure that LAMMPS is installed before
proceeding.

The releases of OSP core are available [here](https://github.com/simphony/osp-core/releases).
The next step is to install the wrapper itself. SimLAMMPS is available on PyPI,
so it can be installed using the
[`pip` package manager](https://pip.pypa.io/en/stable/), you can do so by
running:

## Installation
If LAMMPS is not installed in the system, you can install it by running in your console:
```
./install_engine
```shell
pip install simphony-osp-simlammps
```

If osp-core is not in the system, install it before:
```
pip install git+https://github.com/simphony/osp-core.git
```
Finally, the wrapper requires a specific ontology to operate. Download the
[ontology file](https://github.com/simphony/simlammps/blob/v4.0.0/simphony_osp_simlammps/simlammps.ttl)
and
[ontology package](https://github.com/simphony/simlammps/blob/v4.0.0/simphony_osp_simlammps/simlammps.yml),
then install the latter with the following command:

__NOTE:__ Until a proper, stable version of the ontology with all the entities is available in OSP Core, a toy ontology for temporary usage is provided.
```
# to install the simlammps ontology
pico install simlammps/simlammps.ontology.yml
pico install simlammps.yml
```

The package requires python 3 (tested for 3.7), installation is based on `setuptools`:
```
# build and install simlammps
pip install .
```
**Note:** The provided ontology is not connected to any
top-level ontology, therefore its scope is limited to this wrapper.

## Documentation
All information about SimPhoNy and its wrappers is available in the [SimPhoNy docs](https://simphony.readthedocs.io)
### Docker

The LAMMPS engine documentation can be visited [here](https://lammps.sandia.gov/).

## Directory structure
- osp/wrappers/simlammps -- simlammps wrapper files.
- tests -- unittesting of the code.
- examples -- examples of usage.

## Docker
We have prepared a Dockerfile with all the necessary requirements.
Since osp-core is not public yet, a username and password are necessary to clone it.
This is all simplified via a script called `docker_install.sh`
Alternatively, you can run the wrapper from a Docker image. We have
prepared a Dockerfile with all the necessary requirements.
```shell
# Build it
docker build -t simphony/simlammps .
# Run it (console entypoint)
# Run it (console entrypoint)
docker run -ti --rm --entrypoint=/bin/bash simphony/simlammps
```


## Documentation

All information about SimPhoNy is available on the
[SimPhoNy documentation](https://simphony.readthedocs.io/en/v4.0.0rc3). Check out the
[examples folder](https://github.com/simphony/simlammps/blob/v4.0.0/examples)
for examples on how to use SimLAMMPS itself.

The LAMMPS engine documentation is available [here](https://lammps.sandia.gov/).

## License

Copyright (c) 2014-2022, Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. acting on behalf of its Fraunhofer IWM.

SimLAMMPS is distributed under the terms of the
[GNU Public License Version 2](https://github.com/simphony/simlammps/blob/v4.0.0/LICENSE)
as required
[by the license terms of LAMMPS itself](https://docs.lammps.org/Intro_opensource.html).

Contact: [SimPhoNy](mailto:simphony@iwm.fraunhofer.de)
Empty file removed examples/__init__.py
Empty file.

0 comments on commit 50072b9

Please sign in to comment.