Skip to content

Commit

Permalink
Cherry-pick pull request #18984
Browse files Browse the repository at this point in the history
Correct setting numerical zero for b_tensors.

(cherry picked from commit 6bd4aae)

Increase threshold.

(cherry picked from commit d3507cb)

Change criterion for validation: compare .nxs reference file with calculated workspace.

(cherry picked from commit e5c024a)

Add patch release note
  • Loading branch information
dymkowsk authored and martyngigg committed Feb 27, 2017
1 parent a3ebf4d commit ded8d80
Show file tree
Hide file tree
Showing 14 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneLargerOrderAbins.nxs.md5
@@ -1 +1 @@
c00f071587df0eb690c0626c7d50c6b7
36df84d9a0bcecc9d43350a474027f20
1 change: 1 addition & 0 deletions Testing/Data/SystemTest/BenzeneScale.nxs.md5
@@ -0,0 +1 @@
923d886b3cbad14bffa14c75782a5c50
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneScratchAbins.nxs.md5
@@ -1 +1 @@
4b6c42f07033ded1f17f2d42008d3c64
91f709686e985858b7e6334e6356fefb
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneSmallerOrderAbins.nxs.md5
@@ -1 +1 @@
4139453fd1081e415a364973e3779cca
1c5de7f7bd927680b4869112ae62dc03
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/BenzeneTAbins.nxs.md5
@@ -1 +1 @@
5970791a49af584310af004fb26d055c
036359f44df9beb793e5d7e267e96f15
2 changes: 1 addition & 1 deletion Testing/Data/SystemTest/Crystalb3lypScratchAbins.nxs.md5
@@ -1 +1 @@
30f46fc38d280d27f944d8a078699ec2
b9299d7d95aee7a583bfa5939a2247d7
@@ -1 +1 @@
c907ea22a74082b61c6f81192503ea15
3ecf242b5538fa3df2f6b443548120db
2 changes: 1 addition & 1 deletion Testing/Data/UnitTest/Si2-sc_CalculateSPowder_S.txt.md5
@@ -1 +1 @@
d7b15926be182560527f3266e625b379
c89208aab5f05dec2b1dc301acedc098
@@ -1 +1 @@
891f2c88d600bbdd69a2b7d5a1b5c872
769f015c42985496ee5218621b206602
@@ -1 +1 @@
c853db9391459be5161a4e57f318b900
94f9d94cc7344dd85a375de868086780
20 changes: 4 additions & 16 deletions Testing/SystemTests/tests/analysis/AbinsTest.py
Expand Up @@ -286,7 +286,7 @@ class AbinsCASTEPTestScale(stresstesting.MantidStressTest, HelperTestingClass):
In this benchmark it is tested if scaling is correct.
"""
_wrk_1 = None
_wrk_2 = None
_ref_result = None

def skipTests(self):
return skip_tests()
Expand All @@ -296,7 +296,8 @@ def runTest(self):

scaling_factor = 2.0

name = "BenzeneNoScale"
name = "BenzeneScale"
self.ref_result = name + ".nxs"
self.set_dft_program("CASTEP")
self.set_name(name)
self.set_order(AbinsConstants.QUANTUM_ORDER_TWO)
Expand All @@ -308,21 +309,8 @@ def runTest(self):
Operation='Multiply',
Factor=scaling_factor)

self._output_name = ""
name = "BenzeneScale"
self.set_dft_program("CASTEP")
self.set_name(name)
self.set_order(AbinsConstants.QUANTUM_ORDER_TWO)
self.set_scale(scaling_factor)
self.case_from_scratch()

self._wrk_2 = self._output_name

def validateMethod(self):
return "validateWorkspaceToWorkspace"

def validate(self):
return self._wrk_1, self._wrk_2
return self._output_name, self.ref_result

# ----------------------------------------------------------------------------------------------------------------
# Tests for 2D S
Expand Down
3 changes: 3 additions & 0 deletions docs/source/release/v3.9.1/index.rst
Expand Up @@ -41,6 +41,7 @@ Changes in this version
* `18959 <https://www.github.com/mantidproject/mantid/pull/18959>`_ Blank instrument view with U correction
* `18972 <https://www.github.com/mantidproject/mantid/pull/18972>`_ Fix reading dead time data in Muon interface
* `18979 <https://www.github.com/mantidproject/mantid/pull/18979>`_ Fix delete confirmations in workspace dock
* `18984 <https://www.github.com/mantidproject/mantid/pull/18984>`_ Abins: Correct setting numerical zero for b_tensors
* `18995 <https://www.github.com/mantidproject/mantid/pull/18995>`_ Add bank43 to TOPAZ IDF this run cycle


Expand Down Expand Up @@ -85,6 +86,8 @@ Summary of impact
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+
| 18979 | Brings back delete confirmation dialog on removing workspace | Propagate setting to relevant objects | **medium** |
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+
| 18984 | Sets a minimum threshold for values of B tensor in Abins | Check values on load | **low** |
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+
| 18995 | Mantid now recognises bank 43 of TOPAZ | Update IDF | **low** |
+-------+-----------------------------------------------------------------------------------+---------------------------------------------+--------------+

Expand Down
1 change: 1 addition & 0 deletions scripts/AbinsModules/AbinsConstants.py
Expand Up @@ -132,6 +132,7 @@
# values of S below that are considered to be zero
S_THRESHOLD = 10e-8
THRESHOLD = 10e-15
NUM_ZERO = 10e-15

MAX_ORDER = 4 # max quantum order event

Expand Down
5 changes: 3 additions & 2 deletions scripts/AbinsModules/CalculatePowder.py
Expand Up @@ -89,8 +89,9 @@ def _calculate_powder(self):
# b_tensors[num_atoms, num_freq, dim, dim]
b_tensors = np.einsum('ijkl,ij->ijkl', np.einsum('lki, lkj->lkij', disp, disp).real, factor)

indices = b_tensors < AbinsModules.AbinsConstants.THRESHOLD
b_tensors[indices] = AbinsModules.AbinsConstants.THRESHOLD
temp = np.fabs(b_tensors)
indices = temp < AbinsModules.AbinsConstants.NUM_ZERO
b_tensors[indices] = AbinsModules.AbinsConstants.NUM_ZERO

# a_tensors[num_atoms, dim, dim]
a_tensors = np.sum(a=b_tensors, axis=1)
Expand Down

0 comments on commit ded8d80

Please sign in to comment.