Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Dec 15, 2024
1 parent 908524a commit d2c317d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
merge-multiple: true

- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@release/v1

# build-docker:
# needs: [build-and-test, build-wheel]
Expand Down
3 changes: 2 additions & 1 deletion snapatac2-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ homepage = "https://github.com/"
keywords = ["single-cell", "biology"]

[dependencies]
anndata = "0.6.1"
#anndata = "0.6.1"
anndata = { git = "https://github.com/kaizhang/anndata-rs.git", rev = "0d27ac475634ed7703ab1a23e01e6a3031a28541"}
anyhow = "1.0"
bstr = "1.0"
byteorder = "1.0"
Expand Down
12 changes: 8 additions & 4 deletions snapatac2-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@ keywords = ["single-cell", "biology"]

[dependencies]
snapatac2-core = { workspace = true }
anndata = "0.6.1"
anndata-hdf5 = "0.5"
anndata-zarr = "0.1"
pyanndata = "0.5.1"
#anndata = "0.6.1"
anndata = { git = "https://github.com/kaizhang/anndata-rs.git", rev = "0d27ac475634ed7703ab1a23e01e6a3031a28541"}
#anndata-hdf5 = "0.5"
anndata-hdf5 = { git = "https://github.com/kaizhang/anndata-rs.git", rev = "0d27ac475634ed7703ab1a23e01e6a3031a28541"}
#anndata-zarr = "0.1"
anndata-zarr = { git = "https://github.com/kaizhang/anndata-rs.git", rev = "0d27ac475634ed7703ab1a23e01e6a3031a28541"}
#pyanndata = "0.5.1"
pyanndata = { git = "https://github.com/kaizhang/anndata-rs.git", rev = "0d27ac475634ed7703ab1a23e01e6a3031a28541"}
anyhow = "1.0"
bed-utils = "0.7.1"
flate2 = "1.0"
Expand Down
6 changes: 3 additions & 3 deletions snapatac2-python/python/snapatac2/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,23 +27,23 @@ def anndata_ipar(inputs, func, n_jobs=4):
from multiprocess import get_context

def _func(x):
adata = internal.read(x[1])
adata = internal.read(x[1], backend=x[2])
result = func((x[0], adata))
adata.close()
return result

# Close the AnnData objects and return the filenames
files = []
for i, adata in inputs:
files.append((i, adata.filename))
files.append((i, adata.filename, adata.backend))
adata.close()

with get_context("spawn").Pool(n_jobs) as p:
result = list(tqdm(p.imap(_func, files), total=len(files)))

# Reopen the files if they were closed
for _, adata in inputs:
adata.open()
adata.open(mode='r+')

return result

Expand Down

0 comments on commit d2c317d

Please sign in to comment.