Skip to content

Commit

Permalink
Version 0.8.0 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
RMeli authored May 28, 2024
1 parent a530454 commit 98c5752
Show file tree
Hide file tree
Showing 34 changed files with 580 additions and 432 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mypy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
Expand Down
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@v3
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
Expand Down
19 changes: 10 additions & 9 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ jobs:
os: [macOS-latest, ubuntu-latest, windows-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
chemlib: [obabel, rdkit]
graphlib: [nx, gt, rx, all]
graphlib: [nogt, all]
exclude:
# graph-tools does not work on Windows
- {os: "windows-latest", graphlib: "gt"}
- {os: "windows-latest", graphlib: "all"}
- {graphlib: "all", chemlib: "obabel"}
# 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
- uses: actions/checkout@v4

- name: Info
shell: bash
Expand Down Expand Up @@ -69,7 +70,7 @@ jobs:
pytest -v --benchmark --cov=spyrmsd --cov-report=xml --color=yes tests/
- name: CodeCov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: ./coverage.xml
flags: unittests
Expand Down
10 changes: 5 additions & 5 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude: |
)$
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.6.0
hooks:
- id: check-json
- id: check-merge-conflict
Expand All @@ -14,20 +14,20 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.7.0
rev: 24.4.0
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.5.1
rev: v1.9.0
hooks:
- id: mypy
additional_dependencies: [types-requests]
30 changes: 28 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,40 @@

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

## Version 0.8.0

Date: 28/05/2024
Contributors: @RMeli

### Added

* 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

* the default backend for `pip` installations to `rustworkx` [PR#122 | @RMeli]
* `pre-commit` versions [PR #120 | @RMeli]
* Versions of several GitHub Actions [PR #120 | @RMeli]
* Location of backend tests to standalone file [PR #118 | @RMeli]

### Removed

* 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]
* 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]
Expand All @@ -19,7 +45,7 @@ Contributors: @RMeli, @takluyver, @Jnelen
### Changed

* Molecular graphs cache to cache by backend [PR #107 | @Jnelen]
* Python build system to use flit_core directly [PR #103 | @takluyver]
* 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
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ authors:
given-names: "Jochem"
orcid: "https://orcid.org/0000-0002-9970-4950"
title: "spyrmsd"
version: 0.7.0
version: 0.8.0
doi: 10.5281/zenodo.3631876
date-released: 2021-06-21
url: "https://github.com/RMeli/spyrmsd"
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
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 the other backends for higher performance.
> `spyrmsd` will install [rustworkx] (multi-platform) when using `pip` or `conda`. You can install other backends manually.
> [!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 @@ -76,11 +76,11 @@ The following packages are required to use `spyrmsd` as a module:

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

> [!NOTE]
> `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.
> `spyrmsd` uses the following priority when multiple graph libraries are present: [graph-tool], [rustworkx], [NetworkX]. *This order might change. Use `set_backend` to ensure you are always using the same backend, if needed.*
#### Standalone Tool

Expand Down Expand Up @@ -178,10 +178,10 @@ To ensure code quality and consistency the following tools are used during devel

* [black](https://black.readthedocs.io/en/stable/)
* [Flake 8](http://flake8.pycqa.org/en/latest/) (CI)
* [isort]()
* [isort](https://pycqa.github.io/isort/)
* [mypy](http://mypy-lang.org/) (CI)

Pre-commit `git` hooks can be installed with [pre-commit](https://pre-commit.com/).
Pre-commit `git` hooks can be installed with [pre-commit].

## Copyright

Expand All @@ -198,3 +198,4 @@ Project based on the [Computational Molecular Science Python Cookiecutter](https
[rustworkx]: https://www.rustworkx.org
[NetworkX]: https://networkx.github.io/
[graph-tool]: https://graph-tool.skewed.de/
[pre-commit]: https://pre-commit.com/
3 changes: 2 additions & 1 deletion devtools/conda-envs/spyrmsd-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ dependencies:
- numpy
- pandas
- scipy
- networkx>=2
- graph-tool
- rustworkx
- networkx>=2
- scikit-learn

# Chemistry
Expand Down
1 change: 1 addition & 0 deletions devtools/conda-envs/spyrmsd-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- scipy
- networkx>=2
- graph-tool
- rustworkx

# Chemistry
- openbabel
Expand Down
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
1 change: 1 addition & 0 deletions devtools/conda-envs/spyrmsd-test-rdkit-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
# Base
- python
- pip
- setuptools

# Maths
Expand Down
27 changes: 0 additions & 27 deletions devtools/conda-envs/spyrmsd-test-rdkit-gt.yaml

This file was deleted.

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
1 change: 1 addition & 0 deletions devtools/conda-envs/spyrmsd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ dependencies:
# Maths
- numpy
- scipy
- rustworkx
- networkx
5 changes: 3 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ Module

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

* graph-tool_ or NetworkX_
* graph-tool_, rustworkx_, or NetworkX_
* numpy_
* scipy_

.. note::
``spyrmsd`` uses graph-tool_ by default but will fall back to NetworkX_ if the former is not installed (e.g. on Windows).
``spyrmsd`` uses graph-tool_ by default but will fall back to either rustworkx_ or NetworkX_ if the former is not installed (e.g. on Windows).

Standalone Tool
~~~~~~~~~~~~~~~
Expand All @@ -67,3 +67,4 @@ Additionally, one of the following packages is required to use ``spyrmsd`` as a
.. _NetworkX: https://networkx.github.io/
.. _numpy: https://numpy.org/
.. _scipy: https://www.scipy.org/
.. _rustworkx: https://www.rustworkx.org
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",]
requires-python = ">=3.9"
requires = ["numpy", "scipy", "networkx>=2"]
requires = ["numpy", "scipy", "rustworkx"]
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
description=short_description[0],
long_description=long_description,
long_description_content_type="text/markdown",
version="0.7.0-dev",
version="0.8.0",
license="MIT",
packages=find_packages(),
include_package_data=True,
url="https://spyrmsd.readthedocs.io",
install_requires=["numpy", "scipy", "networkx>=2"],
install_requires=["numpy", "scipy", "rustworkx"],
extras_require={
"bib": ["duecredit"],
"rdkit": ["rdkit"],
"openbabel": ["openbabel"],
"networkx": ["networkx"],
},
platforms=["Linux", "Mac OS-X", "Unix", "Windows"],
python_requires=">=3.9",
Expand Down
2 changes: 1 addition & 1 deletion spyrmsd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from .graph import _get_backend as get_backend # noqa: F401
from .graph import _set_backend as set_backend # noqa: F401

__version__ = "0.7.0"
__version__ = "0.8.0"

# This will print latest Zenodo version
due.cite(
Expand Down
4 changes: 2 additions & 2 deletions spyrmsd/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@
warnings.simplefilter("ignore")
spyrmsd.set_backend(args.graph_backend)

if args.verbose:
print(f"Graph library: {spyrmsd.get_backend()}")
if args.verbose:
print(f"Graph library: {spyrmsd.get_backend()}")

# Loop over molecules within fil
RMSDlist = rmsdwrapper(
Expand Down
5 changes: 4 additions & 1 deletion spyrmsd/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@

from spyrmsd import constants

_supported_backends = ("graph_tool", "networkx", "rustworkx")
# The first backend found from this list is set as default
# TODO: Need to determine if graph_tool or rustworkx is better
# NetworkX is slow, therefore it is the last resort
_supported_backends = ("graph_tool", "rustworkx", "networkx")

_available_backends = []
_current_backend = None
Expand Down
Loading

0 comments on commit 98c5752

Please sign in to comment.