Skip to content

Commit 0406134

Browse files
authored
Merge branch 'main' into template-update-v2-YosefLab-treedata-v0.7.0
2 parents cc183fd + c863de5 commit 0406134

36 files changed

Lines changed: 4806 additions & 339 deletions

.codecov.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ coverage:
66
status:
77
project:
88
default:
9-
# Require 1% coverage, i.e., always succeed
10-
target: 1
9+
target: 85
1110
patch: false
1211
changes: false
1312

.github/workflows/test.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ jobs:
3838
| {
3939
name: .key,
4040
label: (if (.key | contains("pre")) then .key + " (PRE-RELEASE DEPENDENCIES)" else .key end),
41-
python: .value.python
41+
python: .value.python,
42+
allow_failure: (.key | contains("pre"))
4243
}
4344
)')
4445
echo "envs=${ENVS_JSON}" | tee $GITHUB_OUTPUT
@@ -59,6 +60,8 @@ jobs:
5960
runs-on: ${{ matrix.os }}
6061
continue-on-error: ${{ contains(matrix.env.name, 'pre') }} # make "all-green" pass even if pre-release job fails
6162

63+
continue-on-error: ${{ matrix.env.allow_failure }}
64+
6265
steps:
6366
- uses: actions/checkout@v5
6467
with:
@@ -82,7 +85,11 @@ jobs:
8285
test -f .coverage || uvx hatch run ${{ matrix.env.name }}:cov-combine
8386
uvx hatch run ${{ matrix.env.name }}:cov-report # report visibly
8487
uvx hatch run ${{ matrix.env.name }}:coverage xml # create report for upload
88+
# Quick sanity check
89+
grep -m1 'filename=' -n coverage.xml || { echo "coverage.xml missing filenames"; exit 1; }
8590
- name: Upload coverage
91+
env:
92+
CODECOV_TOKEN: ${{ secrets.CODECOV }}
8693
uses: codecov/codecov-action@v5
8794
with:
8895
fail_ci_if_error: true

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.DS_Store
33
*~
44
buck-out/
5+
*._*
56

67
# Compiled files
78
.venv/
@@ -19,3 +20,13 @@ __pycache__/
1920
# docs
2021
/docs/generated/
2122
/docs/_build/
23+
24+
# IDEs
25+
/.idea/
26+
/.vscode/
27+
28+
# Prettier
29+
/node_modules/
30+
31+
# Environment
32+
environment.yml

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@
1515
"python.analysis.typeCheckingMode": "basic",
1616
"python.testing.pytestEnabled": true,
1717
"python.testing.pytestArgs": ["-vv", "--color=yes"],
18+
"python.analysis.diagnosticSeverityOverrides": {
19+
"reportMissingImports": "none",
20+
"reportGeneralTypeIssues": "none",
21+
},
1822
}

CHANGELOG.md

Lines changed: 158 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,161 @@ and this project adheres to [Semantic Versioning][].
1212

1313
### Added
1414

15-
- Basic tool, preprocessing and plotting functions
15+
### Changed
16+
17+
### Fixed
18+
19+
## [0.2.4] - 2025-11-05
20+
21+
### Added
22+
23+
### Changed
24+
25+
- Deprecated `TreeData.obst_keys` and `TreeData.vart_keys` for consistency with AnnData (https://github.com/scverse/anndata/pull/2093) (#73)
26+
27+
### Fixed
28+
29+
- Added support for zarr v3 (#73)
30+
- Eliminated deprecations warnings from AnnData>=0.12.0 (#73)
31+
32+
## [0.2.3] - 2025-10-14
33+
34+
### Added
35+
36+
### Changed
37+
38+
- Optimized tree overlap detection to speed up copying and subsetting with many trees (#66)
39+
- Switch to hatch with v0.0.6 template update (#61)
40+
41+
### Fixed
42+
43+
- Fixed codecov configuration (#64)
44+
45+
## [0.2.2] - 2025-09-18
46+
47+
### Added
48+
49+
- `tdata.has_overlap` parameter to check whether the `TreeData` object contains overlapping trees (#59)
50+
51+
### Changed
52+
53+
- Default value for `tdata.allow_overlap` is now `True` (#60)
54+
55+
### Fixed
56+
57+
## [0.2.1] - 2025-07-10
58+
59+
### Added
60+
61+
- support for instantiating `TreeData` objects with only the tree structure (#56)
62+
63+
### Changed
64+
65+
- Updated docs to clarify all the ways `TreeData` can be instantiated (#56)
66+
67+
### Fixed
68+
69+
## [0.2.0] - 2025-06-16
70+
71+
### Added
72+
73+
- `alignment` parameter which allows for `obs_names` and `var_names` aligned to either the leaves, nodes, or a subset of leaves and nodes in trees stored in the `obst` and `vart` fields. Added a tutorial describing how `alignment` works (#55)
74+
75+
### Changed
76+
77+
- `read_h5ad` and `write_h5ad` and been renamed `read_h5td` and `write_h5td` to clarify that the `treedata` format differs from `anndata`. `read_h5ad` and `write_h5ad` will be removed in `v1.0.0` (#56)
78+
79+
### Fixed
80+
81+
- Fixed typing issues (#51)
82+
83+
## [0.1.3] - 2025-01-20
84+
85+
### Added
86+
87+
### Changed
88+
89+
### Fixed
90+
91+
- Fixed typing issues (#51)
92+
93+
- Fixed `ImportError: zarr-python major version > 2 is not supported'` error with Python 12 (#46)
94+
95+
## [0.1.2] - 2024-12-02
96+
97+
### Added
98+
99+
### Changed
100+
101+
### Fixed
102+
103+
- Fixed `KeyError: "Unable to synchronously open object (object 'X' doesn't exist)"'` when reading h5ad without X field (#40)
104+
105+
## [0.1.1] - 2024-11-25
106+
107+
### Added
108+
109+
- Axis in `td.concat` can now be specified with `obs` and `var` (#40)
110+
111+
### Changed
112+
113+
### Fixed
114+
115+
- Fixed `ImportError: cannot import name '_resolve_dim' from 'anndata._core.merge'` caused by anndata update (#40)
116+
117+
## [0.1.0] - 2024-09-27
118+
119+
### Added
120+
121+
### Changed
122+
123+
- Encoding of `treedata` attributes in h5ad and zarr files. `label`, `allow_overlap`, `obst`, and `vart` are now separate fields in the file. (#31)
124+
125+
### Fixed
126+
127+
- `TreeData` objects with `.raw` specified can now be read (#31)
128+
129+
## [0.0.4] - 2024-09-02
130+
131+
### Added
132+
133+
### Changed
134+
135+
### Fixed
136+
137+
- Fixed typing bug introduced by anndata update (#29)
138+
139+
## [0.0.3] - 2024-08-21
140+
141+
### Added
142+
143+
- Add concatenation tutorial to documentation (#27)
144+
145+
### Changed
146+
147+
- `obst` and `vart` create local copy of `nx.DiGraphs` that are added (#26)
148+
- `TreeData.label` value remains the same after `td.concat` as long as all `label` values are the same for all objects (#27)
149+
150+
### Fixed
151+
152+
- Fixed bug which caused key to be listed twice in `label` column after value update in `obst` or `vart` (#26)
153+
154+
## [0.0.2] - 2024-06-18
155+
156+
### Changed
157+
158+
- Empty trees are now allowed to avoid error on subsetting (#13)
159+
- How trees are stored in h5ad and zarr files (#16)
160+
- Format of label column with multiple trees ([1,2] -> 1,2) (#16)
161+
162+
### Fixed
163+
164+
- Fixed issue with slow read/write of large trees
165+
166+
## [0.0.1] - 2024-05-13
167+
168+
### Added
169+
170+
- TreeData class for storing and manipulating trees
171+
- Read/write trees to h5ad and zarr files
172+
- Concatenate trees with similar API to AnnData

README.md

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,40 @@
1-
# treedata
2-
31
[![Tests][badge-tests]][link-tests]
42
[![Documentation][badge-docs]][link-docs]
3+
[![PyPI](https://img.shields.io/pypi/v/treedata.svg)](https://pypi.org/project/treedata)
4+
[![codecov](https://codecov.io/github/YosefLab/treedata/branch/main/graph/badge.svg?token=YPhuxlw4my)](https://codecov.io/github/YosefLab/treedata)
5+
[![PyPI Downloads](https://static.pepy.tech/personalized-badge/treedata?period=total&units=INTERNATIONAL_SYSTEM&left_color=GREY&right_color=GREEN&left_text=downloads)](https://pepy.tech/projects/treedata)
56

6-
[badge-tests]: https://img.shields.io/github/actions/workflow/status/colganwi/treedata/test.yaml?branch=main
7-
[link-tests]: https://github.com/YosefLab/treedata/actions/workflows/test.yml
7+
[badge-tests]: https://img.shields.io/github/actions/workflow/status/YosefLab/treedata/test.yaml?branch=main
8+
[link-tests]: https://github.com/YosefLab/treedata/actions/workflows/test.yaml
89
[badge-docs]: https://img.shields.io/readthedocs/treedata
910

10-
anndata with trees
11+
<img
12+
src="https://raw.githubusercontent.com/YosefLab/treedata/main/docs/_static/img/treedata_schema.svg"
13+
class="dark-light" align="right" width="350" alt="image"
14+
/>
15+
16+
# TreeData - AnnData with trees
1117

12-
## Getting started
18+
TreeData is a lightweight wrapper around AnnData which adds two additional attributes, `obst` and `vart`, to store [nx.DiGraph] trees for observations and variables. TreeData has the same interface as AnnData and is fully compatible with [scverse] packages like [Scanpy].
1319

14-
Please refer to the [documentation][link-docs]. In particular, the
20+
To learn more about TreeData, please refer to the [documentation][link-docs] or checkout the [getting started guide][link-getting-started].
1521

16-
- [API documentation][link-api].
22+
See the [Pycea documentation](https://pycea.readthedocs.io/) to learn how TreeData can be used to analyze single-cell lineage tracing data.
1723

1824
## Installation
1925

20-
You need to have Python 3.9 or newer installed on your system. If you don't have
26+
You need to have Python 3.10 or newer installed on your system. If you don't have
2127
Python installed, we recommend installing [Mambaforge](https://github.com/conda-forge/miniforge#mambaforge).
2228

2329
There are several alternative options to install treedata:
2430

25-
<!--
26-
1) Install the latest release of `treedata` from `PyPI <https://pypi.org/project/treedata/>`_:
31+
1. Install the latest release of `treedata` from [PyPI](https://pypi.org/project/treedata):
2732

2833
```bash
2934
pip install treedata
3035
```
31-
-->
3236

33-
1. Install the latest development version:
37+
2. Install the latest development version:
3438

3539
```bash
3640
pip install git+https://github.com/YosefLab/treedata.git@main
@@ -42,15 +46,18 @@ See the [changelog][changelog].
4246

4347
## Contact
4448

45-
For questions and help requests, you can reach out in the [scverse discourse][scverse-discourse].
46-
If you found a bug, please use the [issue tracker][issue-tracker].
49+
For questions and bug reports please use the [issue tracker][issue-tracker].
4750

4851
## Citation
4952

5053
> t.b.a
5154
55+
[scverse]: https://scverse.org/
56+
[Scanpy]: https://scanpy.readthedocs.io/
57+
[nx.DiGraph]: https://networkx.org/documentation/stable/reference/classes/digraph.html
5258
[scverse-discourse]: https://discourse.scverse.org/
53-
[issue-tracker]: https://github.com/colganwi/treedata/issues
54-
[changelog]: https://treedata.readthedocs.io/latest/changelog.html
59+
[issue-tracker]: https://github.com/YosefLab/treedata/issues
60+
[changelog]: https://treedata.readthedocs.io/en/latest/changelog.html
5561
[link-docs]: https://treedata.readthedocs.io
62+
[link-getting-started]: https://treedata.readthedocs.io/en/latest/notebooks/getting-started.html
5663
[link-api]: https://treedata.readthedocs.io/latest/api.html

0 commit comments

Comments
 (0)