BreakingBytes / simkit

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

instead of passing data to reader, pass it to load_data(*args, **kwargs) #41

Closed mikofski closed 8 years ago

mikofski commented 8 years ago

currently, data to be read by reader is passed to the reader's constructor, making it a one use container, and also making the inputs difficult to manage.

For example, in the DjangoModelReader we don't really need parameters, which is the only input required by a reader, so it would be nice to default it to None, but since the model_instance argument is second, is required, so wouldn't make sense to give it a default, or pass as keyword arg, then we're stuck doing this:

datsrc = DjangoModelReader(None, mymodel)

Instead, don't pass the data to the constructor, just pass it to the reader's load_data() call, which is used in DataSource.