Network API and streaming data


#1

I’m in the process of updating some older code which is based on the using OPF framework to now use the Network API. However, I can’t see how to update the run method to handle streaming data (rather than data from a csv file), and am wondering if there are any examples available?

Specifically, the run method of the OPF models is within a loop used to feed new data into the models using the syntax,

result = model.run(modelInputDict)

However, the run method of a network model doesn’t (seem to) have this ability.
All of the examples I can find in the documentation/online/github specify the input as a csv file, created using,

dataSource = FileRecordStream(streamID=_INPUT_FILE_PATH)

and attached to the sensor region using,

sensorRegion.dataSource = dataSource

This is fine if the complete set of input data is known in advance.

But what is the recommended approach to use a Network API when the complete set of input data is not known in advance?


#2

Phil, I think you might need to implement a RecordStream to set up your own stream. @scott do you have any further advice?