Skip to content

Crash in PolarizationEfficiencyCor algorithm for wrong input #39832

@adriazalvarez

Description

@adriazalvarez

Describe the bug

The algorithm 'PolarizationEfficiencyCor' accepts inputs in two formats, as a list of workspaces: InputWorkspaces property or as a group InputWorkspaceGroup.
If the name of a group workspace is put on the list of InputWorkspaces, mantid crashes.

To Reproduce

This script crashes mantid on the current nightly:

from mantid.simpleapi import *

names = []
for i in range(4):
    names.append(f'group_{i}')
    CreateWorkspace(DataX=np.linspace(0,5,6), DataY=[1]*5, OutputWorkspace=names[-1],Distribution=False, UnitX='Wavelength')
group = GroupWorkspaces(names)
ws=names[-1]
efficiencies= JoinISISPolarizationEfficiencies(F1=ws,F2=ws,P1=ws,P2=ws)
PolarizationEfficiencyCor(InputWorkspaces='group', OutputWorkspace='corr', Efficiencies=efficiencies)

Expected behavior

Probably the best would be to check this at the validation level: if there is a group on the list of input workspaces send error and warn the user with a message hinting at using the other property for groups.

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugIssues and pull requests that are regressions or would be considered a bug by users (e.g. crashing)ISIS: LSSIssue and pull requests relating to SANS and Reflectometry (Large Scale Structures) at ISIS

    Type

    Projects

    Status

    In Developer Review

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions