-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #390 from andersonfrailey/skipyears
Skip Stage 2 years
- Loading branch information
Showing
8 changed files
with
159 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"puf": { | ||
"data": "b246b86245544f0c4fb362f331dd9c9f0f3805991117a3bb91a2a46c4a505fe8", | ||
"solver": "435ab7f39d4b7dd8b12c19f43978c026c39a5fc5af9dd4a88b925287feecc6e9", | ||
"dataprep": "85a9e87a9c978f1e4d558ddc4ecd19a7fe7ffc82883b7306f6857a48a8b6eb00", | ||
"stage2": "4e7dff40ab434ae30a6349d769d33695007b08eb120ea784661c646a62a6bfaa" | ||
}, | ||
"cps": { | ||
"data": "492ead49db94fc4bb4109c33a6c9679aa32c41042e715333cc84df1fe49e578d", | ||
"solver": "0d36a53fbec8850c29b109c309e41648d0737a80643def944efc59d9c804034b", | ||
"dataprep": "a95922179111b9a78f91dc7bc2aeb28a3312900f518d63b47be28910a9b8b2b6", | ||
"stage2": "6de103898e065b0847e6fdd2012196bbf194132d62d0ed05f9e5d64fcb4f26a4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
""" | ||
This script creates the initial hashes for each stage 2 file | ||
""" | ||
import json | ||
import hashlib | ||
from pathlib import Path | ||
|
||
CUR_PATH = Path(__file__).resolve().parent | ||
|
||
|
||
def create_hashes(_file): | ||
""" | ||
Create the hash values for each of the files in the stage 2 process | ||
""" | ||
hashes = {} | ||
with open(Path(CUR_PATH, "data", _file), "rb") as f: | ||
hashes["data"] = hashlib.sha256(f.read()).hexdigest() | ||
if _file == "cps-matched-puf.csv": | ||
basepath = Path(CUR_PATH, "puf_stage2") | ||
else: | ||
basepath = Path(CUR_PATH, "cps_stage2") | ||
filenames = ["solver.jl", "dataprep.py", "stage2.py"] | ||
keynames = ["solver", "dataprep", "stage2"] | ||
for filename, key in zip(filenames, keynames): | ||
with open(Path(basepath, filename), "rb") as f: | ||
hashes[key] = hashlib.sha256(f.read()).hexdigest() | ||
return hashes | ||
|
||
|
||
finalhashes = {} | ||
finalhashes["puf"] = create_hashes("cps-matched-puf.csv") | ||
finalhashes["cps"] = create_hashes("cps.csv.gz") | ||
with open(Path(CUR_PATH, "datahashes.json"), "w") as f: | ||
json.dump(finalhashes, f, indent=4) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters