From 01c7e534739464618b575785612506f2374867d3 Mon Sep 17 00:00:00 2001 From: Kris Cooper <43237137+KriSun95@users.noreply.github.com> Date: Mon, 4 Mar 2024 18:14:35 -0500 Subject: [PATCH] Quick fix to breaking bug from thermal model (#134) * Quick fix to breaking bug when changing the chianti file for the thermal model. Real issue is in thermal model which the testing energy range in the fitter fails on. Changed testing energy range to not get caught in thermal function bug. --------- Co-authored-by: Kristopher Cooper Co-authored-by: Shane Maloney --------- Co-authored-by: Kristopher Cooper Co-authored-by: Stuart Mumford Co-authored-by: Shane Maloney Co-authored-by: Kristopher Cooper --- changelog/134.bugfix.rst | 1 + sunkit_spex/fitting_legacy/fitter.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelog/134.bugfix.rst diff --git a/changelog/134.bugfix.rst b/changelog/134.bugfix.rst new file mode 100644 index 00000000..1331c58f --- /dev/null +++ b/changelog/134.bugfix.rst @@ -0,0 +1 @@ +Fixed bug where changing the Chianti file for `sunkit_spex.thermal` and using :class:`sunkit_spex/sunxspex_fitting/fitter.Fitter` caused an error. diff --git a/sunkit_spex/fitting_legacy/fitter.py b/sunkit_spex/fitting_legacy/fitter.py index bed3f21f..a8562e9f 100644 --- a/sunkit_spex/fitting_legacy/fitter.py +++ b/sunkit_spex/fitting_legacy/fitter.py @@ -4753,7 +4753,7 @@ def _func_self_contained_check(function_name, function_text): """ exec(function_text, globals()) params, _ = get_func_inputs(globals()[function_name]) - _test_e_range = np.arange(1.6, 5.01, 0.04)[:, None] + _test_e_range = np.arange(1.6, 25.01, 0.04)[:, None] _test_params, _test_energies = np.ones(len(params)), np.concatenate((_test_e_range[:-1], _test_e_range[1:]), axis=1) # one 5 for each param, 2 column array of e-bins try: _func_to_test = globals()[function_name]