-
Notifications
You must be signed in to change notification settings - Fork 70
SpotFindingResults Serialization to Disk (and loading) #1961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Would it be possible to not write the *.json file and instead write all the |
|
@ctcisar thanks for this! Making it easier to view intermediate results is super useful. I think @njmei may have also recently mentioned something like this being missing. |
|
@njmei I was thinking about doing something like that initially, but faced problems saving the @berl I wrote something like this using our own data as I was testing this, I'll write up and push a unit test proper shortly. |
|
@ctcisar Because the If I have some spare time this week, I'll see if can come up with an implementation that only produces/loads 1 file (probably |
|
@berl I added a testing file in the same format as the provided test, hopefully it's up to spec. In the process of writing this, I realised that alternating |
|
@ctcisar thanks for adding the tests. sorry about the delays in the CI tests- I started them up and the linter fails now. can you run that locally, make fixes and push here again? The CI should run automatically now |
|
@berl I was having difficulty getting The error I get when I run
But I'm not sure where this is coming from, because DataArray does have that. (notably, when I tried to run the |
|
I am at a bit of a loss for the last
Even though the order it is describing is the order they are imported in. I have also tried the reverse order, and that didn't make a difference. |
I have added two simple methods to save
SpotFindingResultsto disk and reload them. This is handled by calling the methods inphysical_coord_ranges,log, and_resultsto save each object, and then writing ajsonfile that identifies the indices and paths to each of these files. The loader opens thisjsonand uses the loading method from each of said objects to recreate the originalSpotFindingResultsobject.This can be useful for storing, comparing, and troubleshooting intermediate results. Storing the contents of each
xarray-like object as anetcdfallows for compatibility across most package version differences, unlike saving the entireSpotFindingResultsto a Python pickle.