Ticket #5180 (closed: fixed)

Opened 8 years ago

Last modified 5 years ago

fit algorithm does not export all its property to python correctly.

Reported by: Alex Buts Owned by: Roman Tolchenov
Priority: major Milestone: Release 2.1
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Alex Buts

Description (last modified by Alex Buts) (diff)

when one tries to fit a workspace from GUI, he usually selects a spectrum, then workspace area where to fit and then chooses some additional parameters (e.g. the width of the region or guess sigma).

If one achieves correct fit after that, he may want to obtain workspace history and convert this history into workspace script. The workspace history from GUI looks fine, but copying it into python script brings only some basic Fit properties, loosing all additional (dynamic) properties.

E.g.:

"successful" fit for Mari Monitor-3 workspace can be generated by script:

Load(Filename='D:/Data/Mantid_GIT/Test/AutoTestData/MAR11001.raw',OutputWorkspace='MAR11001',LoadMonitors='Separate')
Fit(Function='name=Lorentzian,Height=1438.81,PeakCentre=11146.6,HWHM=10.7813',InputWorkspace='MAR11001_Monitors',Output='Monitors_3',StartX='11000',EndX='11250',WorkspaceIndex='2')


if one runs this script, rises the history and generates the new script, only static properties appear copied to the python script.

Load(Filename='D:/Data/Mantid_GIT/Test/AutoTestData/MAR11001.raw',OutputWorkspace='MAR11001',LoadMonitors=r'Separate')
Fit(Function='name=Lorentzian,Height=1429.43,PeakCentre=11146.3,HWHM=-10.8513',InputWorkspace='MAR11001_Monitors',Output='Monitors_3')

This script would even run on different workspace spectrum.

P.S: Load algorithm uses dynamic properties in a way similar to the Fit and is copied to python correctly, but it is a special case in CopyToPython algorithm.

Change History

comment:1 Changed 8 years ago by Alex Buts

  • Description modified (diff)

comment:2 Changed 8 years ago by Nick Draper

  • Owner set to Roman Tolchenov
  • Status changed from new to assigned

Is there anything we can do about this? Paticularly in the short term?

comment:3 Changed 8 years ago by Roman Tolchenov

  • Status changed from assigned to accepted

comment:4 Changed 8 years ago by Roman Tolchenov

Re #5180. Made a special case for Fit in GeneratePythonScript.

Changeset: 32dd6559da2446a398e39abeea7cfb578a349670

comment:5 Changed 8 years ago by Roman Tolchenov

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:6 Changed 8 years ago by Alex Buts

  • Status changed from verify to verifying
  • Tester set to Alex Buts

comment:7 Changed 8 years ago by Alex Buts

  • Status changed from verifying to closed

fixed

comment:8 Changed 8 years ago by Roman Tolchenov

Re #5180. Made a special case for Fit in GeneratePythonScript.

Changeset: 32dd6559da2446a398e39abeea7cfb578a349670

comment:9 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 6026

Note: See TracTickets for help on using tickets.