Skip to content

Collection.save(): support xlsx and json formats #789

Description

@jepegit

Problem

Collection.save(directory, formats=...) (cellpy/collect/collection.py) only
handles parquet and csv:

else:
    raise ValueError(f"unsupported collection format {fmt!r}")

even though SaveOptions.formats reads like it's meant to be extensible, and "a
collection is a product you can save in different formats" is part of the design.

In the app's export menu I serialise xlsx / json myself:
collection.data.to_pandas().to_excel(...) and collection.data.write_json().

Suggestion

Support xlsx and json in Collection.save / SaveOptions.formats (polars has
write_json; xlsx via to_pandas().to_excel or polars.write_excel). Then apps get
multi-format export "for free" as intended.


Found while building cellpy-simple-gui on cellpy 2.1.0.post1. Full write-up with all items: CELLPY_PAINPOINTS.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementv2cellpy v2 work - PRs should target the master branch

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions