Skip to content
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

Bring hdf5 branch up-to-date #408

Merged
merged 6 commits into from Jan 23, 2019
Merged

Bring hdf5 branch up-to-date #408

merged 6 commits into from Jan 23, 2019

Conversation

jorainer
Copy link
Collaborator

  • updateHdf5MSnExp function to consolidate/save any data changes back to the hdf5 files.
  • filterFile,Hdf5MSnExp to ensure that also the hdf5file slot gets updated correctly.
  • convertToHdf5MSnExp to convert an OnDiskMSnExp to a Hdf5MSnExp object (instead of as, since that does not support required additional arguments.
  • unit tests.

- Add .h5write_spectra to write a list of Spectrum objects to an HDF5 file.
- Add related unit tests.
- Implement a consolidate function that does an in-place replacement of the
  input Hdf5MSnExp.
- Add related unit tests and documentation.
- Rename consolidate to writeHdf5Data.
- Write also an md5 sum of the spectrum data to each hdf5 file and store this
  also within the Hdf5MSnExp.
- Reading data will compare the md5 in the file with the one in the object and
  throw an error if they don't match.
- convertToHdf5MSnExp converts OnDiskMSnExp objects and objects extending it to
  Hdf5MSnExp objects. This can also be used to *restore* corrupt Hdf5MSnExp
  files (issue #405).
@jorainer jorainer requested a review from lgatto January 23, 2019 18:57
backend = character()))

validHdf5MSnExp <- function(object) {
validHdf5MSnExp <- function(object, check_md5 = TRUE) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validity can be checked with and without checking also whether the content of the hdf5 files has changed. The latter is performed by default. validObject() will perform a basic check with check_md5 = FALSE.

#' file.remove(hdf5FileName(x))
.Hdf5MSnExp <- setClass("Hdf5MSnExp",
slots = c(hdf5file = "character",
md5sum = "character"),
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

slot md5sum stores the md5 sums of the spectra within a hdf5 file. The same number is stored into the file upon generation of the hdf5 file. Also, updateHdf5MSnExp updates both the md5 sum in the file and the one in this slot. If they are not the same, the hdf5 file has been changed.

@lgatto lgatto merged commit 89621b0 into hdf5 Jan 23, 2019
@lgatto
Copy link
Owner

lgatto commented Feb 1, 2019

I won't have time to review this right now. Feel free to merge it directly @jotsetung

@jorainer
Copy link
Collaborator Author

jorainer commented Feb 2, 2019

I'd rather go for the developments we're doing now in the backends and backends_jo branches. I will take some stuff from here (hdf5 reading etc) and include it there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants