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

Accept matrix as input for writetable! #65

Closed
felixrehren opened this issue Oct 22, 2018 · 2 comments
Closed

Accept matrix as input for writetable! #65

felixrehren opened this issue Oct 22, 2018 · 2 comments
Labels
enhancement New feature or request

Comments

@felixrehren
Copy link
Contributor

Hello,

currently, there is some functionality for writing an AbstractVector (see source). By default, a vector is written into a single row.

How about extending the interface to enable the following ? I could make a pull request, but would such an extension be desirable?

  1. enable writing vectors into columns (same interface as writing into rows)
  2. enable writing 2-D arrays, i.e. AbstractMatrix directly to the sheet (similar interface)

This could lead to some design changes:

  • The functions available for data::AbstractVector where the row is an Integer and the argument for the columns is a UnitRange or a Colon could be duplicated with equivalent functions where instead the column is an Integer and the argument for the rows can be a UnitRange or a Colon
  • The functions available for data::AbstractVector could be duplicated, but allowing data::AbstractMatrix and corresponding possibilities for the row/column arguments
  • Base.setindex!(sheet::Worksheet, data::AbstractVector, ref_str::AbstractString) currently converts ref_str to a CellRef. Instead, one could try to convert it to either a CellRef or to a CellRange and then proceed accordingly
@felipenoris felipenoris added the enhancement New feature or request label Nov 18, 2018
@felipenoris
Copy link
Owner

felipenoris commented Nov 18, 2018

@felixrehren, the basic idea of a spreadsheet is to have a set of labeled columns. But there is also the kind of use case for matrices, like correlation matrices. So your proposal is welcome. Go ahead if you want to make a PR. Just try to make it non-beaking.

@felipenoris felipenoris changed the title Proposal: writing matrices to a sheet Accept matrix as input for writetable! Feb 16, 2019
felipenoris added a commit that referenced this issue Mar 27, 2019
@felipenoris
Copy link
Owner

Done in 8d95b42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants