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
0b8fab94
Commit
0b8fab94
authored
4 years ago
by
Owen Arnold
Browse files
Options
Downloads
Patches
Plain Diff
Expose via Sample __eq__
parent
3ec9a185
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp
+2
-1
2 additions, 1 deletion
Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp
Framework/PythonInterface/test/python/mantid/api/SampleTest.py
+6
-2
6 additions, 2 deletions
...work/PythonInterface/test/python/mantid/api/SampleTest.py
with
8 additions
and
3 deletions
Framework/PythonInterface/mantid/api/src/Exports/Sample.cpp
+
2
−
1
View file @
0b8fab94
...
@@ -87,5 +87,6 @@ void export_Sample() {
...
@@ -87,5 +87,6 @@ void export_Sample() {
return_internal_reference
<>
())
return_internal_reference
<>
())
.
def
(
"__copy__"
,
&
Mantid
::
PythonInterface
::
generic__copy__
<
Sample
>
)
.
def
(
"__copy__"
,
&
Mantid
::
PythonInterface
::
generic__copy__
<
Sample
>
)
.
def
(
"__deepcopy__"
,
.
def
(
"__deepcopy__"
,
&
Mantid
::
PythonInterface
::
generic__deepcopy__
<
Sample
>
);
&
Mantid
::
PythonInterface
::
generic__deepcopy__
<
Sample
>
)
.
def
(
"__eq__"
,
&
Sample
::
operator
==
,(
arg
(
"self"
),
arg
(
"other"
)));
}
}
This diff is collapsed.
Click to expand it.
Framework/PythonInterface/test/python/mantid/api/SampleTest.py
+
6
−
2
View file @
0b8fab94
...
@@ -124,8 +124,12 @@ class SampleTest(unittest.TestCase):
...
@@ -124,8 +124,12 @@ class SampleTest(unittest.TestCase):
def
test_deep_copyable
(
self
):
def
test_deep_copyable
(
self
):
self
.
do_test_copyable
(
copy
.
deepcopy
)
self
.
do_test_copyable
(
copy
.
deepcopy
)
def
test_equals
(
self
):
a
=
Sample
()
b
=
Sample
()
self
.
assertEqual
(
a
,
b
)
b
.
setThickness
(
10
)
self
.
assertNotEqual
(
a
,
b
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
unittest
.
main
()
unittest
.
main
()
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