implemented basic cache invalidation in DataIO #96
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The DataIO class implicitly assumes that the simulations being analyzed are completed. This leads to unexpected behavior when using ionerdss to check simulation progress in a notebook with persistent state. The first time a plot is made, the data file is cached, and subsequent plotting calls only ever show old, out-of-date data.
This PR adds basic cache invalidation to DataIO, by also storing the time code of when the file was last modified alongside the cached data. DataIO will now first check whether the file has been changed since it was cached before proceeding, and will re-load the data from disk if it has been modified.