Skip to content
Snippets Groups Projects
Commit d7ed1e8b authored by Adam J. Jackson's avatar Adam J. Jackson
Browse files

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.
parent 442fdfaa
No related branches found
No related tags found
No related merge requests found
4b77bac3f8c1dc54f63bd41ca3075c48
b902b1a553ca72bb575d703eec4515f0
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment