Describe the bug:
I recently updated my 21cmfast to the latest version which has the new Lightconer subclass (version=3.3.2.dev118+gef480dc). In this new mode, I tried to generate lightcones that take into account the spin temperature evolution (setting USE_TS_FLUCT=True). And this runs into the following error (I run 21cmfast in a Jupyter notebook):
File [.../src/py21cmfast/wrapper.py:2943], in run_lightcone(redshift, max_redshift, lightcone_quantities, lightconer, user_params, cosmo_params, astro_params, flag_options, regenerate, write, global_quantities, direc, init_box, perturb, random_seed, coeval_callback, coeval_callback_redshifts, use_interp_perturb_field, cleanup, hooks, always_purge, lightcone_filename, return_at_z, **global_kwargs)
2939 for quantity, idx, this_lc in lightconer.make_lightcone_slices(
2940 coeval, prev_coeval
2941 ):
2942 if this_lc is not None:
-> 2943 lightcone.lightcones[quantity][..., idx] = this_lc
2944 lc_index = idx
2946 if lightcone_filename:
KeyError: None
The "lightcone.lightcones[quantity]" part is highlighted in the above error message.
The same error occurs if I turn on INHOMO_RECO.
To Reproduce:
Steps to reproduce the behavior:
Setting up a Lightconer instance (e.g., a standard RectilinearLightconer) as instructed in the tutorial and pass it to the run_lightcone function.
Setting flag_options = {"USE_TS_FLUCT": True} in the run_lightcone function.
Expected behavior:
In this version of 21cmFAST, I also tried to run lightcones with TsBox on by the original way, e.g, setting 'redshift', 'max_redshift' and 'lightcone_quantities' arguments directly in the run_lightcone function, instead of using a Lightconer. It worked out well as expected. So I guess this is only an issue with the new Lightconer subclass.
Describe the bug: I recently updated my 21cmfast to the latest version which has the new Lightconer subclass (version=3.3.2.dev118+gef480dc). In this new mode, I tried to generate lightcones that take into account the spin temperature evolution (setting USE_TS_FLUCT=True). And this runs into the following error (I run 21cmfast in a Jupyter notebook):
File [.../src/py21cmfast/wrapper.py:2943], in run_lightcone(redshift, max_redshift, lightcone_quantities, lightconer, user_params, cosmo_params, astro_params, flag_options, regenerate, write, global_quantities, direc, init_box, perturb, random_seed, coeval_callback, coeval_callback_redshifts, use_interp_perturb_field, cleanup, hooks, always_purge, lightcone_filename, return_at_z, **global_kwargs) 2939 for quantity, idx, this_lc in lightconer.make_lightcone_slices( 2940 coeval, prev_coeval 2941 ): 2942 if this_lc is not None: -> 2943 lightcone.lightcones[quantity][..., idx] = this_lc 2944 lc_index = idx 2946 if lightcone_filename:
KeyError: None
The "lightcone.lightcones[quantity]" part is highlighted in the above error message.
The same error occurs if I turn on INHOMO_RECO.
To Reproduce: Steps to reproduce the behavior:
Expected behavior: In this version of 21cmFAST, I also tried to run lightcones with TsBox on by the original way, e.g, setting 'redshift', 'max_redshift' and 'lightcone_quantities' arguments directly in the run_lightcone function, instead of using a Lightconer. It worked out well as expected. So I guess this is only an issue with the new Lightconer subclass.
Details: