diff --git a/.github/workflows/check_pypi_build.yml b/.github/workflows/check_pypi_build.yml deleted file mode 100644 index 9fa3a08..0000000 --- a/.github/workflows/check_pypi_build.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Check PyPI Build -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - architecture: x64 - - name: Install Dependencies - run: | - python -m pip install -e . - python -m pip install build - - - name: Check Errors - run: | - python -m build \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..d9f9b76 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 + diff --git a/.github/workflows/format_code.yml b/.github/workflows/format_code.yml deleted file mode 100644 index 9536bfb..0000000 --- a/.github/workflows/format_code.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Ensure Code Formatting -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - - workflow_dispatch: - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Setup python - uses: actions/setup-python@v4 - with: - python-version: '3.10' - architecture: x64 - - name: Install Dependencies - run: | - python -m pip install pycodestyle autopep8 - python -m pip install -e . - - - name: Check Errors - run: | - pycodestyle --statistics --count --max-line-length=150 --ignore=E731 --show-source . \ No newline at end of file diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml deleted file mode 100644 index aa57a49..0000000 --- a/.github/workflows/run_tests.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Run Tests -on: - schedule: - - cron: '0 8 * * 1' - push: - branches: [ main ] - pull_request: - branches: [ main ] - - workflow_dispatch: - -jobs: - build: - 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: conda-incubator/setup-miniconda@v2 - with: - auto-update-conda: true - python-version: ${{ matrix.python-version }} - - name: Install Dependencies - run: | - python -m pip install -e .[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 diff --git a/README.md b/README.md index 8e276fd..9a76c35 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@

## 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) @@ -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. @@ -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 git@github.com: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. diff --git a/py2opsin/__init__.py b/py2opsin/__init__.py index 9662b98..362f604 100644 --- a/py2opsin/__init__.py +++ b/py2opsin/__init__.py @@ -1,3 +1,3 @@ from .py2opsin import py2opsin -__version__ = "1.0.5" +__version__ = "1.0.6" diff --git a/py2opsin/opsin-cli-2.7.0-jar-with-dependencies.jar b/py2opsin/opsin-cli-2.8.0-jar-with-dependencies.jar similarity index 78% rename from py2opsin/opsin-cli-2.7.0-jar-with-dependencies.jar rename to py2opsin/opsin-cli-2.8.0-jar-with-dependencies.jar index 7d3c3b7..a46626f 100644 Binary files a/py2opsin/opsin-cli-2.7.0-jar-with-dependencies.jar and b/py2opsin/opsin-cli-2.8.0-jar-with-dependencies.jar differ diff --git a/py2opsin/py2opsin.py b/py2opsin/py2opsin.py index 4a9f782..a9bd1ac 100644 --- a/py2opsin/py2opsin.py +++ b/py2opsin/py2opsin.py @@ -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]