Skip to content

[python] Outgest additional X layers to AnnData #2119

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 10 commits into from
Feb 14, 2024

Conversation

johnkerl
Copy link
Member

@johnkerl johnkerl commented Feb 8, 2024

Issue and/or context: Issue #2079

Copy link

codecov bot commented Feb 8, 2024

Codecov Report

Merging #2119 (33e5679) into main (5647fb4) will increase coverage by 4.72%.
The diff coverage is n/a.

❗ Current head 33e5679 differs from pull request most recent head d8aa814. Consider uploading reports for the commit d8aa814 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2119      +/-   ##
==========================================
+ Coverage   67.05%   71.77%   +4.72%     
==========================================
  Files          49      101      +52     
  Lines        2577     6920    +4343     
  Branches      211      211              
==========================================
+ Hits         1728     4967    +3239     
- Misses        747     1851    +1104     
  Partials      102      102              
Flag Coverage Δ
libtiledbsoma 66.97% <ø> (-0.08%) ⬇️
r 74.62% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
python_api ∅ <ø> (∅)
libtiledbsoma 48.34% <ø> (ø)

@johnkerl
Copy link
Member Author

johnkerl commented Feb 9, 2024

@aaronwolen @mojaveazure ping 🙏

1 similar comment
@johnkerl
Copy link
Member Author

@aaronwolen @mojaveazure ping 🙏

Copy link
Member

@aaronwolen aaronwolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limiting the user's export options to either all or none of the X layers may be too inflexible. Ideally, they should be able to specify any subset of the layers they want.

@johnkerl
Copy link
Member Author

@aaronwolen thanks!

To avoid length iteration cycles, please take a minute or two to simply offer a candidate method signature, and I will do what you ask

Thank you in advance!

@johnkerl johnkerl changed the title [python] Outgest all X layers to AnnData [python] Outgest additional X layers to AnnData Feb 13, 2024
@johnkerl johnkerl marked this pull request as draft February 13, 2024 17:52
@johnkerl johnkerl force-pushed the kerl/outgest-all-X-layers branch 2 times, most recently from c9b0417 to de0f301 Compare February 13, 2024 18:33
@johnkerl johnkerl marked this pull request as ready for review February 13, 2024 18:35
@johnkerl johnkerl force-pushed the kerl/outgest-all-X-layers branch from 4fe35e2 to 73db536 Compare February 13, 2024 20:21
@johnkerl
Copy link
Member Author

johnkerl commented Feb 13, 2024

I don't know why this is suddenly failing CI in files I did not touch (Python 3.7 only).

I am actively debugging.

Copy link
Member

@aaronwolen aaronwolen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the productive discussions. Tested it out and it works great.

johnkerl added a commit that referenced this pull request Feb 13, 2024
johnkerl added a commit that referenced this pull request Feb 13, 2024
@johnkerl
Copy link
Member Author

I don't know why this is now failing Python 3.7 CI on tests which I did not touch. It passes tests for me on my laptop. I will iteratively debug on #2137.

# ----------------------------------------------------------------
def to_anndata(
experiment: Experiment,
measurement_name: str,
*,
X_layer_name: Optional[str] = "data",
extra_X_layer_names: Optional[
Union[Sequence[str], collections.abc.KeysView[str]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be typing.KeysView for 3.7 compatibility.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @ihnorton !!!!!

@johnkerl johnkerl force-pushed the kerl/outgest-all-X-layers branch from 71e2dd6 to 8824532 Compare February 14, 2024 04:07
@johnkerl johnkerl dismissed mojaveazure’s stale review February 14, 2024 17:56

Requested changes were made

@johnkerl johnkerl merged commit d9c4e07 into main Feb 14, 2024
@johnkerl johnkerl deleted the kerl/outgest-all-X-layers branch February 14, 2024 17:57
Copy link

The backport to release-1.7 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-1.7 release-1.7
# Navigate to the new working tree
cd .worktrees/backport-release-1.7
# Create a new branch
git switch --create backport-2119-to-release-1.7
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick --mainline 1 d9c4e07eb8e05a99218df3876244a2de025f5ae5
# Push it to GitHub
git push --set-upstream origin backport-2119-to-release-1.7
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-1.7

Then, create a pull request where the base branch is release-1.7 and the compare/head branch is backport-2119-to-release-1.7.

johnkerl added a commit that referenced this pull request Feb 14, 2024
* [python] Outgest all X layers to AnnData

* Unit-test coverage

* typofix

* doc-string and API update; impl on next commit, and unit-test cases after that

* code mods to match API/docstrings; unit-test updates on next commit

* updated unit-test cases

* compatibility

* ihnorton advice

* merge
johnkerl added a commit that referenced this pull request Feb 14, 2024
* [python] Outgest all X layers to AnnData

* Unit-test coverage

* typofix

* doc-string and API update; impl on next commit, and unit-test cases after that

* code mods to match API/docstrings; unit-test updates on next commit

* updated unit-test cases

* compatibility

* ihnorton advice

* merge
@aaronwolen
Copy link
Member

[sc-40032]

Copy link

This pull request has been linked to Shortcut Story #40032: Support exporting additional X layers to anndata.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants