Skip to content

Commit 874c472

Browse files
committed
type annotations in python bindings
1 parent aa37437 commit 874c472

File tree

6 files changed

+38
-2
lines changed

6 files changed

+38
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "genimtools"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

bindings/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "genimtools-py"
3-
version = "0.0.3"
3+
version = "0.0.4"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

bindings/README.md

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# genimtools
2+
This is a python wrapper around the `genimtools` crate. It provides an easy interface for using `genimtools` in python. It is currently in early development, and as such, it does not have a lot of functionality yet, but new tools are being worked on right now.
3+
4+
## Installation
5+
You can get `genimtools` from PyPI:
6+
```bash
7+
pip install genimtools
8+
```
9+
10+
## Usage
11+
Import the package, and use the tools:
12+
```python
13+
import genimtools as gt
14+
15+
gt.prune_universe(...)
16+
```

bindings/genimtools.pyi

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
from typing import Optional
2+
3+
def prune_universe(universe: str, data: str, min_count: Optional[int], output: Optional[str]) -> None:
4+
"""
5+
Prune a universe file.
6+
7+
Pruning a universe file removes all items that appear less than min_count. This is useful for
8+
removing universe regions that are never seen during training or ultra-rare regions.
9+
10+
:param str universe: Path to the universe file.
11+
:param str data: Path to the data (folder of bed files).
12+
:param int min_count: Minimum number of times a region must appear to be kept.
13+
:param str output: Path to the output file.
14+
"""

bindings/pyproject.toml

+3
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ dynamic = ["version"]
1414

1515
[tool.maturin]
1616
features = ["pyo3/extension-module"]
17+
18+
[tool.setuptools.dynamic]
19+
readme = {file = "README.md", content-type = "text/markdown"}

docs/changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.0.4]
8+
- add type annotations to the python bindings
9+
710
## [0.0.3]
811
- work on python bindings initialization
912

0 commit comments

Comments
 (0)