| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## feat/json-io #2662 +/- ##
=================================================
+ Coverage 48.07% 85.98% +37.91%
=================================================
Files 50 50
Lines 8329 8356 +27
=================================================
+ Hits 4004 7185 +3181
+ Misses 4325 1171 -3154
|
Sorry, something went wrong.
There was a problem hiding this comment.
Discussion is a bit mangled now, but scverse/zarr-convention-dataframe#1 is quite a strong suggestion that seems simpler to implement. Maybe let's discuss there and then I will implement there (and you here) whatever mechanism we settle on (your implementation here of other data frame things does not have to match mine otherwise)
Sorry, something went wrong.
Documentation build overview156 files changed · + 8 added · ± 147 modified · - 1 deleted + Added
± Modified
- Deleted |
Sorry, something went wrong.
|
compat needs to be passed through write_use. Otherwise these fail: @pytest.mark.parametrize(
"existing", ["x", "x/y"], ids=["unescaped-group", "escaped-group"]
)
@pytest.mark.parametrize("key", ["a/b", "100%"])
@pytest.mark.parametrize(
"use", [lambda k: A.obsm[k], lambda _: A.obsm], ids=["single-key", "mapping"]
)
def test_use_escapes_keys(
diskfmt_store: Path | MemoryStore,
diskfmt: Literal["h5ad", "zarr"],
existing: str,
key: str,
use: Callable[[str], object],
) -> None:
"""`use=` escapes keys like a full write with the same `compat` does.
`100%` into an already escaped group is the silent case:
written literally, it would be read back as an escape sequence.
"""
adata = ad.AnnData(np.zeros((2, 3)), obsm={existing: np.zeros((2, 2))})
getattr(adata, f"write_{diskfmt}")(diskfmt_store, compat="0.14")
adata.obsm[key] = np.ones((2, 2))
getattr(adata, f"write_{diskfmt}")(diskfmt_store, use=use(key), compat="0.14")
back = getattr(ad, f"read_{diskfmt}")(diskfmt_store)
assert set(back.obsm) == {existing, key}
np.testing.assert_array_equal(back.obsm[key], np.ones((2, 2))) |
Sorry, something went wrong.
There was a problem hiding this comment.
anndata/src/anndata/_settings.py
Line 25 in c8bbe5a
Unrelated, going to suggest taking a page out of Davis' Bennet's book, and having Claude do an adversarial test of this. Can Claude come up with use-cases where this breaks?
Sorry, something went wrong.
| * The group's metadata MUST contain the encoding metadata `"encoding-type": "dict"`, `"encoding-version": "0.1.0"` | ||
|
|
||
| (mapping-escaped)= | ||
| ### Mapping specifications (v0.2.0) |
There was a problem hiding this comment.
Why only mapping? #2039 seems to be for data frames
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
This and the two PRs below it are I need in 0.14 (for scanpy 2.0 preview), except for .uns accessors.
See also zarr-developers/zarr-specs#128