Ticket #3030 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Expose the creation of TableWorkspaces to Python

Reported by: Martyn Gigg Owned by: Martyn Gigg
Priority: major Milestone: Release 2.1
Component: Mantid Keywords:
Cc: Blocked By:
Blocking: Tester: Andrei Savici

Description

We currently only allow MatrixWorkspaces to be created within PythonAlgorithms. We should try and align this more to the C++ API and be more flexible.

Change History

comment:1 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:2 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:3 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 32 to Iteration 33

Moved to iteration 33 at iteration 32 code freeze

comment:4 Changed 9 years ago by Martyn Gigg

  • Status changed from new to accepted

comment:5 Changed 9 years ago by Martyn Gigg

Export the WorkspaceFactory to Python. Refs #4399 #3030

Added the creation of table worksapces as well. It required adding a conversion between shared_ptr<T> and shared_ptr<const T> which should be there for each shared_ptr type. Hence the large amount of changes.

Changeset: 84088ff061a3c1e092278d980424ffd7f104741d

comment:6 Changed 9 years ago by Martyn Gigg

Methods for adding columns/rows to tables from Python. Refs #3030

Changeset: ac1874424f00402d00f49ecff46abe63760a31ee

comment:7 Changed 9 years ago by Martyn Gigg

Add a setCell function to ITableWorkspace export. Refs #3030

Changeset: 96b24891e6bee7750fd5706fab430e0ff42776c2

comment:8 Changed 9 years ago by Martyn Gigg

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

comment:9 Changed 9 years ago by Martyn Gigg

Export the WorkspaceFactory to Python. Refs #4399 #3030

Added the creation of table worksapces as well. It required adding a conversion between shared_ptr<T> and shared_ptr<const T> which should be there for each shared_ptr type. Hence the large amount of changes.

Changeset: 84088ff061a3c1e092278d980424ffd7f104741d

comment:10 Changed 9 years ago by Martyn Gigg

Methods for adding columns/rows to tables from Python. Refs #3030

Changeset: ac1874424f00402d00f49ecff46abe63760a31ee

comment:11 Changed 9 years ago by Martyn Gigg

Add a setCell function to ITableWorkspace export. Refs #3030

Changeset: 96b24891e6bee7750fd5706fab430e0ff42776c2

comment:12 Changed 8 years ago by Andrei Savici

  • Status changed from verify to verifying
  • Tester set to Andrei Savici

comment:13 Changed 8 years ago by Andrei Savici

kind of works.

w=WorkspaceFactory.createTable()
print w.columnCount()
0

w.addColumn('float','test')
w.addRow({'test':1.0})

print w.cell('test',0)
1.0

However, I do not see it in the workspaces,

print mtd.getObjectNames()
[]

Am I doing anything wrong?

comment:14 Changed 8 years ago by Martyn Gigg

This was only intended for PythonAlgorithms. The workspace needs to be stored in the ADS for it to be viewable from outside. It's not done by default as you may create temporary ones that you don't want people to see outside the algorithm. So essentially is the workspace was set as the value on a property then it would get shown.

comment:15 Changed 8 years ago by Andrei Savici

  • Status changed from verifying to closed

comment:16 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3877

Note: See TracTickets for help on using tickets.