Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ and this project adheres to [Semantic Versioning][].
[keep a changelog]: https://keepachangelog.com/en/1.1.0/
[semantic versioning]: https://semver.org/spec/v2.0.0.html

## [0.4.0] (unreleased)

### Changed

- `update()` no longer automatically pulls obs/var columns from individual modalities by default. Set `mudata.set_options(pull_on_update=true)`
to restore the old behavior. Use `pull_obs/pull_var` and `push_obs/push_var` for more flexibility.

## [0.3.4]

### Added
Expand Down Expand Up @@ -144,6 +151,7 @@ To copy the annotations explicitly, you will need to use `pull_obs()` and/or `pu

Initial `mudata` release with `MuData`, previously a part of the `muon` framework.

[0.4.0]: https://github.com/scverse/mudata/releases/tag/v0.4.0
[0.3.4]: https://github.com/scverse/mudata/releases/tag/v0.3.4
[0.3.3]: https://github.com/scverse/mudata/releases/tag/v0.3.3
[0.3.2]: https://github.com/scverse/mudata/releases/tag/v0.3.2
Expand Down
2 changes: 1 addition & 1 deletion src/mudata/_core/config.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import logging as log

OPTIONS = {"display_style": "text", "display_html_expand": 0b010, "pull_on_update": None}
OPTIONS = {"display_style": "text", "display_html_expand": 0b010, "pull_on_update": False}

_VALID_OPTIONS = {
"display_style": lambda x: x in ("text", "html"),
Expand Down
41 changes: 4 additions & 37 deletions src/mudata/_core/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
from anndata.compat import _read_attr
from scipy import sparse

from .config import OPTIONS
from .file_backing import AnnDataFileManager, MuDataFileManager
from .mudata import ModDict, MuData

Expand All @@ -46,22 +45,8 @@ def _is_openfile(obj) -> bool:
def _write_h5mu(file: h5py.File, mdata: MuData, write_data=True, **kwargs):
from .. import __anndataversion__, __mudataversion__, __version__

write_elem(
file,
"obs",
mdata.strings_to_categoricals(
mdata._shrink_attr("obs", inplace=False).copy() if OPTIONS["pull_on_update"] is None else mdata.obs.copy()
),
dataset_kwargs=kwargs,
)
write_elem(
file,
"var",
mdata.strings_to_categoricals(
mdata._shrink_attr("var", inplace=False).copy() if OPTIONS["pull_on_update"] is None else mdata.var.copy()
),
dataset_kwargs=kwargs,
)
write_elem(file, "obs", mdata.strings_to_categoricals(mdata.obs.copy()), dataset_kwargs=kwargs)
write_elem(file, "var", mdata.strings_to_categoricals(mdata.var.copy()), dataset_kwargs=kwargs)
write_elem(file, "obsm", dict(mdata.obsm), dataset_kwargs=kwargs)
write_elem(file, "varm", dict(mdata.varm), dataset_kwargs=kwargs)
write_elem(file, "obsp", dict(mdata.obsp), dataset_kwargs=kwargs)
Expand Down Expand Up @@ -157,26 +142,8 @@ def write_zarr(
# zarr_format is not supported in this version of zarr
file = zarr.open(store, mode="w")
mdata = data
write_elem(
file,
"obs",
mdata.strings_to_categoricals(
mdata._shrink_attr("obs", inplace=False).copy()
if OPTIONS["pull_on_update"] is None
else mdata.obs.copy()
),
dataset_kwargs=kwargs,
)
write_elem(
file,
"var",
mdata.strings_to_categoricals(
mdata._shrink_attr("var", inplace=False).copy()
if OPTIONS["pull_on_update"] is None
else mdata.var.copy()
),
dataset_kwargs=kwargs,
)
write_elem(file, "obs", mdata.strings_to_categoricals(mdata.obs.copy()), dataset_kwargs=kwargs)
write_elem(file, "var", mdata.strings_to_categoricals(mdata.var.copy()), dataset_kwargs=kwargs)
write_elem(file, "obsm", dict(mdata.obsm), dataset_kwargs=kwargs)
write_elem(file, "varm", dict(mdata.varm), dataset_kwargs=kwargs)
write_elem(file, "obsp", dict(mdata.obsp), dataset_kwargs=kwargs)
Expand Down
Loading
Loading