From 0fd6abae5895872cc671342a4e9f9d1610138308 Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:11:38 -0500 Subject: [PATCH 1/9] Create mordred_check.yml --- .github/workflows/mordred_check.yml | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/mordred_check.yml diff --git a/.github/workflows/mordred_check.yml b/.github/workflows/mordred_check.yml new file mode 100644 index 00000000..0be51044 --- /dev/null +++ b/.github/workflows/mordred_check.yml @@ -0,0 +1,33 @@ +name: Test mordred Install +on: + schedule: + - cron: '0 8 * * 1-5' + push: + branches: [ master ] + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + build: + 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 Live Install + run: | + python -m pip install aimsim[mordred] From 48c2db069a0a5eea5fa3c6496f8bb8392e9c8efb Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:15:43 -0500 Subject: [PATCH 2/9] syntax error in workflow file --- .github/workflows/mordred_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mordred_check.yml b/.github/workflows/mordred_check.yml index 0be51044..daa24bb4 100644 --- a/.github/workflows/mordred_check.yml +++ b/.github/workflows/mordred_check.yml @@ -14,7 +14,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: '3.8' + python-version: ['3.8'] os: [ubuntu-latest, windows-latest, macos-latest] runs-on: ${{ matrix.os }} From a8b6563097f86106c491004d9f36f7ae7f8ad385 Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:51:38 -0500 Subject: [PATCH 3/9] also run tests on mordred install --- .github/workflows/mordred_check.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mordred_check.yml b/.github/workflows/mordred_check.yml index daa24bb4..0ef68a47 100644 --- a/.github/workflows/mordred_check.yml +++ b/.github/workflows/mordred_check.yml @@ -10,7 +10,7 @@ on: workflow_dispatch: jobs: - build: + optional: strategy: fail-fast: false matrix: @@ -28,6 +28,7 @@ jobs: with: auto-update-conda: true python-version: ${{ matrix.python-version }} - - name: Attempt Live Install + - name: Attempt mordred Install and Tests run: | - python -m pip install aimsim[mordred] + python -m pip install -e .[mordred] + coverage run --source=. --omit=interfaces/*,aimsim/__main__.py,aimsim/tasks/__init__.py,aimsim/ops/__init__.py,aimsim/chemical_datastructures/__init__.py,aimsim/utils/__init__.py,setup.py,tests/*,aimsim/__init__.py,aimsim/utils/plotting_scripts.py -m unittest discover From 6f18e0544ac02e79455e567c0502080853e79eac Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:51:47 -0500 Subject: [PATCH 4/9] add import back to descriptor --- aimsim/ops/descriptor.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/aimsim/ops/descriptor.py b/aimsim/ops/descriptor.py index f369ff29..283701a6 100644 --- a/aimsim/ops/descriptor.py +++ b/aimsim/ops/descriptor.py @@ -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, From 231dccbea9ee42613c2414f86538879fc6b696bb Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:52:05 -0500 Subject: [PATCH 5/9] fix mordred_requires decorator --- aimsim/utils/extras.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aimsim/utils/extras.py b/aimsim/utils/extras.py index 49dd7f3a..3e4fe315 100644 --- a/aimsim/utils/extras.py +++ b/aimsim/utils/extras.py @@ -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. From 4200420dc53cb8b233d263bad7f8ea29e9c7616a Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:52:19 -0500 Subject: [PATCH 6/9] Update README.md - add mordred disclaimer - fix install instructions for zsh issues --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 3370caa8..de933a72 100644 --- a/README.md +++ b/README.md @@ -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. @@ -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 From 9af6d0793141f9685efd4a2556835bab2b560e7c Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 21:54:15 -0500 Subject: [PATCH 7/9] switch test runner to default unittest --- .github/workflows/mordred_check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/mordred_check.yml b/.github/workflows/mordred_check.yml index 0ef68a47..50ad6eef 100644 --- a/.github/workflows/mordred_check.yml +++ b/.github/workflows/mordred_check.yml @@ -31,4 +31,4 @@ jobs: - name: Attempt mordred Install and Tests run: | python -m pip install -e .[mordred] - coverage run --source=. --omit=interfaces/*,aimsim/__main__.py,aimsim/tasks/__init__.py,aimsim/ops/__init__.py,aimsim/chemical_datastructures/__init__.py,aimsim/utils/__init__.py,setup.py,tests/*,aimsim/__init__.py,aimsim/utils/plotting_scripts.py -m unittest discover + python -m unittest -v \ No newline at end of file From 439069cf7a19495be7cce0cea0ea6d84bf3b896b Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 22:08:22 -0500 Subject: [PATCH 8/9] mordred install requires openpyxl this is due to some version conflict, i think pandas stopped using this in later versions but because of the restrictions imposed by mordred we fall back to this --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 3276d0ff..19d3ab84 100644 --- a/setup.py +++ b/setup.py @@ -41,6 +41,7 @@ def get_version(rel_path): "mordred": [ "mordred==1.2.0", "networkx==2.*", + "openpyxl", ], }, packages=find_packages(), From 305154f458ab8233125aca6ea472dafce117bd68 Mon Sep 17 00:00:00 2001 From: JacksonBurns <33505528+JacksonBurns@users.noreply.github.com> Date: Wed, 22 Feb 2023 22:12:51 -0500 Subject: [PATCH 9/9] bump minor version --- aimsim/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aimsim/__init__.py b/aimsim/__init__.py index 9ef55638..cb1cb3bd 100644 --- a/aimsim/__init__.py +++ b/aimsim/__init__.py @@ -3,4 +3,4 @@ from . import chemical_datastructures from . import utils -__version__ = "2.0.1" +__version__ = "2.0.2"