Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix BinMD when used with a file-backed MD workspace #345

Merged
merged 2 commits into from Mar 4, 2015

Conversation

martyngigg
Copy link
Member

Fixes trac issue #11220

Tester

The following script will crash with the current version of master. After this fix the script should complete successfully. You can also run the MDWorkspaceTest system tests.

import os

from mantid.simpleapi import *

barefilename = "cncs.nxs"
try:
    os.remove(os.path.join(config["defaultsave.directory"], barefilename))
except OSError:
    pass

# Load then convert to Q in the lab frame
LoadEventNexus(Filename=r'CNCS_7860_event.nxs',OutputWorkspace='cncs_nxs')

ConvertToDiffractionMDWorkspace(InputWorkspace='cncs_nxs', OutputWorkspace='cncs_original', SplitInto=2)
alg = SaveMD(InputWorkspace='cncs_original', Filename=barefilename)

# Load into memory
LoadMD(Filename=barefilename,FileBackEnd='0',Memory='100',OutputWorkspace='cncs_mem')

# ======== File + mem, with write buffer ===========
LoadMD(Filename='cncs.nxs',FileBackEnd='1',Memory='100',OutputWorkspace='cncs_file')
PlusMD(LHSWorkspace="cncs_file", RHSWorkspace="cncs_mem", OutputWorkspace="cncs_file")
BinMD(InputWorkspace="cncs_file",AlignedDim0='Q_lab_x, -3, 3, 100',AlignedDim1='Q_lab_y, -3, 3, 100',AlignedDim2='Q_lab_z, -3, 3, 100',ForceOrthogonal='1',OutputWorkspace="test_binned")

DeleteWorkspace('cncs_file')

It turns out that the NeXus object is not as persistent throughout
the system as was first suspected.
Refs #11220
@martyngigg martyngigg added this to the Release 3.4 milestone Mar 4, 2015
@martyngigg
Copy link
Member Author

@FedeMPouzols Would you mind taking a look at this? It fixes the my ticket that you tested yesterday. A system test picked up a minor hole in the implementation.

@FedeMPouzols FedeMPouzols self-assigned this Mar 4, 2015
@FedeMPouzols
Copy link
Contributor

Nice, the example script is working well and the MDWTest passes now.
I'm running all system tests to make absolutely sure, and will merge this in.

FedeMPouzols added a commit that referenced this pull request Mar 4, 2015
…acked_ws

Fix BinMD when used with a file-backed MD workspace
@FedeMPouzols FedeMPouzols merged commit 97f8c8b into master Mar 4, 2015
@FedeMPouzols FedeMPouzols deleted the 11220_fix_binmd_with_filebacked_ws branch March 4, 2015 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants