-
Notifications
You must be signed in to change notification settings - Fork 0
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 sha256 for training data #4
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 698341617
💛 - Coveralls |
ivadomed/main.py
Outdated
# generating sha256 for training data | ||
context['training_sha256'] = {} | ||
for file in train_lst: | ||
df_sub = bids_df.df.loc[bids_df.df['filename'] == file] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a bit comment about this line in particular?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good stuff. I think more clarity will always help future developers or even you who look at this code down the road. Unit test is a mandatory requirement for IvadoMed. Be wary of its very convoluted pathing issue... which may cause problems. bigger than the SHA2 issue you are trying to fix. Test thoroughly.
ivadomed/main.py
Outdated
sha256_hash = hashlib.sha256() | ||
with open(file_path, "rb") as f: | ||
for byte_block in iter(lambda: f.read(4096), b""): | ||
sha256_hash.update(byte_block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a unit test for this portion and externalize this portion as a dedicated block hashing function?
ivadomed/main.py
Outdated
@@ -342,6 +343,17 @@ def run_command(context, n_gif=0, thr_increment=None, resume_training=False): | |||
context["loader_parameters"] | |||
['subject_selection']) | |||
|
|||
# generating sha256 for training data | |||
context['training_sha256'] = {} | |||
for file in train_lst: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you add comment clarifying what is in the file, is it a string representing file name?
Checklist
GitHub
PR contents
Description
Linked issues
ivadomed#9