OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
25 stars 19 forks source link

Long parameter names cause an error in writing to an Excel spreadsheet #128

Closed willu47 closed 1 year ago

willu47 commented 2 years ago

As described in the comments below #127, when writing out to an Excel file, any parameter names longer than 31 characters cannot be written as sheet names due to a constraint in Excel.

The current solution is to use a hard-coded lookup to swap out long names for shorter names.

This needs to be replaced with a more flexible solution

willu47 commented 2 years ago

After thinking about this, I think we can:

  1. Check config file for parameter names longer than 31 characters and raise a warning to the user
  2. Support a short_name field in the configuration file which allows users to suggest an alternative name of 30 characters or less which is used in Excel conversions
  3. Create the mapping dictionary from the short_name and name fields and otherwise leave the codebase the same for the ReadExcel and WriteExcel classes.
trevorb1 commented 1 year ago

Completed with PR #131.

Are you able to close this one please @willu47. Sorry, I don't have permissions to close issues I'm not assigned to :)