From f9c7219959ef29cd41858e9cdea7765f0d78e4d3 Mon Sep 17 00:00:00 2001 From: Shane Maloney Date: Thu, 31 Oct 2024 21:22:43 +0000 Subject: [PATCH] more test fixes --- examples/fitting_simulated_data.py | 2 +- sunkit_spex/models/instrument_response.py | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/fitting_simulated_data.py b/examples/fitting_simulated_data.py index f0d4383..89cb93c 100644 --- a/examples/fitting_simulated_data.py +++ b/examples/fitting_simulated_data.py @@ -67,7 +67,7 @@ srm_model = MatrixModel( matrix=srm, input_axis=SpectralAxis(ph_energies), output_axis=SpectralAxis(ph_energies), c=1 * u.ct / u.ph ) -srm_model.inputs_units = {"x": u.ph} +srm_model.input_units = {"x": u.ph} with quantity_support(): plt.figure() diff --git a/sunkit_spex/models/instrument_response.py b/sunkit_spex/models/instrument_response.py index 7dfe138..06ab59e 100644 --- a/sunkit_spex/models/instrument_response.py +++ b/sunkit_spex/models/instrument_response.py @@ -10,6 +10,7 @@ class MatrixModel(Fittable1DModel): c = Parameter(fixed=True) def __init__(self, matrix, input_axis, output_axis, c): + self._input_units = None self.inputs_axis = input_axis self.output_axis = output_axis self.matrix = matrix @@ -22,11 +23,11 @@ def evaluate(self, x, c): @property def input_units(self): - return self.inputs_units + return self._input_units @input_units.setter def input_units(self, units): - self.inputs_units = units + self._input_units = units @staticmethod def _parameter_units_for_data_units(inputs_unit, outputs_unit):