Skip to content

Commit c652070

Browse files
committed
fixed for running
1 parent ed93759 commit c652070

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

PopSynthesis/Methods/IPSF/SAA/run_hh.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020

2121
def run_main() -> None:
22+
print("DOING SAA FIXED ORDER ADJUSTMENT")
2223
hh_marg = pd.read_csv(data_dir / "hh_marginals_ipu.csv", header=[0, 1])
2324
hh_marg = hh_marg.drop(
2425
columns=hh_marg.columns[hh_marg.columns.get_level_values(0) == "sample_geog"][0]
@@ -49,15 +50,14 @@ def run_main() -> None:
4950
chosen_hhs = []
5051
err_rm_hh = []
5152
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
5454
err_rm_hh.append(n_removed_err_hh)
5555
print(
5656
f"For run {n_run_time}, order is: {order_adjustment}, aim for {n_removed_err_hh} HHs"
5757
)
5858
saa = SAA(hh_marg, considered_atts, order_adjustment, pool)
5959
###
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}")
6161
###
6262
# error check
6363
marg_from_kept_hh = convert_full_to_marg_count(final_syn_pop, [zone_field])
@@ -99,7 +99,7 @@ def run_main() -> None:
9999
print(f"Error hh rm are: {err_rm_hh}")
100100

101101
# 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")
103103

104104

105105
if __name__ == "__main__":

job.script

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/bin/bash
2-
#SBATCH --job-name=run_hh_seq_loop
2+
#SBATCH --job-name=SAA_hh_fixed
33
#SBATCH --partition=comp
44
#SBATCH --nodes=1
55
#SBATCH --cpus-per-task=2
66
#SBATCH --ntasks=1
77
#SBATCH --time=160:00:00
8-
#SBATCH --output=run_hh_seq_loop.out
8+
#SBATCH --output=SAA_hh_fixed.out
99

1010
source .venv/bin/activate
1111

0 commit comments

Comments
 (0)