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.
Two main issues led to code files changing for identical models (i.e., even when running a model again in a new process where the problems with regard to names as discussed in #680 do not play a role):
hash()
to deal with the problem of case-insensitivity on Windows (otherwisei
andI
would be stored to the same file). For security reasons, thehash()
function changes its output for every run.The fix in this PR is to:
sorted()
whenever iterating over variables that are stored in sets, andzlib.crc32
instead ofhash
to calculate the hash value for the filenames. Strictly speaking,crc32
is a checksum and not a hash value and is more prone to lead to collisions, but this should not matter for us since we only need to disambiguate in very specific circumstances (names that are identical except for case).I did not set up a formal test for this, but I verified with fairly complex examples (e.g.
frompapers/Kremer_et_al_2011_barrel_cortex.py
) that the generated is identical over runs.