Skip to content

Commit

Permalink
Merge pull request #184 from hdoupe/cs-new-puf
Browse files Browse the repository at this point in the history
Read updated puf file name from s3 bucket for cs usage
  • Loading branch information
andersonfrailey committed Oct 5, 2021
2 parents a754de0 + c3361a8 commit 2c63597
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ jobs:
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
verbose: true
4 changes: 3 additions & 1 deletion cs-config/cs_config/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
AWS_ACCESS_KEY_ID = os.environ.get("AWS_ACCESS_KEY_ID", None)
AWS_SECRET_ACCESS_KEY = os.environ.get("AWS_SECRET_ACCESS_KEY", None)

PUF_S3_FILE_NAME = "puf.20210720.csv.gz"


def random_seed(user_mods, year):
"""
Expand Down Expand Up @@ -353,7 +355,7 @@ def retrieve_puf(
if has_credentials and s3_reader_installed:
print("Reading puf from S3 bucket.")
fs = S3FileSystem(key=AWS_ACCESS_KEY_ID, secret=AWS_SECRET_ACCESS_KEY,)
with fs.open("s3://ospc-data-files/puf.csv.gz") as f:
with fs.open(f"s3://ospc-data-files/{PUF_S3_FILE_NAME}") as f:
# Skips over header from top of file.
puf_df = pd.read_csv(f, compression="gzip")
return puf_df
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ dependencies:
- matplotlib
- s3fs
- pip:
- cs-kit
- "cs-kit>=1.16.8"
- cs2tc

0 comments on commit 2c63597

Please sign in to comment.