File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
PopSynthesis/Methods/IPSF/SAA Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 19
19
20
20
21
21
def run_main () -> None :
22
+ print ("DOING SAA FIXED ORDER ADJUSTMENT" )
22
23
hh_marg = pd .read_csv (data_dir / "hh_marginals_ipu.csv" , header = [0 , 1 ])
23
24
hh_marg = hh_marg .drop (
24
25
columns = hh_marg .columns [hh_marg .columns .get_level_values (0 ) == "sample_geog" ][0 ]
@@ -49,15 +50,14 @@ def run_main() -> None:
49
50
chosen_hhs = []
50
51
err_rm_hh = []
51
52
while n_run_time < MAX_RUN_TIME and n_removed_err_hh > 0 :
52
- # randomly shuffle for each adjustment
53
- random .shuffle (order_adjustment )
53
+ # The order is the same everytime
54
54
err_rm_hh .append (n_removed_err_hh )
55
55
print (
56
56
f"For run { n_run_time } , order is: { order_adjustment } , aim for { n_removed_err_hh } HHs"
57
57
)
58
58
saa = SAA (hh_marg , considered_atts , order_adjustment , pool )
59
59
###
60
- final_syn_pop = saa .run (extra_name = f"_ { n_run_time } " )
60
+ final_syn_pop = saa .run (extra_name = f"_fixed { n_run_time } " )
61
61
###
62
62
# error check
63
63
marg_from_kept_hh = convert_full_to_marg_count (final_syn_pop , [zone_field ])
@@ -99,7 +99,7 @@ def run_main() -> None:
99
99
print (f"Error hh rm are: { err_rm_hh } " )
100
100
101
101
# output
102
- final_syn_hh .to_csv (output_dir / "SAA_HH_only_looped .csv" )
102
+ final_syn_hh .to_csv (output_dir / "SAA_HH_fixed_ad .csv" )
103
103
104
104
105
105
if __name__ == "__main__" :
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- # SBATCH --job-name=run_hh_seq_loop
2
+ # SBATCH --job-name=SAA_hh_fixed
3
3
# SBATCH --partition=comp
4
4
# SBATCH --nodes=1
5
5
# SBATCH --cpus-per-task=2
6
6
# SBATCH --ntasks=1
7
7
# SBATCH --time=160:00:00
8
- # SBATCH --output=run_hh_seq_loop .out
8
+ # SBATCH --output=SAA_hh_fixed .out
9
9
10
10
source .venv/bin/activate
11
11
You can’t perform that action at this time.
0 commit comments