Skip to content

Commit

Permalink
Merge pull request #17 from JacksonBurns/py2opsin106
Browse files Browse the repository at this point in the history
bump to latest OPSIN release, update readme with opsin citation, etc
  • Loading branch information
JacksonBurns authored Oct 29, 2023
2 parents 1540565 + 8295e04 commit 761a003
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 99 deletions.
27 changes: 0 additions & 27 deletions .github/workflows/check_pypi_build.yml

This file was deleted.

109 changes: 109 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Continuous Integration
on:
schedule:
- cron: "0 8 * * 1"
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

concurrency:
group: actions-id-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
check-formatting:
name: Check Formatting Errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Dependencies
run: |
python -m pip install pycodestyle autopep8
python -m pip install .
- name: Run pycodestyle
run: |
pycodestyle --statistics --count --max-line-length=150 --show-source --ignore=E731 .
build-and-test:
needs: check-formatting
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
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: mamba-org/setup-micromamba@main
with:
environment-name: temp
condarc: |
channels:
- defaults
- conda-forge
channel_priority: flexible
create-args: |
python=${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install .[dev]
python -m pip install coverage
- name: Run Tests
run: |
coverage run --source=. --omit=py2opsin/__init__.py,setup.py,test/* -m unittest discover
- name: Show Coverage
run: |
coverage report -m
ci-report-status:
name: report CI status
needs: build-and-test
runs-on: ubuntu-latest
steps:
- run: |
result="${{ needs.build-and-test.result }}"
if [[ $result == "success" ]] ; then
exit 0
else
exit 1
fi
pypi-package:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
needs: ci-report-status
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip-existing: true
verbose: true

27 changes: 0 additions & 27 deletions .github/workflows/format_code.yml

This file was deleted.

40 changes: 0 additions & 40 deletions .github/workflows/run_tests.yml

This file was deleted.

17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</p>

## Installation
`py2opsin` can be installed with `pip install py2opsin`. It has _zero_ Python dependencies (`OPSIN v2.7.0` is included in the PyPI package) and should work inside any environment running modern Python. Java 8+ is required to run OPSIN.
`py2opsin` can be installed with `pip install py2opsin`. It has _zero_ Python dependencies (`OPSIN v2.8.0` is included in the PyPI package) and should work inside any environment running modern Python. Java 8+ is required to run OPSIN.

Try a demo of `py2opsin` live on your browser (no installation required!): [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/JacksonBurns/py2opsin/blob/main/examples/py2opsin_example.ipynb)

Expand Down Expand Up @@ -81,6 +81,17 @@ smiles_strings = py2opsin(compound_list)
## Online Documentation
[Click here to read the documentation](https://JacksonBurns.github.io/py2opsin/)

## Citation
Please check [the OPSIN repository](https://github.com/dan2097/opsin#about-opsin) for the latest citation information, which as of October 2023 suggests citing this paper:
```
Chemical Name to Structure: OPSIN, an Open Source Solution
Daniel M. Lowe, Peter T. Corbett, Peter Murray-Rust, Robert C. Glen
Journal of Chemical Information and Modeling 2011 51 (3), 739-753
```

You may also see fit to mention that you used `py2opsin` to run `OPSIN`, but `py2opsin` itself isn't a significant scholarly effort and thus does not have a DOI.
Providing a link to this GitHub repository along with the version of `py2opsin` used is sufficient.

## Contributing & Developer Notes
Pull Requests, Bug Reports, and all Contributions are welcome! Please use the appropriate issue or pull request template when making a contribution.

Expand All @@ -90,9 +101,9 @@ When submitting a PR, please mark your PR with the "PR Ready for Review" label w

To contribute to the `py2opsin` source code, start by cloning the repository (i.e. `git clone [email protected]:JacksonBurns/py2opsin.git`) and then inside the repository run `pip install -e .[dev]`. This will set you up with all the required dependencies to run `py2opsin` and conform to our formatting standards (`black` and `isort`), which you can configure to run automatically in vscode [like this](https://marcobelo.medium.com/setting-up-python-black-on-visual-studio-code-5318eba4cd00#:~:text=Go%20to%20settings%20in%20your,%E2%80%9D%20and%20select%20%E2%80%9Cblack%E2%80%9D.).

Unit tests and performance tests can be executed with `pytest`, but note that performance tests are skipped on Windows due to speed issues with OPSIN on the platform.
Unit and performance tests can then be executed with `pytest`.

__Note for Windows Powershell or MacOS Catalina or newer__: On these systems the command line will complain about square brackets, so you will need to double quote the `molecules` command (i.e. `pip install -e ".
__Note for Windows Powershell or MacOS Catalina or newer__: On these systems the command line will complain about square brackets, so you will need to double quote the install command (i.e. `pip install -e ".[dev]"`).

## License
`OPSIN` and `py2opsin` are both distributed under the MIT license.
Expand Down
2 changes: 1 addition & 1 deletion py2opsin/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from .py2opsin import py2opsin

__version__ = "1.0.5"
__version__ = "1.0.6"
Binary file not shown.
2 changes: 1 addition & 1 deletion py2opsin/py2opsin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def py2opsin(
"""
# path to OPSIN jar
if jar_fpath == "default":
jar_fpath = pkg_fopen("opsin-cli-2.7.0-jar-with-dependencies.jar")
jar_fpath = pkg_fopen("opsin-cli-2.8.0-jar-with-dependencies.jar")

# default arguments to start
arg_list = ["java", "-jar", jar_fpath]
Expand Down

0 comments on commit 761a003

Please sign in to comment.