BreakingBytes / simkit

Model Simulation Framework
http://breakingbytes.github.io/simkit/
BSD 3-Clause "New" or "Revised" License
27 stars 16 forks source link

restructure data readers to all use the exact same structure #43

Open mikofski opened 8 years ago

mikofski commented 8 years ago

Currently each reader has a very different structure. This complicates declaring fields within class vs using parameter file.

Proposed: If all readers have the same structure, then they can all fields can be declared in the data source class. This requires declaring reader specific attrs in the field or in the data source

Examples:

old

xlrd reader grouped by sheet with nested fields and attrs

{"sheet1": {"param1": {"range or location": "A2", "units": "meters"}}}

new

flatten nested structure by adding sheet attr to field attrs

class MyDataSource(DataSource):
    param1 = {"sheet": "sheet1", "range or location":"A2", "units": "meters"}