Skip to content

Commit

Permalink
settings missing in outout
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamstark committed Aug 20, 2024
1 parent 534cd5d commit f1bdbf5
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
26 changes: 26 additions & 0 deletions scripts/fixup_synth_data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ using .Utils
using .Randoms
using .RunSettings
using .Definitions
using .Intermediate
using .ModelHousehold
using .FRSHouseholdGetter
using DataFrames,CSV,StatsBase
using OrderedCollections
using Revise
Expand Down Expand Up @@ -60,6 +63,28 @@ function delete_irredemably_bad_hhs( hh :: DataFrame, pers :: DataFrame )
println( "want to kill $(h.hid)")
push!(kills, h.hid)
end
hbus = groupby( p, :default_benefit_unit )
nbusps = 0
for bu in hbus
nbusps += size( bu )[1]
numheads = sum( bu[:,:is_bu_head])
if numheads != 1
println("kill: != 1 head for each bu hh.hid=$(h.hid) numheads=$numheads bu = $(bu[1,:default_benefit_unit])")
push!( kills, h.hid )
end
end
if sum( p[:,:is_hrp]) != 1
println("kill !=1 head for each hh hh.hid=$(p.hid) was $(sum( p[:,:is_hrp]) )")
push!( kills, h.hid )
end
# fixable, but hey..
age_oldest_child = maximum(p[p.from_child_record.==1,:age];init=-99)
println( "age_oldest_child=$age_oldest_child")
if age_oldest_child >= 20
println( "age_oldest_child=$age_oldest_child for $(h.hid)")
push!( kills, h.hid )
end

end
println( "killing $(kills)")
deleteat!(hh, hh.hid .∈ (kills,))
Expand Down Expand Up @@ -288,6 +313,7 @@ function do_initial_fixes!(hh::DataFrame, pers::DataFrame )
#
hids = Dict{String,NamedTuple}()
hid = BigInt(0)
hs = size(hh)[1]
#
# Cast rands to string as opposed to string7 or whatever so we can assign our big string.
#
Expand Down
2 changes: 1 addition & 1 deletion src/ModelHousehold.jl
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ function make_benefit_unit(
palloc = spouse <= 0 ? 2 : 3
for n in palloc:npeople
push!(children, people[n].pid)
@assert people[n].age <= 21 # vague idiot check
@assert people[n].age <= 19 # vague idiot check
end
for pers in people
pd[pers.pid] = pers
Expand Down

0 comments on commit f1bdbf5

Please sign in to comment.