otoole icon indicating copy to clipboard operation
otoole copied to clipboard

Return OSeMOSYS data as an xarray.DataSet

Open willu47 opened this issue 1 year ago • 0 comments

An inelegant/experimental implementation on the ReadStrategy class which returns an xarray.DataSet object of OSeMOSYS model data

Description

xarray.DataSet provides a number of advantages for dealing with OSeMOSYS data, including advanced filtering.

Read in the data to an xarray.DataSet::

>>> reader = ReadCsv('config.yaml')
>>> ds = reader.to_xarray('my_folder_csvs')

Then drop years::

>>> ds = ds.drop_sel(YEAR=range(2025, 2071))

Issue Ticket Number

Some of the issues around indexing that aren't satisfactory in pandas were mentioned in #98 (categorical indexes) and #165 (duplicate indexes).

Documentation

None yet.

willu47 avatar Jun 21 '23 13:06 willu47