Skip to content

Commit

Permalink
Merge branch 'RMeli:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli authored Apr 8, 2024
2 parents f2f9298 + 62c5df3 commit db10965
Show file tree
Hide file tree
Showing 30 changed files with 1,166 additions and 423 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,16 @@ jobs:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
chemlib: [obabel, rdkit]
graphlib: [nx, gt]
graphlib: [nogt, all]
exclude:
# graph-tools does not work on Windows
- {os: "windows-latest", graphlib: "gt"}
# graph-tool does not work on Windows
- {os: "windows-latest", graphlib: "all"}
# Don't run without graph-tool on Ubuntu and macOS
- {os: "ubuntu-latest", graphlib: "nogt"}
- {os: "macOS-latest", graphlib: "nogt"}
include:
- {os: "macOS-14", graphlib: "gt", chemlib: "obabel", python-version: "3.12"}
- {os: "macOS-14", graphlib: "nx", chemlib: "rdkit", python-version: "3.12"}
- {os: "macOS-14", graphlib: "all", chemlib: "obabel", python-version: "3.12"}
- {os: "macOS-14", graphlib: "all", chemlib: "rdkit", python-version: "3.12"}

steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ repos:
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
hooks:
Expand Down
10 changes: 7 additions & 3 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
# .readthedocs.yml
# Read the Docs configuration file
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

version: 2

build:
os: ubuntu-22.04
tools:
python: "mambaforge-22.9"

sphinx:
builder: html
configuration: docs/source/conf.py

formats:
- epub
- pdf
- epub

conda:
environment: devtools/conda-envs/spyrmsd-docs.yaml
41 changes: 34 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,53 @@
## Version X.Y.Z

Date: XX/YY/ZZZZ
Contributors: @RMeli, @takluyver
Contributors: @RMeli

### Fixed
### Added

* Failing tests with `pytest=8.0.0` [PR #101 | @RMeli]
* Warnings filter for tests of multiple backends [PR #118 | @RMeli]
* Parametrized fixture to run tests with all available backends [PR #118 | @RMeli]

### Improved

* Test IDs [PR #117 | @RMeli]

### Changed

* Updated Python build system to use flit_core directly [PR #103 | @takluyver]
* Minimum version of Python to `3.9` (to reduce CI matrix) [PR #102 | @RMeli]
* Location of backend tests to standalone file [PR #118 | @RMeli]

### Improved
### Removed

* Messages for `NotImplementedError` exceptions [PR #90 | @RMeli]
* Many CI configurations in favour of running tests for all available backends [PR #118 | @RMeli]
* `tests/molecule.py` in favour of fixtures [PR #118 | @RMeli]

## Version 0.7.0

Date: 05/04/2024
Contributors: @RMeli, @takluyver, @Jnelen

### Added

* Support for `rustworkx` graph library [PR #111 | @RMeli]
* Functionality to manually select the backend from CLI [PR #108 | @RMeli]
* Functionality to manually select the backend [PR #107 | @Jnelen]
* Python `3.12` to CI [PR #102 | @RMeli]
* macOS M1 (`macoOS-14`) to CI [PR #102 | @RMeli]

### Changed

* Molecular graphs cache to cache by backend [PR #107 | @Jnelen]
* Python build system to use `flit_core` directly [PR #103 | @takluyver]
* Minimum version of Python to `3.9` (to reduce CI matrix) [PR #102 | @RMeli]

### Fixed

* Failing tests with `pytest=8.0.0` [PR #101 | @RMeli]

### Improved

* Messages for `NotImplementedError` exceptions [PR #90 | @RMeli]

### Removed

* `.gitattributes` and `.lgtm.yaml` stale files
Expand Down
5 changes: 4 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ authors:
- family-names: "Meli"
given-names: "Rocco"
orcid: "https://orcid.org/0000-0002-2845-3410"
- family-names: "Nelen"
given-names: "Jochem"
orcid: "https://orcid.org/0000-0002-9970-4950"
title: "spyrmsd"
version: 0.6.0
version: 0.7.0
doi: 10.5281/zenodo.3631876
date-released: 2021-06-21
url: "https://github.com/RMeli/spyrmsd"
Expand Down
65 changes: 41 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![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.6.0%20-ff69b4)](https://pypi.org/project/spyrmsd/)
[![PyPI](https://img.shields.io/badge/PyPI-v0.7.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 +38,7 @@ 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.
> `spyrmsd` will install [NetworkX](https://networkx.github.io/) (multi-platform). You can install the other backends 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`.
Expand Down Expand Up @@ -71,12 +71,16 @@ pip install .

The following packages are required to use `spyrmsd` as a module:

* [graph-tool](https://graph-tool.skewed.de/) or [NetworkX](https://networkx.github.io/)
* [numpy](https://numpy.org/)
* [scipy](https://www.scipy.org/)

One of the following graph libraries is required:
* [graph-tool]
* [NetworkX]
* [rustworkx]

> [!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.
> `spyrmsd` uses the following priority when multiple graph libraries are present: [graph-tool], [NetworkX], [rustworkx]. *This order might change. Use `set_backend` to ensure you are always using the same backend, if needed.* However, in order to support cross-platform installation [NetworkX](https://networkx.github.io/) is installed by default, and the other graph library need to be installed manually.
#### Standalone Tool

Expand All @@ -89,27 +93,12 @@ Additionally, one of the following packages is required to use `spyrmsd` as a st

### Standalone Tool

`spyrmsd` provides a convenient CLI tool. See `spyrmsd`'s `--help` for the usage:

```bash
python -m spyrmsd -h
```

```text
usage: python -m spyrmsd [-h] [-m] [-c] [--hydrogens] [-n] reference molecules [molecules ...]
Symmetry-corrected RMSD calculations in Python.
positional arguments:
reference Reference file
molecules Input file(s)
optional arguments:
-h, --help show this help message and exit
-m, --minimize Minimize (fit)
-c, --center Center molecules at origin
--hydrogens Keep hydrogen atoms
-n, --nosymm No graph isomorphism
```

### Module

```python
Expand All @@ -133,7 +122,7 @@ 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/).
> Atomic properties (`aprops`) can be any Python object when using [NetworkX] and [rustworkx], or integers, floats, or strings when using [graph-tool].
#### Symmetry-Corrected RMSD

Expand All @@ -157,7 +146,31 @@ 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/).
> Atomic properties (`aprops`) can be any Python object when using [NetworkX] and [rustworkx], or integers, floats, or strings when using [graph-tool](https://graph-tool.skewed.de/).
#### Select Backend

`spyrmsd` supports the following graph libraries for the calculation of graph isomorphisms:
* [graph-tool]
* [NetworkX]
* [rustworkx]

You can check which backend is being used with

```python
spyrmsd.get_backend()
```

You can also manually select your preferred backend with

```python
spyrmsd.set_backend("networkx")
# spyrmsd uses NetworkX
spyrmsd.set_backend("graph_tool")
# spyrmsd uses graph_tool
```

The available backends (which depend on the installed dependencies) are stored in `spyrmsd.available_backends`.

## Development

Expand All @@ -172,7 +185,7 @@ Pre-commit `git` hooks can be installed with [pre-commit](https://pre-commit.com

## Copyright

Copyright (c) 2019-2021, Rocco Meli.
Copyright (c) 2019-2024, Rocco Meli.

## References

Expand All @@ -181,3 +194,7 @@ References are tracked with [duecredit](https://github.com/duecredit/duecredit/)
### Acknowledgements

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

[rustworkx]: https://www.rustworkx.org
[NetworkX]: https://networkx.github.io/
[graph-tool]: https://graph-tool.skewed.de/
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ channels:
dependencies:
# Base
- python
- pip
- setuptools

# Maths
- numpy
- scipy
- graph-tool
- networkx>=2
- rustworkx

# Chemistry
- openbabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ channels:
dependencies:
# Base
- python
- pip
- setuptools

# Maths
- numpy
- scipy
- networkx>=2
- rustworkx

# Chemistry
- openbabel
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ channels:
dependencies:
# Base
- python
- pip
- setuptools

# Maths
- numpy
- scipy
- graph-tool
- networkx>=2
- rustworkx

# Chemistry
- rdkit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ channels:
dependencies:
# Base
- python
- pip
- setuptools

# Maths
- numpy
- scipy
- networkx>=2
- rustworkx

# Chemistry
- rdkit
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

project = "spyrmsd"
copyright = (
"2019-2021, Rocco Meli. Project structure based on the "
"2019-2024, Rocco Meli. Project structure based on the "
"Computational Molecular Science Python Cookiecutter version 1.1"
)
author = "Rocco Meli"
Expand Down
Loading

0 comments on commit db10965

Please sign in to comment.