Skip to content

Commit f7b64d6

Browse files
authored
Merge branch 'main' into publish-action
2 parents b8c8cd2 + bebdae1 commit f7b64d6

File tree

4 files changed

+49
-23
lines changed

4 files changed

+49
-23
lines changed

.github/workflows/tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
name: Python Package using uv
1+
name: Tests
22

3-
on: [push]
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
48

59
jobs:
610
build-linux:

README.md

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A notbook that explains how you can use SHAP to analyse and interpret your machi
2525
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/reymond-group/drfp/HEAD?filepath=notebooks%2F02_model_explainability.ipynb)
2626

2727
## Installation and Usage
28-
*DRFP* can be installed from pypi using `pip install drfp`. However, it depends on [RDKit](https://www.rdkit.org/) which is best [installed using conda](https://www.rdkit.org/docs/Install.html).
28+
*DRFP* can be installed from pypi using `pip install drfp`.
2929

3030
Once DRFP is installed, there are two ways you can use it. You can use the cli app `drfp` or the library provided by the package.
3131

@@ -56,18 +56,18 @@ The variable `fps` now points to a list containing the fingerprints for the two
5656

5757
The library contains the class `DrfpEncoder` with one public method `encode`.
5858

59-
| `DrfpEncoder.encode()` | Description | Type | Default |
60-
|-|-|-|-|
61-
| `X` | An iterable (e.g. a list) of reaction SMILES or a single reaction SMILES to be encoded | `Iterable` or `str` | |
62-
| `n_folded_length` | The folded length of the fingerprint (the parameter for the modulo hashing) | `int` | `2048` |
63-
| `min_radius` | The minimum radius of a substructure (0 includes single atoms) | `int` | `0` |
64-
| `radius` | The maximum radius of a substructure | `int` | `3` |
65-
| `rings` | Whether to include full rings as substructures | `bool` | `True` |
66-
| `mapping` | Return a feature to substructure mapping in addition to the fingerprints. If true, the return signature of this method is `Tuple[List[np.ndarray], Dict[int, Set[str]]]` | `bool` | `False` |
67-
| `atom_index_mapping` | Return the atom indices of mapped substructures for each reaction | `bool` | `False` |
68-
| `root_central_atom` | Whether to root the central atom of substructures when generating SMILES | `bool` | `True` |
69-
| `include_hydrogens` | Whether to explicitly include hydrogens in the molecular graph | `bool` | `False` |
70-
| `show_progress_bar` | Whether to show a progress bar when encoding reactions | `bool` | `False` |
59+
| `DrfpEncoder.encode()` | Description | Type | Default |
60+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------- | ------- |
61+
| `X` | An iterable (e.g. a list) of reaction SMILES or a single reaction SMILES to be encoded | `Iterable` or `str` | |
62+
| `n_folded_length` | The folded length of the fingerprint (the parameter for the modulo hashing) | `int` | `2048` |
63+
| `min_radius` | The minimum radius of a substructure (0 includes single atoms) | `int` | `0` |
64+
| `radius` | The maximum radius of a substructure | `int` | `3` |
65+
| `rings` | Whether to include full rings as substructures | `bool` | `True` |
66+
| `mapping` | Return a feature to substructure mapping in addition to the fingerprints. If true, the return signature of this method is `Tuple[List[np.ndarray], Dict[int, Set[str]]]` | `bool` | `False` |
67+
| `atom_index_mapping` | Return the atom indices of mapped substructures for each reaction | `bool` | `False` |
68+
| `root_central_atom` | Whether to root the central atom of substructures when generating SMILES | `bool` | `True` |
69+
| `include_hydrogens` | Whether to explicitly include hydrogens in the molecular graph | `bool` | `False` |
70+
| `show_progress_bar` | Whether to show a progress bar when encoding reactions | `bool` | `False` |
7171

7272
# Reproduce
7373
Want to reproduce the results in our paper? You can find all the data in the `data` folder and encoding and training scripts in the `scripts` folder.
@@ -82,3 +82,25 @@ Want to reproduce the results in our paper? You can find all the data in the `da
8282
publisher={Royal Society of Chemistry}
8383
}
8484
```
85+
86+
## Development Setup
87+
88+
This project uses [UV](https://github.com/astral-sh/uv) for dependency management. To set up a development environment:
89+
90+
1. Install UV following the [official instructions](https://github.com/astral-sh/uv#installation)
91+
92+
2. Clone the repository:
93+
```bash
94+
git clone https://github.com/reymond-group/drfp
95+
cd drfp
96+
```
97+
98+
3. Install dependencies including development packages:
99+
```bash
100+
uv sync --dev
101+
```
102+
103+
4. Run tests:
104+
```bash
105+
uv run pytest
106+
```

tox.ini

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
[tox]
66
minversion = 3.15
77
envlist = default
8-
requires = tox-conda
98

109

1110
[testenv]
@@ -15,10 +14,11 @@ setenv =
1514
TOXINIDIR = {toxinidir}
1615
passenv =
1716
HOME
18-
extras =
19-
testing
17+
allowlist_externals =
18+
uv
2019
commands =
21-
pytest {posargs}
20+
uv sync --dev
21+
uv run pytest {posargs}
2222

2323

2424
[testenv:{clean,build}]

uv.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)