helmkit 0.3.0__tar.gz → 0.3.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. helmkit-0.3.2/.github/dependabot.yml +6 -0
  2. helmkit-0.3.2/.github/workflows/main.yml +22 -0
  3. helmkit-0.3.2/.pre-commit-config.yaml +27 -0
  4. {helmkit-0.3.0 → helmkit-0.3.2}/PKG-INFO +52 -1
  5. {helmkit-0.3.0 → helmkit-0.3.2}/README.md +51 -0
  6. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/README.md +13 -10
  7. helmkit-0.3.2/benchmarks/benchmark-import.py +36 -0
  8. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/data/monomers.sdf +3316 -3316
  9. helmkit-0.3.2/benchmarks/helmkit-profile.py +31 -0
  10. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/helmkit-with-reload-benchmark.py +3 -0
  11. {helmkit-0.3.0 → helmkit-0.3.2}/pyproject.toml +3 -1
  12. {helmkit-0.3.0 → helmkit-0.3.2}/src/helmkit/data/monomers.sdf +3220 -3220
  13. {helmkit-0.3.0 → helmkit-0.3.2}/src/helmkit/molecule.py +16 -18
  14. {helmkit-0.3.0 → helmkit-0.3.2}/tests/data/monomers.sdf +3316 -3316
  15. helmkit-0.3.2/tests/test_cycpeptmpdb.py +29 -0
  16. helmkit-0.3.2/tests/test_parallel_load.py +28 -0
  17. helmkit-0.3.0/tests/random_peptides.py → helmkit-0.3.2/tests/test_random_peptides.py +3 -4
  18. {helmkit-0.3.0 → helmkit-0.3.2}/uv.lock +252 -54
  19. helmkit-0.3.0/tests/cycpeptmpdb.py +0 -43
  20. helmkit-0.3.0/tests/test_parallel_load.py +0 -42
  21. {helmkit-0.3.0 → helmkit-0.3.2}/.gitignore +0 -0
  22. {helmkit-0.3.0 → helmkit-0.3.2}/.python-version +0 -0
  23. {helmkit-0.3.0 → helmkit-0.3.2}/LICENSE +0 -0
  24. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/data/peptides.csv +0 -0
  25. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/helmkit-benchmark.py +0 -0
  26. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/helmkit-parallel-benchmark.py +0 -0
  27. {helmkit-0.3.0 → helmkit-0.3.2}/benchmarks/pypept-benchmark.py +0 -0
  28. {helmkit-0.3.0 → helmkit-0.3.2}/src/helmkit/__init__.py +0 -0
  29. {helmkit-0.3.0 → helmkit-0.3.2}/src/helmkit/py.typed +0 -0
  30. {helmkit-0.3.0 → helmkit-0.3.2}/tests/data/generate_sdf.py +0 -0
  31. {helmkit-0.3.0 → helmkit-0.3.2}/tests/data/monomers.csv +0 -0
  32. {helmkit-0.3.0 → helmkit-0.3.2}/tests/data/peptides.csv +0 -0
@@ -0,0 +1,6 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "uv"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
@@ -0,0 +1,22 @@
1
+ name: Run tests
2
+
3
+ on:
4
+ push:
5
+ paths:
6
+ - '**/*.py'
7
+ pull_request:
8
+ paths:
9
+ - '**/*.py'
10
+ workflow_dispatch:
11
+
12
+ jobs:
13
+ build:
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up uv
18
+ uses: astral-sh/setup-uv@v6
19
+ - name: Install dependencies
20
+ run: uv sync -U
21
+ - name: Test with pytest
22
+ run: uv run pytest
@@ -0,0 +1,27 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v5.0.0
4
+ hooks:
5
+ - id: trailing-whitespace
6
+ - id: end-of-file-fixer
7
+ - id: check-yaml
8
+ - id: check-toml
9
+ - id: check-added-large-files
10
+ - repo: https://github.com/asottile/pyupgrade
11
+ rev: v3.20.0
12
+ hooks:
13
+ - id: pyupgrade
14
+ - repo: https://github.com/asottile/reorder-python-imports
15
+ rev: v3.15.0
16
+ hooks:
17
+ - id: reorder-python-imports
18
+ - repo: https://github.com/astral-sh/ruff-pre-commit
19
+ rev: v0.12.5
20
+ hooks:
21
+ - id: ruff-check
22
+ args: [ --fix ]
23
+ - id: ruff-format
24
+ - repo: https://github.com/astral-sh/uv-pre-commit
25
+ rev: 0.8.3
26
+ hooks:
27
+ - id: uv-lock
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: helmkit
3
- Version: 0.3.0
3
+ Version: 0.3.2
4
4
  Summary: Parse HELM strings into RDKit molecules
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.11
@@ -11,6 +11,18 @@ Description-Content-Type: text/markdown
11
11
 
12
12
  A Python library for converting HELM (Hierarchical Editing Language for Macromolecules) notation to RDKit molecules.
13
13
 
14
+ ## Table of Contents
15
+
16
+ - [Basic Usage](#basic-usage)
17
+ - [Installation](#installation)
18
+ - [Quick Example](#quick-example)
19
+ - [Understanding HELM Notation](#understanding-helm-notation)
20
+ - [Using Custom Monomer Data](#using-custom-monomer-data)
21
+ - [SDF File Structure Requirements](#sdf-file-structure-requirements)
22
+ - [Parallel Processing of Peptides](#parallel-processing-of-peptides)
23
+ - [Development Setup](#development-setup)
24
+ - [Running Tests](#running-tests)
25
+
14
26
  ## Basic Usage
15
27
 
16
28
  ```python
@@ -24,6 +36,28 @@ molecule = Molecule(helm_string)
24
36
  rdkit_mol = molecule.mol
25
37
  ```
26
38
 
39
+ ## Installation
40
+
41
+ To install `helmkit`, you can use either [`uv`](https://github.com/astral-sh/uv) or `pip`.
42
+
43
+ ### With [`uv`](https://github.com/astral-sh/uv)
44
+
45
+ ```bash
46
+ uv pip install helmkit
47
+ ```
48
+
49
+ or if you have added it as a dependency to your `pyproject.toml`:
50
+
51
+ ```bash
52
+ uv add helmkit
53
+ ```
54
+
55
+ ### Without `uv`
56
+
57
+ ```bash
58
+ pip install helmkit
59
+ ```
60
+
27
61
  ## Quick Example
28
62
 
29
63
  ```python
@@ -129,3 +163,20 @@ helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
129
163
  # Process peptides in parallel
130
164
  molecules = load_peptides_in_parallel(helm_strings, monomer_db)
131
165
  ```
166
+
167
+ ## Development Setup
168
+
169
+ To set up a development environment, first clone the repository.
170
+ Then, from the root of the repository, use `uv` to sync the environment:
171
+
172
+ ```bash
173
+ uv sync -U
174
+ ```
175
+
176
+ ## Running Tests
177
+
178
+ To run the test suite, execute `pytest` from the root of the repository:
179
+
180
+ ```bash
181
+ pytest
182
+ ```
@@ -2,6 +2,18 @@
2
2
 
3
3
  A Python library for converting HELM (Hierarchical Editing Language for Macromolecules) notation to RDKit molecules.
4
4
 
5
+ ## Table of Contents
6
+
7
+ - [Basic Usage](#basic-usage)
8
+ - [Installation](#installation)
9
+ - [Quick Example](#quick-example)
10
+ - [Understanding HELM Notation](#understanding-helm-notation)
11
+ - [Using Custom Monomer Data](#using-custom-monomer-data)
12
+ - [SDF File Structure Requirements](#sdf-file-structure-requirements)
13
+ - [Parallel Processing of Peptides](#parallel-processing-of-peptides)
14
+ - [Development Setup](#development-setup)
15
+ - [Running Tests](#running-tests)
16
+
5
17
  ## Basic Usage
6
18
 
7
19
  ```python
@@ -15,6 +27,28 @@ molecule = Molecule(helm_string)
15
27
  rdkit_mol = molecule.mol
16
28
  ```
17
29
 
30
+ ## Installation
31
+
32
+ To install `helmkit`, you can use either [`uv`](https://github.com/astral-sh/uv) or `pip`.
33
+
34
+ ### With [`uv`](https://github.com/astral-sh/uv)
35
+
36
+ ```bash
37
+ uv pip install helmkit
38
+ ```
39
+
40
+ or if you have added it as a dependency to your `pyproject.toml`:
41
+
42
+ ```bash
43
+ uv add helmkit
44
+ ```
45
+
46
+ ### Without `uv`
47
+
48
+ ```bash
49
+ pip install helmkit
50
+ ```
51
+
18
52
  ## Quick Example
19
53
 
20
54
  ```python
@@ -120,3 +154,20 @@ helm_strings = ["PEPTIDE1{A.R.G}$$$$", "PEPTIDE1{S.G.T}$$$$"]
120
154
  # Process peptides in parallel
121
155
  molecules = load_peptides_in_parallel(helm_strings, monomer_db)
122
156
  ```
157
+
158
+ ## Development Setup
159
+
160
+ To set up a development environment, first clone the repository.
161
+ Then, from the root of the repository, use `uv` to sync the environment:
162
+
163
+ ```bash
164
+ uv sync -U
165
+ ```
166
+
167
+ ## Running Tests
168
+
169
+ To run the test suite, execute `pytest` from the root of the repository:
170
+
171
+ ```bash
172
+ pytest
173
+ ```
@@ -33,15 +33,18 @@ that `pyPept` cannot handle were excluded (monomers with names containing whites
33
33
  hyphens or parenthesis), resulting in a total of 4694 peptides. We measured the total
34
34
  and average parsing time:
35
35
 
36
- | Tool | Total Time (s) | Avg Time per Peptide (s) |
37
- |-------------------------------------|----------------|--------------------------|
38
- | `pyPept` | 676.65 | 0.144 |
39
- | `helmkit` | 3.60 | 0.00077 |
40
- | `helmkit` (DB reload every peptide) | 261.81 | 0.056 |
41
-
42
- `helmkit` outperforms `pyPept` by approximately 188× when loading the monomer library
43
- once per session. When forced to reload the library for every peptide (needs disabling
44
- memoization in the source code), `helmkit` is still about 3× faster.
36
+ | Tool | Total Time (s) | Avg Time per Peptide (s) | Peptides per Second |
37
+ |-------------------------------------|---------------:|-------------------------:|--------------------:|
38
+ | `pyPept` | 676.65 | 0.14400 | 6.94 |
39
+ | `helmkit` (DB reload every peptide) | 252.67 | 0.05383 | 18.58 |
40
+ | `helmkit` | 2.83 | 0.00060 | 1658.68 |
41
+ | `helmkit` (parallel loading) | 1.42 | 0.00030 | 3305.63 |
42
+
43
+ `helmkit` outperforms `pyPept` by approximately 239× when loading the monomer library
44
+ once per session. When forced to reload the library for every peptide, `helmkit` is
45
+ still about 3× faster. If we use parallelized loading in `helmkit`, we achieve an
46
+ additional 2.5× speedup, resulting in a total speedup of approximately 477× over
47
+ `pyPept`.
45
48
 
46
49
  ## Environment
47
50
 
@@ -52,4 +55,4 @@ versions:
52
55
  - `polars 1.31.0` (CSV parsing and dataframe processing)
53
56
  - `rdkit 2025.3.3` (target output format and structure processing)
54
57
  - `pypept 1.0.0` (commit `ade9f5840691ad1f8fa22d13939a665c25175d5a`)
55
- - `helmkit 0.1.0` (local development version)
58
+ - `helmkit 0.3.0` (local development version)
@@ -0,0 +1,36 @@
1
+ import sys
2
+ import time
3
+
4
+
5
+ def benchmark_imports(import_code: str, repeats: int = 100):
6
+ times = []
7
+ for _ in range(repeats):
8
+ start = time.perf_counter()
9
+ exec(import_code)
10
+ end = time.perf_counter()
11
+ times.append(end - start)
12
+ # Remove imported modules to force fresh import next run
13
+ for mod in list(sys.modules):
14
+ if mod.startswith("pyPept") or mod.startswith("helmkit"):
15
+ del sys.modules[mod]
16
+ avg_time = sum(times) / repeats
17
+ print(f"Average import time for:\n{import_code}\n= {avg_time:.6f} seconds\n")
18
+
19
+
20
+ pyPept_imports = """from pyPept.converter import Converter
21
+ from pyPept.molecule import Molecule
22
+ from pyPept.sequence import Sequence
23
+ """
24
+
25
+ helmkit_imports = """from helmkit import load_monomer_library
26
+ from helmkit import Molecule
27
+ """
28
+
29
+
30
+ def main():
31
+ benchmark_imports(pyPept_imports)
32
+ benchmark_imports(helmkit_imports)
33
+
34
+
35
+ if __name__ == "__main__":
36
+ main()