-
-
Notifications
You must be signed in to change notification settings - Fork 500
ValueError When Using Different yml Config Files #3510
Description
Summary
I am hitting a convergence-time crash inside TARDIS while trying to run simulations for a standalone plotting script for the GSoC “TARDIS Setups Generated Plots and Gallery” idea.
The failure appears to occur inside MCRadiationFieldPropertiesSolver.estimate_jblues(), where the Monte Carlo line estimator has a different number of cells than the geometry/radiation-field arrays.
The crash happens during run_tardis(...) before the plotting functions are reached.
Reproduction
Call pattern
I am calling TARDIS in, as far as I can tell, a standard way:
sim = run_tardis(config=args.config, atom_data=args.atomic_data)
Script
You can try the exact script under this branch:
https://github.com/MAKaral27/tardis/tree/repro-jblues-shape-mismatch
(This is also the same script as was used in issue #3508, so I will leave a comment there referencing this branch. It is located under /docs)
Example command 1
(separate issue with this atomic data file, had to be deduplicated)
python Universal_SDec_LIV_plotter.py
--atomic_data aoife_atomic_data_levels_dedup.h5
--config ~helium_HM_19_recomb.yml
Example command 2
python Universal_SDec_LIV_plotter.py
--atomic_data kurucz_cd23_chianti_H_He_latest.h5
--config ~/downloads/29d.yml
Observed failure
For the helium recombination case, the debug output at the failure site was:
j_blue_estimator shape: (272164, 31)
volume shape: (55,)
line_list_nu shape: (272164,)
dilution_factor shape: (55,)
The resulting exception from exampåle 1 is:
ValueError: operands could not be broadcast together with shapes (272164,31) (55,)
And for example 2:
ValueError: operands could not be broadcast together with shapes (215976,36) (37,)
I monkeypatched estimate_jblues() to print the relevant shapes immediately before the failing multiplication. That is how I obtained the (272164, 31) versus (55,) mismatch above.
Expected behavior
Either the estimator/geometry cell counts should be the same during convergence, or TARDIS should raise a targeted diagnostic before the NumPy operation that is crashing it. Currently I do not even understand what is going wrong.
Environment
- TARDIS: 7dae5af
- Python: 3.13.3
- OS: Arch Linux
Fix
Having failed to identify the exact point of failure, I honestly don't know how to fix this. It would be great if someone else could have a look.