Ticket #2650 (closed: fixed)

Opened 10 years ago

Last modified 5 years ago

Mantid Simple algorithm calls should return he output workspace

Reported by: Nick Draper Owned by: Martyn Gigg
Priority: critical Milestone: Release 2.0
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Nick Draper

Description

Although we need to work out how users can get the alg handle should they want it.

Then we can make the algorithm return the first output workspace as it's return value.

One idea (and it seems to be a good one!):

  1. Expose the History objects in a workspace to python
  2. Allow (in C++ and python)
    1. Users to index the history
    2. access the last algorithm easily with a lastAlgorithm() call
    3. Recreate an alg proxy from a history record
  3. check that if a reconstitued alg proxy is executed nothing untoward occurs.
  4. reconstituted alg proxies should be added to the MRU list in AlgManager to control their lifetime.
  5. As with all alg proxies only bare pointers should be apssed out to allow for future API's

Change History

comment:1 Changed 9 years ago by Martyn Gigg

(In [10920]) Refs #2650. Add abilities to the history so that any previous algorithm can be recreated plus corresponding tests."

comment:2 Changed 9 years ago by Martyn Gigg

(In [10921]) Re #2650. Fix build.

comment:3 Changed 9 years ago by Martyn Gigg

(In [10922]) Missed MantidPlot reference. Re #2650

comment:4 Changed 9 years ago by Martyn Gigg

(In [10924]) Refs #2650. Test fix.

comment:5 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

Bulk move of tickets at the end of iteration 28

comment:6 Changed 9 years ago by Mathieu Doucet

(In [11119]) Example of what a "Mantid simpler" module could look like. Just "import mantid" and have fun. Re #2650

comment:7 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 29 to Iteration 30

"New" tickets moved at the code freeze of iteration 29

comment:8 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 30 to Iteration 31

Bulk move of tickets to iteration 31 at the iteration 30 code freeze

comment:9 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:10 Changed 9 years ago by Martyn Gigg

Refs #2650. Tidy up script for python export class template creation.

Changeset: 3fc93cdb833555cb07b775ea88adbbc2ae226159

comment:11 Changed 9 years ago by Martyn Gigg

Refs #2650. Made a mistake with git add at the wrong point.

Changeset: d1ec92d70881a4291ed1ab2f78d34d29bd389b30

comment:12 Changed 9 years ago by Martyn Gigg

Refs #2650. Ported mantidsimple to PythonInterface.

The dialog functions don't work yet and the functions don't return anything yet.

Changeset: 9317b348996e0ea3e58f926945d9795c373e31a2

comment:13 Changed 9 years ago by Martyn Gigg

Refs #2650. ADS in Python now upcasts its returned pointers.

The ADS in Python now both returns weak_ptrs to objects, to avoid holding on to memory and also upcasts these pointers to the correct type.

Changeset: afbfdaf150188c256438d4ff83e66e6a830c98ac

comment:14 Changed 9 years ago by Martyn Gigg

Refs #2650. A Call-stack check for PyExec when creating algorithms in python.

Calling mtd.create_algorithm from Python checks whether the algorithm should be managed/unmanaged so that when Python algorithms create algorithms they are automatically unmanaged as they should be. Also tidied up a few tests by replacing calls to Load with calls to CreateWorkspace.

Changeset: 0a4e969347a18510d466a98cb221c19ded88291a

comment:15 Changed 9 years ago by Martyn Gigg

Refs #2650. Better PythonAlgorithm test.

Changeset: c71540f768845fa01b611d9f5977cb6159fe8903

comment:16 Changed 9 years ago by Martyn Gigg

Refs #2650. Remove Py_ssize_t typedef and use boost one.

Also ported lhs_info over to new module in PythonInterface ready for use in simple API

Changeset: 3a21f4b7ec9dc0ef7432d493384f8d79413107e4

comment:17 Changed 9 years ago by Martyn Gigg

Refs #2650. Clarify the type for RHEL5

Changeset: c0b9dfef075470c73f7ed7a211dbc1b97d3222e3

comment:18 Changed 9 years ago by Martyn Gigg

Refs #2650. Missed a Py_ssize_t reference.

Changeset: e100faa01b69e0d75edaee02619d223aec1f169e

comment:19 Changed 9 years ago by Martyn Gigg

Refs #2650. Python simple API now returns output values.

There are tests for the simple cases but more are required to test the complex possibilities to ensure the logic is absoloutely correct.

Changeset: aa69524a130176dc6289382130f7f87ca8aff1cf

comment:20 Changed 9 years ago by Martyn Gigg

Refs #2650. Update Python Load for workspace returns.

Added tests as well but still more required for the simple API.

Changeset: f8e22b30c868eb480a47b3b1b091a0293af2dbbd

comment:21 Changed 9 years ago by Martyn Gigg

Refs #2650. Make the mantid python module a little quieter on import.

This also avoids warnings from boost python that could crop up with some import configurations, i.e. from mantid import simpleapi. Also added a better docstring to the mantid module init.

Changeset: d0a422def4d9d3efe7061096085a786e4b82934c

comment:22 Changed 9 years ago by Martyn Gigg

Refs #2650. Python 2.4 doesn't understand relative imports.

Changeset: 5ce820243ac97c06d4b6c95ff7524360e301a171

comment:23 Changed 9 years ago by Martyn Gigg

Refs #2650. Simplfy kernel package import for Python2.4 compatibility

Using the fully-qualified package name both avoids boost python warnings and works on all python versions.

Changeset: 14f908ad35e29c87698e5ebd0738e65f17c42a10

comment:24 Changed 9 years ago by Martyn Gigg

Refs #2650. Implmented more tests for new-style Python simple api.

Changeset: 215b7171b7cc7464b3d858ea31c9285b8f383df5

comment:25 Changed 9 years ago by Martyn Gigg

Refs #2650. Python SimpleAPI test fixes.

Changeset: 5e4f46f7a1a6d4421d55861627d227d0435bff84

comment:26 Changed 9 years ago by Martyn Gigg

Refs #2650. Add a version string to the mantid Python module.

Python modules tend to have a version attribute with the version number of the program contained within the string. Add one of these with the version coming from MantidVersion::version.

Changeset: ce1723d559e79b45032dbd368c1dd8b707d516d3

comment:27 Changed 9 years ago by Martyn Gigg

Refs #2650 Make FileFinder consistent when not finding things.

Archive searching was generating Poco exceptions instead of being consistent with the interface.

Changeset: e66a483c3f9f9c8d04ac7f0d509c811ce309f77f

comment:28 Changed 9 years ago by Martyn Gigg

Refs #2650. Be consistent but don't break old stuff.

Changeset: cd00ef327653959f238d71830615f5d543da8342

comment:29 Changed 9 years ago by Martyn Gigg

Refs #2650. Add back the *Dialog functions in to the simple API.

The algorithm execution is still single-threaded so that's the next port of call.

Changeset: 78e8ada7c14d17c76a829c25988eeaa9c6ffa338

comment:30 Changed 9 years ago by Martyn Gigg

Refs #2650. Algorithm execution is now asynchronous when needed.

In the new Python interface algorithms created via the framework manager have an async attribute added to them. Execute tests this flag and runs accordingly.

Changeset: dad61321dcf922604fd5424c4c8e32931640f759

comment:31 Changed 9 years ago by Martyn Gigg

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

comment:32 Changed 9 years ago by Martyn Gigg

Refs #2650. Export the Logger class to Python.

Load needs to warn users if it has been passed a property it does not understand. Use the logger to do this rather then print.

Changeset: 8e4d8b15ec26d0ce762bc03ab9fc00c11034517c

comment:33 Changed 9 years ago by Nick Draper

  • Status changed from verify to verifying
  • Tester set to Nick Draper

comment:34 Changed 9 years ago by Nick Draper

  • Status changed from verifying to closed

Tested with a smattering of many algorithms, including 1 and multi outputworkspace algorithms

comment:35 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3497

Note: See TracTickets for help on using tickets.