MCPcopy Create free account
hub / github.com/NSLS2/PyXRF / validate_output_weights

Method validate_output_weights

pyxrf/core/tests/test_fitting.py:87–99  ·  view source on GitHub ↗
(self, weights_output, decimal=10)

Source from the content-addressed store, hash-verified

85 self.data_input = np.squeeze(self.data_input, axis=1)
86
87 def validate_output_weights(self, weights_output, decimal=10):
88 assert weights_output.shape == self.weights.shape, (
89 f"Shapes of the output weight array {weights_output.shape} and "
90 f" input weight array {self.weights.shape} do not match. Can not compare the arrays"
91 )
92
93 # Check if the weights match
94 npt.assert_array_almost_equal(
95 weights_output,
96 self.weights,
97 decimal=decimal,
98 err_msg="Estimated weights do not match the weights used for dataset generation",
99 )
100
101
102def test_rfactor_compute_testing_single_spectrum():

Callers 4

test_fitting_nnlsFunction · 0.95
test_fitting_admmFunction · 0.95
test_fit_spectrumFunction · 0.95
verify_fit_outputMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected