Skip to content

Commit a493c91

Browse files
authored
Merge pull request #16 from pfizer-opensource/release
Release to pypi
2 parents 9e07c0b + 4cb4d67 commit a493c91

File tree

14 files changed

+272
-639
lines changed

14 files changed

+272
-639
lines changed

.github/workflows/release.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
workflow_dispatch:
7+
8+
env:
9+
FORCE_COLOR: "1"
10+
11+
jobs:
12+
build:
13+
name: build wheel
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.10
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
- name: Install pep517
27+
run: |
28+
python -m pip install --user build
29+
- name: Build a source tarball
30+
run: |
31+
python -m build --sdist --no-deps .
32+
- uses: actions/upload-artifact@v4
33+
with:
34+
name: python-package-distributions
35+
path: dist/
36+
if-no-files-found: error
37+
release:
38+
needs: [build]
39+
if: github.event_name == 'release'
40+
name: Upload release to PyPI
41+
runs-on: ubuntu-latest
42+
environment:
43+
name: release
44+
url: https://pypi.org/p/bigwig-loader
45+
permissions:
46+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
47+
steps:
48+
- name: Download all the dists
49+
uses: actions/download-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
- name: Publish package distributions to PyPI
54+
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/run_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ jobs:
2121
python-version: "3.10"
2222
- name: Install dependencies
2323
run: |
24+
sed -i '0,/^ *"cupy",/s///' pyproject.toml
2425
python -m pip install --upgrade pip
2526
python -m pip install -e .[dev]
2627
- name: Run mypy

MANIFEST.in

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# MANIFEST.in
2+
exclude .gitignore
3+
exclude .github/*
4+
exclude .egg-info/*
5+
exclude benchmark/*
6+
exclude docs/*
7+
exclude examples/*
8+
exclude example_data/
9+
exclude images/*
10+
exclude .flake8
11+
exclude .pre-commit-config.yaml
12+
exclude environment.yml
13+
exclude tmp/*
14+
15+
include example_data/some_intervals.tsv
16+
include example_data/some_positions.tsv

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ dataset = BigWigDataset(
3838
reference_genome_path=reference_genome,
3939
sequence_length=1000,
4040
center_bin_to_predict=1000,
41+
window_size=1,
4142
batch_size=256,
4243
super_batch_size=1024,
4344
batches_per_epoch=20,
4445
maximum_unknown_bases_fraction=0.1,
4546
sequence_encoder="onehot",
46-
use_cufile=True,
4747
)
4848

4949
for encoded_sequences, epigenetics_profiles in dataset:

bigwig_loader/batch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from pathlib import Path
12
from typing import Any
23
from typing import Sequence
34
from typing import Union
@@ -51,6 +52,7 @@ def __init__(
5152
track_indices: IntSequenceType | None = None,
5253
sequences: StrSequenceType | None = None,
5354
values: cp.ndarray | None = None,
55+
track_names: Sequence[str | Path] | None = None,
5456
other_batched: Sequence[Sequence[Any] | npt.NDArray[np.generic] | cp.ndarray]
5557
| None = None,
5658
other: Any = None,
@@ -63,6 +65,7 @@ def __init__(
6365
self.values = values
6466
self.other_batched = other_batched
6567
self.other = other
68+
self.track_names = track_names
6669

6770
@classmethod
6871
def from_args(cls, args: Union["Batch", IntervalType, dict[str, Any]]) -> "Batch":
@@ -88,6 +91,7 @@ def __getitem__(self, item: slice) -> "Batch":
8891
track_indices=self.track_indices,
8992
sequences=self.sequences[item] if self.sequences is not None else None,
9093
values=self.values[item] if self.values is not None else None,
94+
track_names=self.track_names,
9195
other_batched=[x[item] for x in self.other_batched]
9296
if self.other_batched is not None
9397
else None,

0 commit comments

Comments
 (0)