Skip to content

Commit

Permalink
Merge pull request #252 from VlachosGroup/mac-install-test-dev
Browse files Browse the repository at this point in the history
Optional `mordred` Install Cleanup and Documentation
  • Loading branch information
JacksonBurns authored Feb 23, 2023
2 parents cde0bad + 305154f commit aa767b4
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 5 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/mordred_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test mordred Install
on:
schedule:
- cron: '0 8 * * 1-5'
push:
branches: [ master ]
pull_request:
branches: [ master ]

workflow_dispatch:

jobs:
optional:
strategy:
fail-fast: false
matrix:
python-version: ['3.8']
os: [ubuntu-latest, windows-latest, macos-latest]

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
name: ${{ matrix.os }} Python ${{ matrix.python-version }} Subtest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Attempt mordred Install and Tests
run: |
python -m pip install -e .[mordred]
python -m unittest -v
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ Many of the substrates appear similar to one another and thereby redundant, but
`pip install aimsim`
This command also installs the required dependencies. It is recommended to install `AIMSim` in a separate virtual environment.

_Optional:_ AIMSim can also use descriptors provided in the `mordred` package, but because it is an older package it is only compatible with Python 3.8. To install with `mordred` support, use `pip install aimsim[mordred]`
_Optional:_ Previous versions of AIMSim provided direct support for the descriptors provided in the `mordred` package. Unforunately, `mordred` is no longer recieving updates and causes significant depdendency conflicts. Because of this, it is an _optional_ add-on to `AIMSim` that is only compatible with Python 3.8. To install with `mordred` support, use `pip install 'aimsim[mordred]'` (note the single quotes, necessary in `zsh`).

Unit tests from previous versions of `AIMSim` have been kept but are not actively maintained due to the limitations above. Use `mordred` at your own risk.

## Running AIMSim
`AIMSim` is compatible with Python 3.7 to 3.9.
Expand All @@ -68,9 +70,12 @@ Start `AIMSim` with a prepared configuration YAML file (`config.yaml`):
1. Morgan Fingerprint (Equivalent to the ECFP fingerprints)
2. RDKit Topological Fingerprint
3. RDKit Daylight Fingerprint

_The following are available via command line use (config.yaml) only:_

4. All fingerprints available from the [ccbmlib](https://github.com/vogt-m/ccbmlib) package (_specify 'ccbmlib:descriptorname' for command line input_).
5. All descriptors available through the [Mordred](https://github.com/mordred-descriptor/mordred) library (_specify 'mordred:desciptorname' for command line input._). To enable this option, you must install with `pip install aimsim['mordred']`.
6. All descriptors and fingerprints available from [PaDELPy](https://github.com/ecrl/padelpy), an interface to PaDEL-Descriptor. (_specify 'padelpy:desciptorname' for command line input._).
5. All descriptors and fingerprints available from [PaDELPy](https://github.com/ecrl/padelpy), an interface to PaDEL-Descriptor. (_specify 'padelpy:desciptorname' for command line input._).
6. All descriptors available through the [Mordred](https://github.com/mordred-descriptor/mordred) library (_specify 'mordred:desciptorname' for command line input._). To enable this option, you must install with `pip install 'aimsim[mordred]'` (see disclaimer in the Installation section above).

### Currently Implemented Similarity Scores

Expand Down
2 changes: 1 addition & 1 deletion aimsim/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
from . import chemical_datastructures
from . import utils

__version__ = "2.0.1"
__version__ = "2.0.2"
5 changes: 5 additions & 0 deletions aimsim/ops/descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
from padelpy import from_smiles
from aimsim.utils.extras import requires_mordred

try:
from mordred import Calculator, descriptors
except ImportError:
NO_MORDRED = True


from ..exceptions import (
InvalidConfigurationError,
Expand Down
2 changes: 1 addition & 1 deletion aimsim/utils/extras.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def requires_mordred(function):
try:
from mordred import Calculator, descriptors

return function()
return function
except ImportError:
return MordredNotInstalledWarning(
"""Attempting to call this function ({:s}) requires mordred to be installed.
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def get_version(rel_path):
"mordred": [
"mordred==1.2.0",
"networkx==2.*",
"openpyxl",
],
},
packages=find_packages(),
Expand Down

0 comments on commit aa767b4

Please sign in to comment.