Skip to content

Commit

Permalink
Merge branch 'main' into feature/gpu_ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirshup authored Jul 25, 2023
2 parents 0429840 + 0c4c0b0 commit a3d23c9
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ __pycache__/
/*.egg-info/
/requirements*.lock
/.python-version
/hatch.toml

# Tests and coverage
/.pytest_cache/
/.cache/
/*cache/
/data/
/tmp.zarr/
test.h5ad
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repos:
- id: black
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: "v0.0.278"
rev: "v0.0.280"
hooks:
- id: ruff
args: ["--fix"]
Expand Down
1 change: 1 addition & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ build:
python: "3.10"
sphinx:
configuration: docs/conf.py
fail_on_warning: true # do not change or you will be fired
python:
install:
- method: pip
Expand Down
4 changes: 2 additions & 2 deletions anndata/_core/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def __copy__(self) -> AwkArray:
array = self
# makes a shallow copy and removes the reference to the original AnnData object
array = ak.with_parameter(self, _PARAM_NAME, None)
array = ak.with_parameter(array, "__array__", None)
array = ak.with_parameter(array, "__list__", None)
return array

@as_view.register(AwkArray)
Expand All @@ -367,7 +367,7 @@ def as_view_awkarray(array, view_args):
"Please open an issue in the AnnData repo and describe your use-case."
)
array = ak.with_parameter(array, _PARAM_NAME, (parent_key, attrname, keys))
array = ak.with_parameter(array, "__array__", "AwkwardArrayView")
array = ak.with_parameter(array, "__list__", "AwkwardArrayView")
return array

ak.behavior["AwkwardArrayView"] = AwkwardArrayView
Expand Down
14 changes: 13 additions & 1 deletion anndata/tests/test_awkward.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,20 @@ def test_view(key):
def test_view_of_awkward_array_with_custom_behavior():
"""Currently can't create view of arrays with custom __name__ (in this case "string")
See https://github.com/scverse/anndata/pull/647#discussion_r963494798_"""

from uuid import uuid4

BEHAVIOUR_ID = str(uuid4())

class ReversibleArray(ak.Array):
def reversed(self):
return self[..., ::-1]

ak.behavior[BEHAVIOUR_ID] = ReversibleArray
adata = gen_adata((3, 3), varm_types=(), obsm_types=(), layers_types=())
adata.obsm["awk_string"] = ak.Array(["AAA", "BBB", "CCC"])
adata.obsm["awk_string"] = ak.with_parameter(
ak.Array(["AAA", "BBB", "CCC"]), "__list__", BEHAVIOUR_ID
)
adata_view = adata[:2]

with pytest.raises(NotImplementedError):
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@

def setup(app: Sphinx):
# Don’t allow broken links. DO NOT CHANGE THIS LINE, fix problems instead.
app.warningiserror = False
app.warningiserror = True


intersphinx_mapping = dict(
Expand Down
3 changes: 2 additions & 1 deletion docs/release-notes/0.9.2.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
### 0.9.2 {small}`the future`
### 0.9.2 {small}`2023-07-25`

```{rubric} Bugfix
```

* Views of `awkward.Array`s now work with `awkward>=2.3` {pr}`1040` {user}`ivirshup`
* Fix ufuncs of views like `adata.X[:10].cov(axis=0)` returning views {pr}`1043` {user}`flying-sheep`
* Fix instantiating AnnData where `.X` is a `DataFrame` with an integer valued index {pr}`1002` {user}`flying-sheep`
* Fix {func}`~anndata.read_zarr` when used on `zarr.Group` {pr}`1057` {user}`ivirshup`
4 changes: 4 additions & 0 deletions docs/release-notes/0.9.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### 0.9.3 {small}`the future`

```{rubric} Bugfix
```
3 changes: 3 additions & 0 deletions docs/release-notes/release-latest.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
```
## Version 0.9

```{include} /release-notes/0.9.3.md
```

```{include} /release-notes/0.9.2.md
```

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ test = [
"boltons",
"scanpy",
"dask[array]",
"awkward>=2.0.8,<2.3",
"awkward>=2.3",
"pytest_memray",
]
gpu = [
Expand Down

0 comments on commit a3d23c9

Please sign in to comment.