OSeMOSYS / otoole

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

[FEATURE]: A public API to convert files and convert results #181

Closed willu47 closed 1 year ago

willu47 commented 1 year ago

Feature Request

While there is currently programmatic access to the internals of otoole, it is not very user-friendly and requires a user to know a lot about the internals of otoole.

I propose adding a public API which defines two functions, one for conversion of input files, and the second for conversion of results.

Is your feature related to a bug?

No response

Suggested Solution

Add two methods for conversion:

def convert(from_format, to_format, from_path, to_path, config) -> bool:
    """Convert OSeMOSYS input data from/to datafile/csv/excel formats
    """

def convert_results(from_format, to_format, from_path, to_path, config) -> bool:
    """Convert OSeMOSYS results from CBC/CPLEX/Gurobi to a folder of CSV files
    """

A user would then:

from otoole import convert

convert(from_format, to_format, from_path, to_path, config)

Additional Info

Further developments could wrap otoole functions to return the OSeMOSYS data as a dictionary of pandas DataFrames (as used internally), or an xarray.DataSet

willu47 commented 1 year ago

Closed by #180