generated from JacksonBurns/blank-python-project
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from JacksonBurns/v1.0.2-dev
Addresses a group of issues for the next patch release 1.0.2 of `py2opsin`: - resolves Packaging fix #7 with a small update to setup.py - resolves Add a timing comparison to pubchempy #5 with a new performance test and README update - resolves Add example usage notebook and binder link #6 - resolves Fix GH Pages Docs #4
- Loading branch information
Showing
10 changed files
with
620 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,8 @@ | |
## Installation | ||
`py2opsin` can be installed with `pip install py2opsin`. It has _zero_ dependencies (`OPSIN v2.7.0` is included in the PyPI package) and should work inside any environment running modern Python. | ||
|
||
Try a demo of `py2opsin` live on your browser (no installation required!): [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/JacksonBurns/py2opsin/HEAD?labpath=examples%2Fpy2opsin_example.ipynb) | ||
|
||
## Usage | ||
Command-line arguments available in `OPSIN` can be passed through to `py2opsin`: | ||
|
||
|
@@ -50,12 +52,46 @@ Arguments: | |
- wildcard_radicals (bool, optional): Output radicals as wildcards. Defaults to False. | ||
- jar_fpath (str, optional): Filepath to OPSIN jar file. Defaults to "opsin-cli.jar" which is distributed with py2opsin. | ||
|
||
|
||
## Speedup 50x from `pubchempy` | ||
`py2opsin` runs locally and is smaller in scope in what it provides, which makes it __dramatically__ faster at resolving identifiers. In the code block below, the call to `py2opsin` will execute ~58x faster than an equivalent call to `puchempy`: | ||
```python | ||
import time | ||
|
||
from pubchempy import PubChemHTTPError, get_compounds | ||
from py2opsin import py2opsin | ||
|
||
compound_list = [ | ||
"dienochlor", | ||
"kepone", | ||
... | ||
"ditechnetium decacarbonyl", | ||
] | ||
|
||
for compound in compound_list: | ||
result = get_compounds(compound, "name") | ||
|
||
smiles_strings = py2opsin(compound_list) | ||
``` | ||
|
||
|
||
## Examples | ||
- Jeremy Monat's ([@bertiewooster](https://github.com/bertiewooster)) fantastic [blog post](https://bertiewooster.github.io/2023/03/10/Revisiting-a-Classic-Cheminformatics-Paper-The-Wiener-Index.html) using `py2opsin` to help explore the Wiener Index by enabling translation from IUPAC names into molecules directly from the original paper. | ||
|
||
## Online Documentation | ||
[Click here to read the documentation](https://JacksonBurns.github.io/py2opsin/) | ||
|
||
## 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. | ||
|
||
When submitting a PR, please mark your PR with the "PR Ready for Review" label when you are finished making changes so that the GitHub actions bots can work their magic! | ||
|
||
### Developer Install | ||
|
||
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 `astartes` 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.). | ||
|
||
__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 ". | ||
|
||
## License | ||
`OPSIN` and `py2opsin` are both distributed under the MIT license. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .py2opsin import py2opsin | ||
|
||
__version__ = "1.0.1" | ||
__version__ = "1.0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.