-
Notifications
You must be signed in to change notification settings - Fork 23
Full accessor support #158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
111d118
add MuData accessors
ilia-kats 7580584
prevent X and layers accessors for MuData objects
ilia-kats d34fd49
add obsmap/varmap accessors
ilia-kats 8e303f7
fixup! prevent X and layers accessors for MuData objects
ilia-kats 8756654
add docs
ilia-kats c6e5c14
implement resolve()
ilia-kats 14de44a
fix docs
ilia-kats 35b2138
implement to/from_json
ilia-kats eba2cdb
add changelog entry and require anndata 0.13 for docs
ilia-kats 7dc6577
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] c18f8b4
docs: don't exclude X and layers from ModAcc
ilia-kats f43b7bb
fix test
ilia-kats 250b05c
export mudata.acc when available
ilia-kats 1f8b73b
add test
ilia-kats fae8a29
update for 0.13rc2
ilia-kats 701bbe3
[pre-commit.ci] pre-commit autoupdate (#162)
pre-commit-ci[bot] 24461e2
Update tests/test_accessors.py
ilia-kats 712d4c0
Revert "Update tests/test_accessors.py"
ilia-kats 2432894
add JSON schema
ilia-kats File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| {{ fullname | escape | underline}} | ||
|
|
||
| {%if fullname == "mudata.acc.MuAcc" %} | ||
| {% set attributes = attributes | select("ne", "X") | select("ne", "layers") %} | ||
| {% endif %} | ||
|
|
||
| .. currentmodule:: {{ module }} | ||
|
|
||
| .. autoclass:: {{ objname }} | ||
| :show-inheritance: | ||
|
|
||
| {% block attributes %} | ||
| {%- for item in attributes %} | ||
| {%- if loop.first %} | ||
| .. rubric:: Attributes | ||
| {% endif %} | ||
| .. autoattribute:: {{ item }} | ||
| {%- endfor %} | ||
| {% endblock %} | ||
|
|
||
| {% block methods %} | ||
| {%- for item in methods if item != "__init__" and item not in inherited_members %} | ||
| {%- if loop.first %} | ||
| .. rubric:: Methods | ||
| {% endif %} | ||
| .. automethod:: {{ item }} | ||
| {%- endfor %} | ||
| {% endblock %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Accessors and paths | ||
|
|
||
| ```{eval-rst} | ||
| .. module:: mudata.acc | ||
| ``` | ||
|
|
||
| [](#mudata.acc) provides [accessors](inv:anndata:*:term#accessor) that create [references](inv:anndata:*:term#reference) to axis-aligned 1D and 2D arrays in [MuData](#mudata.MuData) objects. | ||
| See the corresponding [AnnData documentation](inv:anndata:*:doc#accessors). | ||
|
|
||
| :::{important} | ||
| This functionality requires AnnData 0.13 or newer. | ||
| ::: | ||
|
|
||
| The central [accessor](inv:anndata:*:term#accessor) is [](#A). | ||
| ```{eval-rst} | ||
| .. autodata:: A | ||
| ``` | ||
| See [](#MuAcc) and [AdAcc](#anndata.acc.AdAcc) for examples of how to use it to create [references](inv:anndata:*:term#reference) (i.e. [AdRefs](#anndata.acc.AdRef)). | ||
|
|
||
| ```{eval-rst} | ||
| .. autosummary:: | ||
| :toctree: generated | ||
| :template: class-accessor | ||
|
|
||
| MuAcc | ||
| MultiModAcc | ||
| ModAcc | ||
| ModMapAcc | ||
| ModMetaAcc | ||
| ModLayerAcc | ||
| ModGraphAcc | ||
| ModMultiAcc | ||
| ModMultiMapAcc | ||
| ModGraphMapAcc | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from __future__ import annotations | ||
|
|
||
| from typing import TYPE_CHECKING, Generic, get_origin | ||
|
|
||
| from sphinx.util.typing import ExtensionMetadata | ||
|
|
||
| if TYPE_CHECKING: | ||
| from sphinx.application import Sphinx | ||
|
|
||
|
|
||
| def skip_private_bases(app: Sphinx, name: str, obj: type, _unused, bases: list[type]) -> None: | ||
| bases[:] = [b for b in bases if b is not object if get_origin(b) is not Generic if not b.__name__.startswith("_")] | ||
|
|
||
|
|
||
| def setup(app: Sphinx) -> ExtensionMetadata: | ||
| app.connect("autodoc-process-bases", skip_private_bases) | ||
| return ExtensionMetadata(parallel_read_safe=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.