@@ -289,6 +289,8 @@ def _initialise_simulations(self):
289
289
situation = self .data if not macro else None ,
290
290
reform = self ._parsed_baseline ,
291
291
)
292
+ if self .time_period is not None :
293
+ self .baseline_sim .default_calculation_period = self .time_period
292
294
293
295
if "region" in self .options and isinstance (
294
296
self .baseline_sim , CountryMicrosimulation
@@ -299,8 +301,6 @@ def _initialise_simulations(self):
299
301
self .options ["region" ],
300
302
reform = self .baseline_sim .reform ,
301
303
)
302
- if self .time_period is not None :
303
- self .baseline_sim .default_calculation_period = self .time_period
304
304
305
305
if "subsample" in self .options :
306
306
self .baseline_sim = self .baseline_sim .subsample (
@@ -315,6 +315,9 @@ def _initialise_simulations(self):
315
315
situation = self .data if not macro else None ,
316
316
reform = self ._parsed_reform ,
317
317
)
318
+
319
+ if self .time_period is not None :
320
+ self .reformed_sim .default_calculation_period = self .time_period
318
321
if "region" in self .options and isinstance (
319
322
self .reformed_sim , CountryMicrosimulation
320
323
):
@@ -330,9 +333,6 @@ def _initialise_simulations(self):
330
333
self .options ["subsample" ]
331
334
)
332
335
333
- if self .time_period is not None :
334
- self .reformed_sim .default_calculation_period = self .time_period
335
-
336
336
# Set the 'baseline tax-benefit system' to be the actual baseline. For example, when working out an individual's
337
337
# baseline MTR, it should use the actual policy baseline, not always current law.
338
338
@@ -404,6 +404,11 @@ def _apply_region_to_simulation(
404
404
with h5py .File (weights_file_path , "r" ) as f :
405
405
weights = f [str (self .time_period )][...]
406
406
407
+ print (
408
+ weights [constituency_id ],
409
+ simulation .default_calculation_period ,
410
+ )
411
+
407
412
simulation .calculate ("household_net_income" )
408
413
409
414
simulation .set_input (
@@ -419,7 +424,7 @@ def _apply_region_to_simulation(
419
424
local_folder = None ,
420
425
version = None ,
421
426
)
422
- la_names_file_path = Path (constituency_names_file_path )
427
+ la_names_file_path = Path (la_names_file_path )
423
428
la_names = pd .read_csv (la_names_file_path )
424
429
if la in la_names .code .values :
425
430
la_id = la_names [la_names .code == la ].index [0 ]
0 commit comments