Incorrect width values returned for neighboring columns with the same width
If more than one column in sequence have the same width, then sheet.column_dimensions[col_letter].width return correct with value only for first column in this range.
For example i have width values for columns J-L equal to 15 but i get 'J': 15.77734375, 'K': 13.0, 'L': 13.0. It might not be too bad, but value of 13 is also default for colums with no custom width, so there is no way of knowing if returned value of 13 means that column have no custom width or is it in range of columns of the same width.
For now i am using temporary workaround in _reader.py file in function parse_column_dimensions:
# ORIGINAL
def parse_column_dimensions(self, col):
attrs = dict(col.attrib)
column = get_column_letter(int(attrs['min']))
attrs['index'] = column
self.column_dimensions[column] = attrs
# MY WORKAOROUD
def parse_column_dimensions(self, col):
attrs = dict(col.attrib)
min_column = int(attrs['min'])
max_column = int(attrs['max'])
for col_idx in range(min_column, max_column+1):
column = get_column_letter(col_idx)
attrs['index'] = column
self.column_dimensions[column] = attrs
Additionally i think that sheet.column_dimensions[col_letter].width should return None if column have no custom width value. It would be more consistent with result of row height
I attach my example xlsx file dimensions_test.xlsx