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

add optional content hash to File object #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bmaranville
Copy link
Contributor

In addition to timestamp, it would be nice for reproducibility if we could specify a hash of the file contents for File objects, which are used in the Measurement class.

Copy link
Contributor

@arm61 arm61 left a comment

Choose a reason for hiding this comment

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

Sounds like a good feature to me.

@aglavic
Copy link
Collaborator

aglavic commented Feb 22, 2023

I think it's a good idea.

Some suggestions/comments:

  1. Add a test for the new class.
  2. Hashes are, by default, binary strings. How would we deal with that? Is it compatible with YAML? (Or did you plan to use the hexdigest representation, in which case the attribute should maybe be renamed.)
  3. Add a convenience method in the ContentHash class to check a string against the given hash digest.
  4. Add a convenience class mathod to ContentHash create the object from the test string automatically.

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

3 participants