Skip to content
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

Point reproduce in Python segments to HuggingFace URLs #2316

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/data/countries.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export const STATUS_TEXT_COLORS = {
// this only applies to the "enhanced_cps"
// dataset selection
export const DEFAULT_DATASETS = {
enhanced_cps: "enhanced_cps_2024",
enhanced_cps: "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5",
};

const DEFAULT_US_HOUSEHOLD = {
Expand Down
4 changes: 2 additions & 2 deletions src/data/reformDefinitionCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ export function getImplementationCode(
if (hasDatasetSpecified) {
datasetText = DEFAULT_DATASETS[dataset];
} else if (isState) {
datasetText = "pooled_3_year_cps_2023";
datasetText = "hf://policyengine/policyengine-us-data/pooled_3_year_cps_2023.h5";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question, blocking: Would it be more sustainable to modify this setting in us-data and keep the app the same?

It seems to me we always want the API and country packages both to prefer HuggingFace datasets over GitHub. It also seems like it'd be relatively simple to modify us-data to either recognize this preference, or just only download from once source or the other, instead of our current method where we still send data updates to both GitHub and HuggingFace.

Could we just modify us-data to do this? Seems unwieldy to ask users to remember this entire link.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the policyengine.py design doc, I think we should move away from us-data being a package dependency so I'd vote against this.

In the medium term we'll move to policyengine.py, which abstracts the huggingface URL away behind constants, and update the reproduce in python segment accordingly. Right now the reproduce in python segment is broken without this, so I'd suggest still keeping this solution in the -app repo here.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I have a better understanding now. This seems sensible as a temporary change. @PavelMakarchuk and @DTrim99 Just to flag for you - we'll temporarily be listing this longer URL, but will revert to the typical method of choosing datasets after integrating policyengine.py more broadly.

question: Would we need to also do this for the standard CPS? Is that not defaulting to pulling outdated data from GitHub?

} else if (region === "enhanced_us") {
datasetText = "enhanced_cps_2024";
datasetText = "hf://policyengine/policyengine-us-data/enhanced_cps_2024.h5";
}

const datasetSpecifier = datasetText ? `dataset="${datasetText}"` : "";
Expand Down
Loading