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

Fit algorithm with MultiDomainFunction stores some workspaces in ADS even if StoreInADS=False #38476

Open
RichardWaiteSTFC opened this issue Dec 5, 2024 · 0 comments
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS
Milestone

Comments

@RichardWaiteSTFC
Copy link
Contributor

RichardWaiteSTFC commented Dec 5, 2024

Describe the bug
Fit algorithm with MultiDomainFunction stores workspaces in ADS even if StoreInADS=False

To Reproduce
(1) Run this script

from mantid.simpleapi import *
from mantid.api import MultiDomainFunction, FunctionFactory
from mantid.fitfunctions import FunctionWrapper
                          

comp_func = CompositeFunction(Gaussian(Height=1, Sigma=0.3, PeakCentre=3), FunctionWrapper("FlatBackground"), NumDeriv=True)
ws = CreateSampleWorkspace(OutputWorkspace='ws', Function='User Defined', UserDefinedFunction=str(comp_func), XUnit='DeltaE', 
                           XMax=7, BinWidth=0.1, NumBanks=1, BankPixelWidth=2)

func = MultiDomainFunction()        
md_fit_kwargs = {}
for ispec in range(ws.getNumberHistograms()):
    func.add(comp_func.function)
    func.setDomainIndex(ispec,ispec)
    key_suffix = f"_{ispec}" if ispec > 0 else ""
    md_fit_kwargs["InputWorkspace" + key_suffix] = ws.name()
    md_fit_kwargs["StartX" + key_suffix] = 0.1
    md_fit_kwargs["EndX" + key_suffix] = 6.8
    md_fit_kwargs["WorkspaceIndex" + key_suffix] = ispec


out = Fit(Function=str(func), Output='ws', StoreInADS=False, CreateOutput=True, OutputCompositeMembers=True,
          **md_fit_kwargs)

(2) For StoreInADS=False get this
image

(3) For StoreInADS=True get this
image

Expected behavior
Would not have workspaces ws_Wortkspace_0 etc. in ADS when StoreInADS=False

@RichardWaiteSTFC RichardWaiteSTFC added Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS labels Dec 5, 2024
@RichardWaiteSTFC RichardWaiteSTFC added this to the Release 6.12 milestone Dec 5, 2024
RichardWaiteSTFC added a commit that referenced this issue Dec 11, 2024
need to be in ADS due to bug in issue #38476
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Issues and pull requests that are regressions or would be considered a bug by users (e.g. crashing) ISIS Team: Core Issue and pull requests managed by the Core subteam at ISIS
Projects
Status: No status
Development

No branches or pull requests

1 participant