nismod / smif

Simulation Modelling Integration Framework
http://www.itrc.org.uk
MIT License
22 stars 6 forks source link

Fix reading single-value data array from a time series #297

Closed tomalrussell closed 5 years ago

tomalrussell commented 5 years ago

https://github.com/nismod/smif/blob/49a5db3569992b2baf4b409299707ab7ed5f6ae8/src/smif/data_layer/file/file_data_store.py#L393

data[0] should be data.iloc[0] in the case where we've read a pandas dataframe and filtered it down to a single value, the index in the pandas.Series is not guaranteed to be 0.

Minimal CSV file that should reproduce this, e.g. when expecting to read the single zero-dim value for 2015:

timestep,param
2010,0
2015,1