Add option to read input snapshots from memory, rather than disk
For much the same reasons why we may prefer output snapshots in memory, rather than disk, we should consider providing input snapshots from memory. This will reduce disk I/O in cases where we may connect multiple models, all with vector inputs and outputs.
💡 Steps for implementing the feature
One potential implementation would be to modify the TbRom._reduce_field_input() method and replace the snapshot_filepath argument with a general snapshot argument that could be a string or Path, to read from disk, or an array or list of vec values.
Optionally add a on_disk: bool to explicitly indicate to treat the input as a vector or Path.
If on_disk, read the binary file as before. If not, skip reading and use the vector directly (convert list to np.ndarray?)
📝 Description of the feature
Add option to read input snapshots from memory, rather than disk
For much the same reasons why we may prefer output snapshots in memory, rather than disk, we should consider providing input snapshots from memory. This will reduce disk I/O in cases where we may connect multiple models, all with vector inputs and outputs.
💡 Steps for implementing the feature
One potential implementation would be to modify the
TbRom._reduce_field_input()
method and replace thesnapshot_filepath
argument with a generalsnapshot
argument that could be a string or Path, to read from disk, or an array or list of vec values. Optionally add aon_disk: bool
to explicitly indicate to treat the input as a vector or Path.If
on_disk
, read the binary file as before. If not, skip reading and use the vector directly (convert list to np.ndarray?)🔗 Useful links and references
No response