Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 19, 2024
1 parent 48b436d commit 18ddcd0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions anndata/_core/file_backing.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ def filename(self) -> Path:

@filename.setter
def filename(self, filename: PathLike | None):
self._filename = None if filename is None \
else filename if isinstance(filename, remfile.RemFile.RemFile) \
self._filename = (
None
if filename is None
else filename
if isinstance(filename, remfile.RemFile.RemFile)
else Path(filename)
)

def open(
self,
Expand Down
8 changes: 6 additions & 2 deletions anndata/tests/test_readwrite.py
Original file line number Diff line number Diff line change
Expand Up @@ -799,13 +799,17 @@ def test_io_dtype(tmp_path, diskfmt, dtype):
assert curr.X.dtype == dtype


needs_remfile = pytest.mark.skipif(not find_spec("remfile"), reason="remfile is not installed")
needs_remfile = pytest.mark.skipif(
not find_spec("remfile"), reason="remfile is not installed"
)


@needs_remfile
def test_read_s3_remfile():
import remfile

# TODO: change to a different datafile?
url_had = "https://allen-brain-cell-atlas.s3.us-west-2.amazonaws.com/expression_matrices/WMB-10Xv2/20230630/WMB-10Xv2-TH-log2.h5ad"
file_had = remfile.File(url_had)
data = ad.read_h5ad(file_had, backed='r')
data = ad.read_h5ad(file_had, backed="r")
assert data.X.shape == (131212, 32285)

0 comments on commit 18ddcd0

Please sign in to comment.