From d7ed1e8bb23e89495d846218b414f09dfb72ea64 Mon Sep 17 00:00:00 2001 From: "Adam J. Jackson" <a.j.jackson@physics.org> Date: Fri, 13 Dec 2019 16:57:56 +0000 Subject: [PATCH] Abins: replace CalculateSPowder test data for new sampling scheme The sample data for the CalculateSPowder test needs to be updated as part of the work on broadening, because Abins is now producing different results. Specifically: the instrumental broadening function applied to the S data has been replaced and is now smooth; the reference frequencies are now defined to be in the middle of the histogram bins rather than at the edges. This difference in binning conventions has actually changed the size of the results array (by 1!) The format of the sample data for CalculateSPowder is not very pretty; it is some kind of raw text dump. It would be nice to avoid such things with a proper JSON serialisation setup, but for now the priority is to fix the test in a way that is comparable with previous behaviour. The process used to generate the replacement file was to obtain the calculation data with AbinsModules.CalculateS.init(...args...).get_formatted_data() and dump the text representation to a file with numpy.set_printoptions(threshold=numpy.nan) with open('Si2-sc-CalculateSPowder_S.txt', 'w') as f: f.write(str(calculated_data.extract())) The resulting file appears more neatly formatted than its predecessor 4b77bac3f8c1dc54f63bd41ca3075c48, but seems acceptable to the test parser. --- Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5 b/Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5 index 1ee02902209..ddd6182220a 100644 --- a/Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5 +++ b/Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5 @@ -1 +1 @@ -4b77bac3f8c1dc54f63bd41ca3075c48 +b902b1a553ca72bb575d703eec4515f0 -- GitLab