-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first attempt to support awkward arrays (#647)
* first attempt to support awkward arrays * remove comments * better comment * add type to gen_adata * first attempt at concat * remove comment * add outer concat * add awkward to test dep * add awk arr to data gen * fix test base * init test for concat * fix concatenate tests * create mock class for awkward array * remove space * import ak when needed * relative import of awk array * fix optional dep import * resolve conflicts * draft IO for akward arrays * add awkward to docs and save form to attrs * Update dependencies * Update dim_len * ignore vscode directory * Validate that awkward arrays align to axes * Fix reindexing during merge * fix lint * remove duplicate import * Test different types of awkward arrays in different slots * Better function to generate awkward arrays * Better dim_len for awkward arrays * Working out how to best check the dim_len * Only accept awkward arrays that are "regular" in the aligned dimension The conversion is left to the user. Explicit is better than implicit. * Switch to v2 API * WIP rewrite awkward array generation * Improve awkward array generation and dim_len check * Switch to new awkward array generation in all tests * Fix test_transpose * Fix/workaround more tests * Add test for setting anndata slots to awkward arrays * enable tests for 3d ragged array in layers * Cleanup * Fix that X could not be set when creating AnnData object from scratch. Apparently the checks are quite different than when adding a Layer. * Remove code to make awkward array regular after merge. This is now done by the awkward array library. * Do not explicitly copy awkward arrays * Implement transposing awkward arrays * Add docs stub and update type hints * Fix: dtype not available during merge if both X are awkward * Fix IO * Request pre-release version of awkward * Exclude awkward layer in loom tests * Pull in only changes relevant to obsm/varm * Update tests * Fix type hints * Update error message in algined mapping * Use compat module to support both awkward v1.9rc and 2.x * restructure tests * Add tests for copies and view * Remove unused imoport * Fix how actual shape is computed in aligned mapping * Attempt to support views with ak.behavior * Use shallow copy * Add dim_len_awkward function including tests * Test that assigning an awkward v1 arrays fails * Add stub for element-wise IO tests * Restructur dim_len_awkward * Add more test cases for awkward IO * WIP add tests for concatenating AwkArrays with missing values * Fix AwkwardArrayView * Simplify awkward array view code * Use None to remove name from awkward array * Mark test_no_awkward_v1 as xfail for uns * Add test for categorical arrays * Update docs/fileformat-prose.rst Co-authored-by: Isaac Virshup <[email protected]> * Update anndata/_core/aligned_mapping.py Co-authored-by: Isaac Virshup <[email protected]> * Update anndata/tests/helpers.py Co-authored-by: Isaac Virshup <[email protected]> * Update awkward tests to use assert_equal with exact=True * Bump required version * Update categorical syntax, add new categorical test * Start concat tests for awkward * Add release notes * Add testcases for dim_len with awkward arrays of strings * Fix dim_len for arrays of strings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Awkward v2 fixes Several functions changed until the stable awkward v2 version was released. * Exclude awkward arrays from fill_value concat test * fix flake8 * Add IO testcase for AIRR data * Fix link * Get inner join working for concatenation * Bump some concatenation cases to a later PR * Generate empty arrays for outer join * Raise NotImplementedError when creating a view of an awkward array with custom behavior * Add warning when setting awkward array in aligned mapping * Get much more of concatenation 'working' * Use warning instead of logging * extend todo comment about views * Fix IO, and to_memory for views of awkward arrays * Removed a number of test cases that we're not targeting This fixed a number of tests because we had a 1d awkward array being generated, and we currently don't support 1d arrays in obsm well. Tracked in #652. * Implement outer indexing on axis 0 of an awkward array * Fix gen_awkward when one of the dimensions has size 0 * Fix equality function for awkward arrays. Was throwing an error when the arrays weren't broadcastable. * Modify outer concatenation test to accept current behaviour of awkward array * Add tests for mixed type concatenation with awkward arrays * Add warning about outer joins * Call ak._util.arrays_approx_equal instead of rolling our own * update awkward to 2.0.7 (unfortunately: errors) * remove unnecessary checks from AwkwardArrayView * Workaround scikit-hep/awkward#2209 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Removed extra layer of nesting from on-disk format for awkward arrays --------- Co-authored-by: Gregor Sturm <[email protected]> Co-authored-by: Isaac Virshup <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
4ccf91c
commit a9e634c
Showing
19 changed files
with
1,049 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -27,4 +27,5 @@ test.h5ad | |
|
||
# IDEs | ||
/.idea/ | ||
/.vscode/ | ||
|
This file contains 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 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 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 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 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 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.