Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Previously written fields are not cleaned up #121

Open
ivirshup opened this issue Sep 19, 2023 · 0 comments
Open

Previously written fields are not cleaned up #121

ivirshup opened this issue Sep 19, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ivirshup
Copy link
Member

library(anndataR)
library(Matrix)

a = AnnData(obs_names=as.character(1:10), var_names=as.character(1:10), layer=list(foo=matrix(1, 10, 10)))
write_h5ad(a, "test.h5ad")

b = AnnData(obs_names=as.character(1:100), var_names=as.character(1:10), X=matrix(0, 100, 10))
write_h5ad(b, "test.h5ad")
$ h5ls -r test.h5ad
/                        Group
/X                       Dataset {100, 10}
/layers                  Group
/layers/foo              Dataset {10, 10}
/obs                     Group
/obs/_index              Dataset {100}
/obsm                    Group
/obsp                    Group
/uns                     Group
/var                     Group
/var/_index              Dataset {10}
/varm                    Group
/varp                    Group

layers/foo is still in the file, though b did not have that entry. layers/foo is also not of the correct shape, making the file invalid.

@ivirshup ivirshup added the bug Something isn't working label Sep 19, 2023
@rcannood rcannood self-assigned this Sep 19, 2023
@rcannood rcannood added this to the 1.0.0 milestone Sep 20, 2023
lazappi added a commit that referenced this issue Dec 5, 2023
Error if file exists and overwrite = FALSE

Fixes #121
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants