-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a WorkspaceGroupProperty to Python. Refs #6603
- Loading branch information
1 parent
9b7998e
commit ec6a8ba
Showing
4 changed files
with
49 additions
and
3 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
Code/Mantid/Framework/PythonInterface/PythonAlgorithms/TestWorkspaceGroupProperty.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""*WIKI* | ||
*WIKI*""" | ||
|
||
|
||
from mantid.kernel import * | ||
from mantid.api import * | ||
import numpy as np | ||
|
||
import os | ||
|
||
class TestWorkspaceGroupProperty(PythonAlgorithm): | ||
""" | ||
""" | ||
|
||
def category(self): | ||
return "PythonAlgorithms" | ||
|
||
def name(self): | ||
return "WorkspaceGroupProperty" | ||
|
||
def PyInit(self): | ||
self.declareProperty(WorkspaceGroupProperty("InputWorkspace", "", Direction.Input), doc="Group workspace that automatically includes all members.") | ||
self.declareProperty(MatrixWorkspaceProperty("InputWorkspace2", "", Direction.Input), doc="asd") | ||
|
||
def PyExec(self): | ||
ws = self.getProperty("InputWorkspace").value | ||
logger.notice("Input type: %s" % str(type(ws))) | ||
ws2 = self.getProperty("InputWorkspace2").value | ||
logger.notice("Input type: %s" % str(type(ws2))) | ||
|
||
|
||
registerAlgorithm(TestWorkspaceGroupProperty) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
Code/Mantid/Framework/PythonInterface/mantid/api/src/Exports/WorkspaceGroupProperty.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include "MantidPythonInterface/api/WorkspacePropertyMacro.h" | ||
#include "MantidAPI/WorkspaceGroup.h" | ||
|
||
void export_WorkspaceGroupProperty() | ||
{ | ||
using Mantid::API::WorkspaceGroup; | ||
EXPORT_WORKSPACE_PROPERTY(WorkspaceGroup, "WorkspaceGroupProperty"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters