larray-project / larray

N-dimensional labelled arrays in Python
https://larray.readthedocs.io/
GNU General Public License v3.0
8 stars 6 forks source link

Excel Sheet getitem slightly wrong on missing bound #1098

Open gdementen opened 4 months ago

gdementen commented 4 months ago

We transform the missing bound to the current size of the sheet, instead of selecting the entire row/column "the Excel way" (as if clicking the row/column "select all" button). In most cases, this is equivalent but in some situations (at least to insert new rows/columns, it is not). However, I vaguely remember I did this on purpose. I think it was simply that full row/column selection was not supported back then when I implemented this, but maybe there was some other negative consequence of using full rows. In any case, even though implementing the change itself should be quick & simple, this will have to be tested thoroughly on existing code (not only our test suite) to check it does not break anything.

#  Using this yields a strange result (shift cells but not line heights)
# rng = sheet[dst_row_num:dst_row_num + num_rows].xw_range
rng = sheet.xw_sheet[dst_row_num:dst_row_num + num_rows, :]
rng.insert(shift='down', copy_origin='format_from_left_or_above')

See also #1097 for the insert workaround.