Skip to content

Conversation

@anth-volk
Copy link
Contributor

@anth-volk anth-volk commented May 28, 2025

Fixes #154
Fixes PolicyEngine/policyengine-api-v2#212

What Changed

  • Renamed constants.py to /data/datasets.py
  • Added a dict mapping datasets that have a required time_period value to said value
  • Corrected Google Cloud Storage links
  • Refactored _set_data to handle properly pass dataset addresses to -core's Dataset.from_file function in order to enable downloading
  • Extricated time_period-setting code from data-setting code
  • Improved _set_data code quality and better separated concerns
  • Implemented a consistent variable naming structure around filepaths: filename = unique file name + extension, file_address = URI [+ bucket name] + filename
  • Added tests

Why This Change

  • Enables GCS datasets to download
  • Reduces confusion around filepath passage
  • Improves maintainability and clarity of _set_data function
  • Improves test coverage of the same function

Technical Details

N/A

@anth-volk anth-volk requested a review from mikesmit May 28, 2025 20:42
@anth-volk
Copy link
Contributor Author

Now ready for review

@anth-volk anth-volk requested a review from nikhilwoodruff May 29, 2025 16:05
@anth-volk anth-volk merged commit aac814a into main May 30, 2025
4 checks passed
@anth-volk anth-volk deleted the fix/correct-set-data branch May 30, 2025 21:12
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.

Deployments failing since merge Simulation _set_data method improperly removes file link

3 participants