Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre commit #221

Merged
merged 12 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ comment:
behavior: default
flags: null
paths: null

ignore:
- "pygromos/data/" # ignore folders and all its contents
- "pygromos/tests/" # ignore test files
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to contribute

We welcome contributions from external contributors, and this document
describes how to merge code changes into this pygromos.
describes how to merge code changes into this pygromos.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Notable points that this PR has either accomplished or will accomplish.
- [ ] Question1

## Status
- [ ] Ready to go
- [ ] Ready to go
9 changes: 4 additions & 5 deletions .github/workflows/CI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ jobs:
python-version: ${{ matrix.python-version }}
environment-file: dev/conda_envs/test_env.yaml
channels: conda-forge,defaults
activate-environment: test

activate-environment: pygromosTest
auto-update-conda: true
auto-activate-base: false
show-channel-urls: true
Expand All @@ -63,12 +63,11 @@ jobs:
shell: bash -l {0}

run: |
pytest -v --color=yes pygromos/tests/ --cov=pygromos --cov-report=xml
pytest -v --color=yes pygromos/tests/ --cov=pygromos --cov-report=xml

- name: CodeCov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}

14 changes: 14 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: pre-commit

on:
pull_request:
push:
branches: [main, release3, PyGromosTools_V1]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
- uses: pre-commit/[email protected]
66 changes: 66 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files

- repo: https://github.com/psf/black
rev: 22.1.0
hooks:
- id: black
name: Fixes formatting
language_version: python3
args: ["--line-length=120"]


# - repo: https://gitlab.com/pycqa/flake8
# rev: 3.8.4
# hooks:
# - id: flake8
# name: Checks pep8 style
# args: [
# "--max-line-length=120",
# # Ignore imports in init files
# "--per-file-ignores=*/__init__.py:F401,setup.py:E121",
# # ignore long comments (E501), as long lines are formatted by black
# # ignore Whitespace before ':' (E203)
# # ignore Line break occurred before a binary operator (W503)
# "--ignore=E501,E203,W503",
# # needed to not remove * imports (for example in _all_blocks.py)
# "--ignore=F405",
# ]

# - repo: local
# hooks:

# - id: jupyisort
# name: Sorts ipynb imports
# entry: jupytext --pipe-fmt ".py" --pipe "isort - --multi-line=3 --trailing-comma --force-grid-wrap=0 --use-parentheses --line-width=99" --sync
# files: \.ipynb$
# language: python

# - id: jupyblack
# name: Fixes ipynb format
# entry: jupytext --pipe-fmt ".py" --pipe "black - --line-length=120" --sync
# files: \.ipynb$
# language: python

# - id: nbconvert
# name: Removes ipynb content
# entry: jupyter nbconvert
# args:
# [
# "--ClearOutputPreprocessor.enabled=True",
# "--ClearMetadataPreprocessor.enabled=True",
# "--RegexRemovePreprocessor.enabled=True",
# "--to=notebook",
# "--log-level=ERROR",
# "--inplace",
# ]
# files: \.ipynb$
# language: python
2 changes: 1 addition & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Make sure to have the following packages installed:

```bash
#with pip installer:
pip install <package_name>
pip install <package_name>
#or if you use conda:
conda install <package_name>
```
Expand Down
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ include MANIFEST.in
include versioneer.py

graft pygromos
global-exclude *.py[cod] __pycache__ *.so
global-exclude *.py[cod] __pycache__ *.so
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ Content
# Build gromos System:
grom_system = Gromos_System(in_cnf_path=cnf_path, in_top_path=top_path,
system_name=sys_name, work_folder=root_in_dir)

# Run Emin
emin_gromos_system, jobID = emin(in_gromos_system=grom_system, project_dir=root_dir,
step_name=step_name, submission_system=subSystem())

```

Run on LSF-Cluster:
Expand All @@ -133,12 +133,12 @@ Content
# Build gromos System:
grom_system = Gromos_System(in_cnf_path=cnf_path, in_top_path=top_path,
system_name=sys_name, work_folder=root_in_dir)

# Run Emin
sub_system = subSystem(nmpi=4) # allows parallelization
emin_gromos_system, jobID = emin(in_gromos_system=grom_system, project_dir=root_dir,
step_name=step_name, submission_system=sub_system)

```

* Other utilities:
Expand All @@ -164,7 +164,6 @@ see INSTALL.md file for more informations
Copyright (c) 2020, Benjamin Ries, Marc Lehner, Salome Rieder

### Acknowledgements

Project based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.3.

Project based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.3.
30 changes: 30 additions & 0 deletions conda_env.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: pygromos
channels:
- conda-forge
- defaults
dependencies:
# Base depends
- python
- pip
## Testing
- pytest
## Meta
- typing
- pre-commit
- jupyter
- tqdm
- ipywidgets
# Science
- mpmath
- pandas
- pytables
- numpy
- sympy
- scipy
## Chemie
- openff-toolkit = 0.10.0
- mdtraj
- rdkit
## Visualization
- matplotlib
- nglview
23 changes: 15 additions & 8 deletions dev/conda_envs/dev_env.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,36 @@
name: pygromosDev
channels:
- rdkit
- conda-forge
- defaults
dependencies:
# Base depends
- python
- pip
# Testing
## Testing
- pytest
- pytest-cov
- codecov
#meta
## Meta
- typing
- pre-commit
- jupyter
- tqdm
- ipywidgets
#science
- openff-toolkit
## Documentation
- sphinx
- m2r
- nbsphinx
# Science
- mpmath
- pandas
- pytables
- numpy
- sympy
- scipy
## Chemie
- openff-toolkit = 0.10.0
- mdtraj
- rdkit
- mpmath
##Visualization
## Visualization
- matplotlib
- py3dmol
- nglview
26 changes: 12 additions & 14 deletions dev/conda_envs/test_env.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
name: test
name: pygromosTest
channels:
- rdkit
- conda-forge
- defaults
dependencies:
# Base depends
- python
- pip
# Testing
## Testing
- pytest
- pytest-cov
- codecov
#meta
## Meta
- typing
- tqdm
- ipywidgets
#science
- openff-toolkit = 0.10.0
- pre-commit
# Science
- mpmath
- pandas
- pytables
- numpy
- sympy
- scipy
## Chemie
- openff-toolkit = 0.10.0
- mdtraj
- rdkit
- mpmath
##Visualization
## Visualization
- matplotlib
- py3dmol



- py3dmol #to be removed! soon after merge of new visualize
- nglview
1 change: 0 additions & 1 deletion docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@

Loading