Skip to content

Commit 482ea4b

Browse files
authored
Merge pull request #60 from YosefLab/allow-overlap
default allow overlap
2 parents 6abf729 + c885ec1 commit 482ea4b

6 files changed

Lines changed: 167 additions & 101 deletions

File tree

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,18 @@ and this project adheres to [Semantic Versioning][].
1616

1717
### Fixed
1818

19+
## [0.2.2] - 2025-09-18
20+
21+
### Added
22+
23+
- `tdata.has_overlap` parameter to check whether the `TreeData` object contains overlapping trees (#59)
24+
25+
### Changed
26+
27+
- Default value for `tdata.allow_overlap` is now `True` (#60)
28+
29+
### Fixed
30+
1931
## [0.2.1] - 2025-07-10
2032

2133
### Added

docs/notebooks/getting-started.ipynb

Lines changed: 150 additions & 96 deletions
Large diffs are not rendered by default.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ requires = [ "hatchling" ]
44

55
[project]
66
name = "treedata"
7-
version = "0.2.1"
7+
version = "0.2.2"
88
description = "anndata with trees"
99
readme = "README.md"
1010
license = { file = "LICENSE" }

src/treedata/_core/treedata.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class TreeData(ad.AnnData):
7676
- `nodes`: All leaf and internal node names are present in the observation/variable names.
7777
- `subset`: A subset of leaf and internal node names are present in the observation/variable names.
7878
allow_overlap
79-
Whether trees containing overlapping sets of leaves or nodes are allowed. Default is False.
79+
Whether trees containing overlapping sets of leaves or nodes are allowed. Default is True.
8080
"""
8181

8282
def __init__(
@@ -98,7 +98,7 @@ def __init__(
9898
asview: bool = False,
9999
label: str | None = "tree",
100100
alignment: Literal["leaves", "nodes", "subset"] = "leaves",
101-
allow_overlap: bool = False,
101+
allow_overlap: bool = True,
102102
*,
103103
obsp: np.ndarray | Mapping[str, Sequence[Any]] | None = None,
104104
varp: np.ndarray | Mapping[str, Sequence[Any]] | None = None,

tests/test_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_attributes(X, tree, axis):
5151
assert getattr(tdata, f"{dim}t").dim == dim
5252
assert getattr(tdata, f"{dim}t").parent is tdata
5353
assert list(getattr(tdata, f"{dim}t").dim_names) == ["0", "1", "2"]
54-
assert tdata.allow_overlap is False
54+
assert tdata.allow_overlap is True
5555
assert tdata.has_overlap is False
5656
assert tdata.label is None
5757

tests/test_readwrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_read_anndata(X, tmp_path):
100100
tdata = td.read_h5td(file_path)
101101
assert np.array_equal(tdata.X, adata.X)
102102
assert tdata.label == "tree"
103-
assert tdata.allow_overlap is False
103+
assert tdata.allow_overlap is True
104104
assert tdata.alignment == "leaves"
105105
assert tdata.obst_keys() == []
106106

0 commit comments

Comments
 (0)