Skip to content

Commit

Permalink
Merge pull request #86 from RMeli/develop
Browse files Browse the repository at this point in the history
Version 0.6.0
  • Loading branch information
RMeli authored Sep 8, 2023
2 parents c20ace5 + b5532dd commit 32118ba
Show file tree
Hide file tree
Showing 56 changed files with 1,796 additions and 1,224 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ comment:
branches: null
behavior: default
flags: null
paths: null
paths: null
5 changes: 1 addition & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[run]
source = spyrmsd
omit =
omit =
spyrmsd/_version.py
spyrmsd/due.py

Expand All @@ -13,6 +13,3 @@ exclude_lines =
# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:

# OpenBabel2
except ImportError:
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spyrmsd/_version.py export-subst
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 `spyrmsd`.
describes how to merge code changes into `spyrmsd`.

## Getting Started

Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ A clear and concise description of what you expected to happen.
**Environment**
- OS:
- Python:
- Package Manager [e.g. `pip`, `conda`]:
- Package Manager [e.g. `pip`, `conda`]:

**Additional Context**
<!--
Expand Down
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/empty-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ labels: ''
assignees: ''

---


8 changes: 4 additions & 4 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand All @@ -28,6 +28,6 @@ jobs:
- name: Install package
run: |
python setup.py develop --no-deps
- name: Lint with flake8
- name: Lint with flake8
run: |
flake8 . --count --show-source --statistics
flake8 . --count --show-source --statistics
6 changes: 3 additions & 3 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:

strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
Expand All @@ -33,4 +33,4 @@ jobs:
python setup.py develop --no-deps
- name: Lint with mypy
run: |
mypy
mypy
24 changes: 24 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: pre-commit

on:
push:
branches: [ master, develop ]
pull_request:
branches: [ master, develop ]

jobs:
main:
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
4 changes: 2 additions & 2 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ jobs:
strategy:
matrix:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: [3.7, 3.8, 3.9]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
chemlib: [obabel, rdkit]
graphlib: [nx, gt]
# graph-tools does not work on Windows
exclude:
# graph-tools does not work on Windows
- {os: "windows-latest", graphlib: "gt"}
# FIXME: Keeps failing in CI for unknown reasons during miniconda setup
- {os: "ubuntu-latest", graphlib: "gt", chemlib: "rdkit", python-version: "3.7"}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3

- name: Info
shell: bash
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
pytest -v --benchmark --cov=spyrmsd --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v1
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
flags: unittests
Expand Down
15 changes: 10 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
exclude: |
(?x)^(
docs/source/conf.py
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.0.1
rev: v4.4.0
hooks:
- id: check-json
- id: check-merge-conflict
Expand All @@ -10,18 +14,19 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 21.7b0
rev: 23.7.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 3.9.2
rev: 6.1.0
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.9.3
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.910
rev: v1.5.1
hooks:
- id: mypy
additional_dependencies: [types-requests]
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ formats:
- pdf

conda:
environment: devtools/conda-envs/spyrmsd-docs.yaml
environment: devtools/conda-envs/spyrmsd-docs.yaml
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,39 @@

------------------------------------------------------------------------------

## Version 0.6.0

Date: 08/09/2023
Contributors: @RMeli

### Improved

* Documentation on loading RDKit and Open Babel molecules [PR #77 | @RMeli]

### Changed

* Versions of `pre-commit` hooks tools [PR #85 | @RMeli]
* Version of several GitHub actions [PR #76 | @RMeli]
* Versioneer to `0.28` [PR #76 | @RMeli]
* Minimum Python version to `3.7` to match CI [PR #76 | @RMeli]
* Code according to `black==23.3.0` [PR #76 | @RMeli]

### Added

* `pre-commit` CI action [PR #85 | @RMeli]
* `extras_require` to `setup.py` for RDKit and Open Babel [PR #84 | @RMeli]
* Error message when `spyrmsd` is used as module but neither OpenBabel nor RDKit are installed [PR #81 | @RMeli]
* Pin to `sphinx<7` to avoid compatibility with RTD theme [PR #77 | @RMeli]

### Removed

* `ubuntu-latest-3.7-rdkit-gt` configuration from CI due to continuous failures [PR #84 | @RMeli]
* Outdated information about RDKit from the documentation [PR #84 | @RMeli]
* Support for Open Babel 2 [PR #84 | @RMeli]
* LGTM badge and code annotations [PR #76 | @RMeli]

------------------------------------------------------------------------------

## Version 0.5.2

Date: 23/02/2022
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Rocco"
orcid: "https://orcid.org/0000-0002-2845-3410"
title: "spyrmsd"
version: 0.5.1
version: 0.6.0
doi: 10.5281/zenodo.3631876
date-released: 2021-06-21
url: "https://github.com/RMeli/spyrmsd"
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 spyrmsd
global-exclude *.py[cod] __pycache__ *.so
global-exclude *.py[cod] __pycache__ *.so
20 changes: 12 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
![flake8](https://github.com/RMeli/spyrmsd/workflows/flake8/badge.svg)
![mypy](https://github.com/RMeli/spyrmsd/workflows/mypy/badge.svg)
[![codecov](https://codecov.io/gh/RMeli/spyrmsd/branch/develop/graph/badge.svg)](https://codecov.io/gh/RMeli/spyrmsd/branch/master)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/RMeli/spyrmsd.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/RMeli/spyrmsd/context:python)

[![Docs](https://img.shields.io/badge/docs-spyrmsd.readthedocs.io-blueviolet)](https://spyrmsd.readthedocs.io)
[![Documentation Status](https://readthedocs.org/projects/spyrmsd/badge/?version=develop)](https://spyrmsd.readthedocs.io/en/develop/?badge=develop)

[![License](https://img.shields.io/github/license/RMeli/pyrmsd?color=%2333BBFF)](https://opensource.org/licenses/MIT)
[![PyPI](https://img.shields.io/badge/PyPI-v0.5.2%20-ff69b4)](https://pypi.org/project/spyrmsd/)
[![PyPI](https://img.shields.io/badge/PyPI-v0.6.0%20-ff69b4)](https://pypi.org/project/spyrmsd/)
[![Conda Version](https://img.shields.io/conda/vn/conda-forge/spyrmsd.svg)](https://anaconda.org/conda-forge/spyrmsd)

[![J. Cheminform.](https://img.shields.io/badge/J.%20Cheminform.-10.1186%2Fs13321--020--00455--2-blue)](https://doi.org/10.1186/s13321-020-00455-2)
Expand Down Expand Up @@ -38,7 +37,11 @@ If you find `spyrmsd` useful, please consider citing the following paper:

`spyrmsd` is available on [PyPI](https://pypi.org/project/spyrmsd/) and [conda-forge](https://github.com/conda-forge/spyrmsd-feedstock) and can be easily installed from source. See [Dependencies](###Dependencies) for a description of all the dependencies.

_Note_: `spyrmsd` will install [NetworkX](https://networkx.github.io/) (multi-platform). You can install [graph-tool](https://graph-tool.skewed.de/) on macOS and Linux for higher performance.
> [!NOTE]
> `spyrmsd` will install [NetworkX](https://networkx.github.io/) (multi-platform). You can install [graph-tool](https://graph-tool.skewed.de/) on macOS and Linux for higher performance.
> [!WARNING]
> If `spyrmsd` is used as a standalone tool, it is required to install either [RDKit](https://rdkit.org/) or [Open Babel](http://openbabel.org/). Neither is automatically installed with `pip` nor `conda`.
### PyPI

Expand Down Expand Up @@ -72,7 +75,8 @@ The following packages are required to use `spyrmsd` as a module:
* [numpy](https://numpy.org/)
* [scipy](https://www.scipy.org/)

_Note_: `spyrmsd` uses [graph-tool](https://graph-tool.skewed.de/) by default but will fall back to [NetworkX](https://networkx.github.io/) if the former is not installed (e.g. on Windows). However, in order to support cross-platform installation [NetworkX](https://networkx.github.io/) is installed by default, and [graph-tool](https://graph-tool.skewed.de/) needs to be installed manually.
> [!NOTE]
> `spyrmsd` uses [graph-tool](https://graph-tool.skewed.de/) by default but will fall back to [NetworkX](https://networkx.github.io/) if the former is not installed (e.g. on Windows). However, in order to support cross-platform installation [NetworkX](https://networkx.github.io/) is installed by default, and [graph-tool](https://graph-tool.skewed.de/) needs to be installed manually.
#### Standalone Tool

Expand All @@ -81,8 +85,6 @@ Additionally, one of the following packages is required to use `spyrmsd` as a st
* [Open Babel](http://openbabel.org/)
* [RDKit](https://rdkit.org/)

_Note_: [RDKit](https://rdkit.org/) is not available on PyPI ([Why the RDKit isn't available on PyPi](https://rdkit.blogspot.com/2019/11/why-rdkit-isnt-available-on-pypi.html)). See [RDKit Installation](http://www.rdkit.org/docs/Install.html) for installation instructions.

## Usage

### Standalone Tool
Expand Down Expand Up @@ -130,7 +132,8 @@ def rmsd(
)
```

Note: atomic properties (`aprops`) can be any Python object when using [NetworkX](https://networkx.github.io/), or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).
> [!NOTE]
> Atomic properties (`aprops`) can be any Python object when using [NetworkX](https://networkx.github.io/), or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).
#### Symmetry-Corrected RMSD

Expand All @@ -153,7 +156,8 @@ def symmrmsd(
)
```

Note: atomic properties (`aprops`) can be any Python object when using [NetworkX](https://networkx.github.io/), or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).
> [!NOTE]
> Atomic properties (`aprops`) can be any Python object when using [NetworkX](https://networkx.github.io/), or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).
## Development

Expand Down
2 changes: 1 addition & 1 deletion credits.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ python -m duecredit test_import.py

printf "\n\nBIBTEX\n------\n\n"

duecredit summary --format bibtex
duecredit summary --format bibtex
2 changes: 1 addition & 1 deletion devtools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Conda is the recommended package manager for this project.

* `conda-envs`: directory containing the YAML file(s) which fully describe Conda environments
* `spyrmsd.yaml`: Full Conda environment for `spyrmsd`.

Channels are usually not specified here and therefore respect global Conda configuration.

## Deployment
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/spyrmsd-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ dependencies:
- codecov

# Doc
- sphinx
- sphinx<7
- sphinx_rtd_theme
- pip:
- duecredit
Expand Down
2 changes: 1 addition & 1 deletion devtools/conda-envs/spyrmsd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ dependencies:
- rdkit

# Doc
- sphinx
- sphinx<7
- sphinx_rtd_theme
13 changes: 11 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The docs for this project are built with [Sphinx](http://www.sphinx-doc.org/en/m

## Installation

Ensure that Sphinx and the ReadTheDocs theme are installed:
Ensure that Sphinx and the [Read the Docs](https://sphinx-rtd-theme.readthedocs.io/en/stable/index.html) theme are installed:

```bash
conda install sphinx sphinx_rtd_theme
Expand All @@ -20,6 +20,15 @@ Create API documentation automatically with `sphinx-apidoc`:
sphinx-apidoc -f -M -e -T -o source/api ../spyrmsd
```

### Convert Tutorial Jupyter Notebooks to HTML

Jupyter Notebooks need to be converted to HTML:

```bash
pip install pandoc
jupyter nbconvert --to rst tutorial.ipynb
```

### Build Documentation

Use the `Makefile` to compile static HTML pages:
Expand All @@ -30,4 +39,4 @@ make html

### Visualize Documentation

The compiled docs will be in the `build` directory and can be viewed by opening `index.html` (which may itself be inside a directory called `html/` depending on what version of Sphinx is installed).
The compiled docs will be in the `build` directory and can be viewed by opening `index.html` (which may itself be inside a directory called `html/` depending on what version of Sphinx is installed).
2 changes: 1 addition & 1 deletion docs/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ API
:maxdepth: 2
:caption: Contents:

api/spyrmsd
api/spyrmsd
Loading

0 comments on commit 32118ba

Please sign in to comment.