Closed claytonpbarrows closed 3 years ago
This appears to only happen when the system has been deserialized from a json.
This bug should happen anytime you call copy_time_series!
on a component with SingleTimeSeries
that has been transformed into DeterministicSingleTimeSeries
. In the copy logic we try to add the same HDF5 attribute twice (buried in the stack trace is attribute already exists
). There are two views into the same time array; we don't need to make the second call.
This is actually a long-standing bug. I recently optimized some of our logic accessing HDF5 files and found that we were allowing duplicate references. The consequence of that bug was that removing a component would not have properly deleted the time array. I fixed that bug last week, so that is why you are seeing this now.
I don't think that this has anything to do with serialization. The system you are creating with PSB uses in-memory time series. There is different copy logic for that implementation. We currently have a limitation in that if you deserialize a system that was created with in-memory time series you will get back HDF5 time series.