Ticket #947 (closed: fixed)

Opened 11 years ago

Last modified 5 years ago

Workspace Algebra & other Python enchancements

Reported by: Nick Draper Owned by: Martyn Gigg
Priority: critical Milestone: Iteration 21
Component: Keywords:
Cc: Blocked By:
Blocking: Tester:

Description (last modified by Nick Draper) (diff)

This should cover the following related items:

  • Enabling Workspace overloads to perform +,-,*,/
  • Automatically extracting output workspaces to global variables in python
    • Including refreshing these before each run of scripts from within Mantidplot
    • Dead workspace variables need to die gracefully
  • SimplePythonAPI algorithms need to accept workspace variables as input and output workspaces
    • This might be done by overloading the action of the str() Fn
  • Make it easier to print the workspace list in python

Change History

comment:1 Changed 11 years ago by Nick Draper

  • Priority changed from major to critical
  • Summary changed from Workspace Algebra & othe Python nchancements to Workspace Algebra & other Python enchancements

comment:2 Changed 11 years ago by Nick Draper

  • Description modified (diff)

comment:3 Changed 11 years ago by Martyn Gigg

(In [3366]) Added workspace operator overloads to Python API. The wrappers have also been split out into separate files, one for each namespace, so that there is a bit more structure. Re #947

comment:4 Changed 11 years ago by Martyn Gigg

(In [3367]) I forgot a few other changes that I had made for the workspace algebra stuff. Re #947

comment:5 Changed 11 years ago by Martyn Gigg

(In [3368]) Fix the ADS test. Re #947

comment:6 Changed 11 years ago by Martyn Gigg

(In [3382]) Added a Framework class written in Python, which inherits from the C++ one, to be the main interaction point from Python so that we can keep track of dead workspaces and set their variables to None. Re #947

comment:7 Changed 11 years ago by Martyn Gigg

(In [3385]) Fix for broken test compilation. Re #947

comment:8 Changed 11 years ago by Martyn Gigg

(In [3387]) Fix to installer script. Re #947

comment:9 Changed 11 years ago by Martyn Gigg

(In [3394]) Added notifications for replacing a workspace to the PyFrameworkManager. Also added protection for threaded enviroments calling Python code. Re #947

comment:10 Changed 11 years ago by Martyn Gigg

(In [3396]) Added methods for more easily accessing workspaces from algorithms. Re #947

comment:11 Changed 11 years ago by Martyn Gigg

(In [3400]) Switched off Python framework observers until I've sorted the threading issues properly. Re #947

comment:12 Changed 11 years ago by Martyn Gigg

(In [3402]) Reimplemented the Python notification listeners. The Python Framework now has to be told whether to try and acquire the global interpreter lock. This should aboid the deadlock issue in MantidPlot. Re #947

comment:13 Changed 11 years ago by Martyn Gigg

(In [3405]) Added a simple list method to the Python framework for printing the workspace list more easily. Also improved access on the WorkspaceProxy for groups, you can ask it if it is group and it is also indexable. Re #947

comment:14 Changed 11 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:15 Changed 11 years ago by Martyn Gigg

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

comment:16 Changed 11 years ago by Russell Taylor

  • Status changed from testing to closed

Worked for me.

comment:17 Changed 11 years ago by Russell Taylor

  • Status changed from closed to reopened
  • Resolution fixed deleted

Actually, right after this I discovered a few issue:

  • No history is produced when running these (right click and "Show History on the output workspace does nothing).
  • Put a single value as the first argument of one of the non-commuting binary operations and they get swapped around. I.e. ask for 2/a and you get a/2, ask for 1-a and you get a-1.
  • In fact, it turns out that the algorithms themselves won't let you do this. They report that "The sizes of the two workspaces are not compatible".

comment:18 Changed 11 years ago by Martyn Gigg

(In [3501]) Fixes for workspace algebra operators in reverse order. Re #947

comment:19 Changed 11 years ago by Martyn Gigg

  • Status changed from reopened to accepted

comment:20 Changed 11 years ago by Martyn Gigg

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

comment:21 Changed 11 years ago by Steve Williams

  • Status changed from testing to closed

comment:22 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 1795

Note: See TracTickets for help on using tickets.