Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
a9d530ae
Commit
a9d530ae
authored
9 years ago
by
Alex Buts
Browse files
Options
Downloads
Patches
Plain Diff
Re #14022 Mean Clang
parent
3ba5b44e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
+13
-18
13 additions, 18 deletions
...ythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
with
13 additions
and
18 deletions
Framework/PythonInterface/mantid/api/src/Exports/MatrixWorkspace.cpp
+
13
−
18
View file @
a9d530ae
...
...
@@ -15,8 +15,6 @@
#include
<boost/python/overloads.hpp>
#include
<boost/python/register_ptr_to_python.hpp>
using
namespace
Mantid
::
API
;
using
namespace
Mantid
::
Geometry
;
using
namespace
Mantid
::
Kernel
;
...
...
@@ -86,15 +84,16 @@ void setSpectrumFromPyObject(MatrixWorkspace &self, data_modifier accessor,
* @param self :: A reference to the calling object
* @param value :: The python pointer to the workspace to set
*/
void
setMonitorWorkspace
(
MatrixWorkspace
&
self
,
const
boost
::
python
::
object
&
value
){
void
setMonitorWorkspace
(
MatrixWorkspace
&
self
,
const
boost
::
python
::
object
&
value
)
{
MatrixWorkspace_sptr
monWS
=
boost
::
dynamic_pointer_cast
<
MatrixWorkspace
>
(
Mantid
::
PythonInterface
::
ExtractWorkspace
(
value
)());
if
(
monWS
)
{
if
(
monWS
.
get
()
==
&
self
){
throw
std
::
runtime_error
(
"To avoid memory leak, monitor workspace"
" can not be the same workspace as the host workspace"
);
MatrixWorkspace_sptr
monWS
=
boost
::
dynamic_pointer_cast
<
MatrixWorkspace
>
(
Mantid
::
PythonInterface
::
ExtractWorkspace
(
value
)());
if
(
monWS
)
{
if
(
monWS
.
get
()
==
&
self
)
{
throw
std
::
runtime_error
(
"To avoid memory leak, monitor workspace"
" can not be the same workspace as the host workspace"
);
}
}
self
.
setMonitorWorkspace
(
monWS
);
...
...
@@ -104,12 +103,11 @@ void setMonitorWorkspace(MatrixWorkspace &self,const boost::python::object &valu
*
* @param self :: A reference to the calling object
*/
void
clearMonitorWorkspace
(
MatrixWorkspace
&
self
){
void
clearMonitorWorkspace
(
MatrixWorkspace
&
self
)
{
MatrixWorkspace_sptr
monWS
;
self
.
setMonitorWorkspace
(
monWS
);
}
/**
* Set the X values from an python array-style object
* @param self :: A reference to the calling object
...
...
@@ -179,7 +177,6 @@ Mantid::API::Run &getSampleDetailsDeprecated(MatrixWorkspace &self) {
}
}
/** Python exports of the Mantid::API::MatrixWorkspace class. */
void
export_MatrixWorkspace
()
{
/// Typedef to remove const qualifier on input detector shared_ptr. See
...
...
@@ -353,20 +350,18 @@ void export_MatrixWorkspace() {
"Performs a comparison operation on two workspaces, using the "
"CheckWorkspacesMatch algorithm"
)
//--------- monitor workspace --------------------------------------
.
def
(
"getMonitorWorkspace"
,
&
MatrixWorkspace
::
monitorWorkspace
,
.
def
(
"getMonitorWorkspace"
,
&
MatrixWorkspace
::
monitorWorkspace
,
args
(
"self"
),
"Return internal monitor workspace bound to current workspace."
)
.
def
(
"setMonitorWorkspace"
,
&
setMonitorWorkspace
,
.
def
(
"setMonitorWorkspace"
,
&
setMonitorWorkspace
,
args
(
"self"
,
"MonitorWS"
),
"Set specified workspace as monitor workspace for"
"current workspace. "
"Note: The workspace does not have to contain monitors though "
"some subsequent algorithms may expect it to be "
"monitor workspace later."
)
.
def
(
"clearMonitorWorkspace"
,
&
clearMonitorWorkspace
,
args
(
"self"
),
.
def
(
"clearMonitorWorkspace"
,
&
clearMonitorWorkspace
,
args
(
"self"
),
"Forget about monitor workspace, attached to the current workspace"
);
RegisterWorkspacePtrToPython
<
MatrixWorkspace
>
();
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment