diff --git a/src/otoole/cli.py b/src/otoole/cli.py index c0305f7..e1d971a 100644 --- a/src/otoole/cli.py +++ b/src/otoole/cli.py @@ -172,7 +172,7 @@ def get_parser(): result_parser.add_argument( "to_format", help="Result data format to convert to", - choices=sorted(["csv"]), + choices=sorted(["csv", "excel"]), ) result_parser.add_argument( "from_path", help="Path to file or folder to convert from" diff --git a/src/otoole/convert.py b/src/otoole/convert.py index 3cecd34..b1f1886 100644 --- a/src/otoole/convert.py +++ b/src/otoole/convert.py @@ -90,7 +90,7 @@ def convert_results( from_format : str Available options are 'cbc', 'cplex' and 'gurobi' to_format : str - Available options are 'csv' + Available options are 'csv', 'excel' from_path : str Path to cbc, cplex or gurobi solution file to_path : str @@ -125,7 +125,11 @@ def convert_results( write_defaults = True if write_defaults else False if to_format == "csv": - write_strategy = WriteCsv( + write_strategy: WriteStrategy = WriteCsv( + user_config=user_config, write_defaults=write_defaults + ) + elif to_format == "excel": + write_strategy = WriteExcel( user_config=user_config, write_defaults=write_defaults ) else: