Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
samples = np.zeros(n_parameters)
else:
assert isinstance(analysis_results, BayesianResults)
# Empty covariance matrix
covariance_matrix = np.zeros(n_parameters)
# Gather the samples
samples = analysis_results._samples_transposed
# Serialize the model so it can be placed in the header
yaml_model_serialization = my_yaml.dump(optimized_model.to_dict_with_types())
# Replace characters which cannot be contained in a FITS header with other characters
yaml_model_serialization = _escape_yaml_for_fits(yaml_model_serialization)
# Get data frame with parameters (always use equal tail errors)
data_frame = analysis_results.get_data_frame(error_type="equal tail")
# Prepare columns
data_tuple = [('NAME', free_parameters.keys()),
('VALUE', data_frame['value'].values),
('NEGATIVE_ERROR', data_frame['negative_error'].values),
('POSITIVE_ERROR', data_frame['positive_error'].values),
('ERROR', data_frame['error'].values),
('UNIT', np.array(data_frame['unit'].values, str)),