Closed henhuy closed 5 years ago
I guess it should look like this, right?
from oemof.db import results
sa_session = SqlAlchemySession()
results.store_results(sa_session, input_dict, result_dict)
sa_session.close()
Yes - you are right! I will add that, thx. Did you test functionality?
Did you test functionality?
No, I first concentrated on the API, but the API looks very good (and clear) to me now.
I will try the code within the next week. I will not have time today. Is that okay or is it urgent for you?
No - it's definitely not urgent, as I just wanted to share the code. I already use it in my app...
Module to easily store and restore input- and result-data from oemof into database.
Notes
API The following code will setup your sqlalchemy session and create all needed tables in database:
The following code stores your data into DB:
The following code restores your data from DB: