-
Notifications
You must be signed in to change notification settings - Fork 0
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
p.csv issue update #26
base: main
Are you sure you want to change the base?
Conversation
src/agents/common.jl
Outdated
county_id_mapping_path = joinpath(input_filename, "county_id_mapping.csv") | ||
|
||
if isfile(county_id_mapping_path) | ||
county_id_mapping = CSV.read(county_id_mapping_path, DataFrame) | ||
|
||
|
||
county_id_mapping.County_FIPS = map(x -> lpad(string(x), 5, '0'), county_id_mapping.County_FIPS) | ||
county_id_mapping.BA = map(x -> "p$x", county_id_mapping.PCA_ID) | ||
|
||
prefix = "Res" | ||
county_id_mapping[!, :index_h] = string.(prefix, "_", county_id_mapping.County_FIPS) | ||
|
||
county_id_mapping[!, :index_z] = county_id_mapping.BA | ||
|
||
county_to_ba = Dict(county_id_mapping.County_FIPS .=> county_id_mapping.BA) | ||
else | ||
error("county_id_mapping.csv not found at $county_id_mapping_path") | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need project-specific code in common.jl.
src/agents/common.jl
Outdated
@@ -171,6 +193,7 @@ function HEMData(input_filename::String; epsilon::AbstractFloat = 1.0E-3) | |||
index_z, | |||
index_sector, | |||
h_to_sector, | |||
county_to_ba, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, "county" is too project-specific. Perhaps what's needed is for an "index_h_z_mapping.csv" to be made in HEMData.jl similar to "index_h_sector_mapping.csv"?
No description provided.