WIP: Experimenting with h5py mocking #5217
Open
+136
−0
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.
This is another WIP experiment. I have taken to heart what @Xarthisius has said for a while about how it would be nice to mock h5py.
This requires a file that can be generated, called
mock_hdf5_structure.json
that we can use. Here's code for generating a set of them:https://gist.github.com/matthewturk/5313f6318d89763fd4282f49c654d500
I've also included a fake one in there. You'll need to search-and-replace the path to get it to match yours, but if you then have a
.hierarchy
and a parameter file next to it, you should be set. Then, interactively,Right now it'll generate a field list, but I need to properly implement
MockH5pyH5d.open
andMockH5pyH5d.read
before it'll do anything else. I'll give that a go.This would dramatically reduce the amount of data we'd need. I think with some additional coding we could mock up some other readers, too.