OPF.load_csv#
- OPF.load_csv(path)#
Load scheduling results from a csv file produced by
export_csv().For multi-period routines the
Timecolumn is used to re-align rows toself.timeslot.v. For single-period routines, theTimecolumn carries the literal sentinel"T1"and a single row is expected.The export/load contract is a single-space join between key and device idx (
f'{key} {dev}') with no quoting. Device idxes are assumed not to collide with this convention; if a future case file uses idxes that contain spaces, the export-side header generation needs revisiting too.- Parameters:
- pathstr
Path of the csv file to load.
- Returns:
- bool
Trueif the loading is successful,Falseotherwise. On failure the routine'sconverged/exit_codeflags are not modified.
Notes
Round-trip values are clipped to 6 decimals on export (see
gather_results()) — reload is lossy at the 1e-6 level, which is fine for inspection but not for bit-exact replay.Differences from ANDES: ANDES has no direct analog. The closest related facility is
andes.routines.tds.TDS.run()withfrom_csv=, but that replays a time-domain trajectory through the integrator — it is not a post-solve rehydrator. AMS reads scheduling results back into existingVarandExpressionCalcstorage and marks the routine as converged so subsequentget()andams.system.System.report()calls behave as if the routine just solved.Added in version 1.3.0.