Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizhang committed Feb 28, 2024
1 parent 9aab385 commit 9809ece
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyanndata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pyanndata"
version = "0.3.0"
version = "0.3.1"
edition = "2021"
rust-version = "1.70"
authors = ["Kai Zhang <kai@kzhang.org>"]
Expand Down
3 changes: 2 additions & 1 deletion pyanndata/src/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ impl PyDataFrameElem {
self.0.get(subscript)
}

fn __setitem__(&self, key: &str, data: PySeries) -> Result<()> {
fn __setitem__(&self, key: &str, data: &PyAny) -> Result<()> {
let data: PySeries = data.py().import("polars")?.call_method1("Series", (data, ))?.extract()?;
self.0.set(key, data.into())
}

Expand Down
1 change: 1 addition & 0 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"anndata>=0.8",
"numpy>=1.16",
"pandas",
"pyarrow",
"scipy>=1.4",
"polars>=0.14",
],
Expand Down
1 change: 1 addition & 0 deletions python/tests/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def test_creation(tmp_path):
adata.uns['df'] = pd.DataFrame([[1, 2, 3], [4, 5, 6]], columns=["a", "b", "c"])

adata.obs = pl.DataFrame({"a": ['1', '2'], "b": [3, 4]})
adata.obs['c'] = np.array([1, 2])
obs_names = list(adata.obs['a'])
adata.obs_names = obs_names
adata.obs = pl.DataFrame()
Expand Down

0 comments on commit 9809ece

Please sign in to comment.