Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
68d83e83
Commit
68d83e83
authored
Jan 01, 2017
by
Hahn, Steven
Browse files
Remove duplicate member function DataItem::name().
parent
7b295062
Changes
123
Hide whitespace changes
Inline
Side-by-side
Framework/API/inc/MantidAPI/Workspace.h
View file @
68d83e83
...
...
@@ -69,8 +69,6 @@ public:
Workspace_uptr
clone
()
const
{
return
Workspace_uptr
(
doClone
());
}
Workspace
&
operator
=
(
const
Workspace
&
other
)
=
delete
;
// DataItem interface
/// Name
const
std
::
string
name
()
const
override
{
return
this
->
getName
();
}
/** Marks the workspace as safe for multiple threads to edit data
* simutaneously.
* Workspace creation is always considered to be a single threaded operation.
...
...
@@ -83,7 +81,7 @@ public:
void
setComment
(
const
std
::
string
&
);
virtual
const
std
::
string
getTitle
()
const
;
const
std
::
string
&
getComment
()
const
;
const
std
::
string
&
getName
()
const
;
const
std
::
string
&
getName
()
const
override
;
bool
isDirty
(
const
int
n
=
1
)
const
;
/// Get the footprint in memory in bytes.
virtual
size_t
getMemorySize
()
const
=
0
;
...
...
Framework/API/inc/MantidAPI/WorkspaceGroup.h
View file @
68d83e83
...
...
@@ -93,16 +93,16 @@ public:
/// Invokes the ADS to sort group members by orkspace name
void
sortByName
()
{
AnalysisDataService
::
Instance
().
sortGroupByName
(
this
->
n
ame
());
AnalysisDataService
::
Instance
().
sortGroupByName
(
this
->
getN
ame
());
}
/// Adds a workspace to the group.
void
add
(
const
std
::
string
&
wsName
)
{
AnalysisDataService
::
Instance
().
addToGroup
(
this
->
n
ame
(),
wsName
);
AnalysisDataService
::
Instance
().
addToGroup
(
this
->
getN
ame
(),
wsName
);
}
/// Remove a name from the group
void
remove
(
const
std
::
string
&
wsName
)
{
AnalysisDataService
::
Instance
().
removeFromGroup
(
this
->
n
ame
(),
wsName
);
AnalysisDataService
::
Instance
().
removeFromGroup
(
this
->
getN
ame
(),
wsName
);
}
/// Does a workspace exist within the group
bool
contains
(
const
std
::
string
&
wsName
)
const
;
...
...
Framework/API/inc/MantidAPI/WorkspaceProperty.tcc
View file @
68d83e83
...
...
@@ -108,7 +108,7 @@ operator=(const WorkspaceProperty &right) {
template <typename TYPE>
boost::shared_ptr<TYPE> &WorkspaceProperty<TYPE>::
operator=(const boost::shared_ptr<TYPE> &value) {
std::string wsName = value->
n
ame();
std::string wsName = value->
getN
ame();
if (this->direction() == Kernel::Direction::Input && !wsName.empty()) {
m_workspaceName = wsName;
}
...
...
@@ -180,7 +180,7 @@ std::string WorkspaceProperty<TYPE>::setDataItem(
const boost::shared_ptr<Kernel::DataItem> value) {
boost::shared_ptr<TYPE> typed = boost::dynamic_pointer_cast<TYPE>(value);
if (typed) {
std::string wsName = typed->
n
ame();
std::string wsName = typed->
getN
ame();
if (this->direction() == Kernel::Direction::Input && !wsName.empty()) {
m_workspaceName = wsName;
}
...
...
Framework/API/src/Algorithm.cpp
View file @
68d83e83
...
...
@@ -1124,7 +1124,7 @@ bool Algorithm::checkGroups() {
AnalysisDataService
::
Instance
().
retrieve
(
name
);
if
(
!
memberWS
)
throw
std
::
invalid_argument
(
"One of the members of "
+
wsGroup
->
n
ame
()
+
", "
+
name
+
wsGroup
->
getN
ame
()
+
", "
+
name
+
" was not found!."
);
thisGroup
.
push_back
(
memberWS
);
}
...
...
@@ -1288,12 +1288,12 @@ bool Algorithm::processGroups() {
// Append the names together
if
(
!
outputBaseName
.
empty
())
outputBaseName
+=
"_"
;
outputBaseName
+=
ws
->
n
ame
();
outputBaseName
+=
ws
->
getN
ame
();
// Set the property using the name of that workspace
if
(
Property
*
prop
=
dynamic_cast
<
Property
*>
(
m_inputWorkspaceProps
[
iwp
]))
{
alg
->
setPropertyValue
(
prop
->
name
(),
ws
->
n
ame
());
alg
->
setPropertyValue
(
prop
->
name
(),
ws
->
getN
ame
());
}
else
{
throw
std
::
logic_error
(
"Found a Workspace property which doesn't "
"inherit from Property."
);
...
...
@@ -1326,7 +1326,7 @@ bool Algorithm::processGroups() {
const
auto
&
inputGroup
=
m_groups
[
inputProp
-
m_inputWorkspaceProps
.
begin
()];
if
(
!
inputGroup
.
empty
())
outName
=
inputGroup
[
entry
]
->
n
ame
();
outName
=
inputGroup
[
entry
]
->
getN
ame
();
}
// Except if all inputs had similar names, then the name is "out_1"
...
...
Framework/API/src/AnalysisDataService.cpp
View file @
68d83e83
...
...
@@ -79,7 +79,7 @@ void AnalysisDataServiceImpl::add(
group
->
observeADSNotifications
(
true
);
for
(
size_t
i
=
0
;
i
<
group
->
size
();
++
i
)
{
auto
ws
=
group
->
getItem
(
i
);
std
::
string
wsName
=
ws
->
n
ame
();
std
::
string
wsName
=
ws
->
getN
ame
();
// if anonymous make up a name and add
if
(
wsName
.
empty
())
{
wsName
=
name
+
"_"
+
std
::
to_string
(
i
+
1
);
...
...
@@ -118,7 +118,7 @@ void AnalysisDataServiceImpl::addOrReplace(
group
->
observeADSNotifications
(
true
);
for
(
size_t
i
=
0
;
i
<
group
->
size
();
++
i
)
{
auto
ws
=
group
->
getItem
(
i
);
std
::
string
wsName
=
ws
->
n
ame
();
std
::
string
wsName
=
ws
->
getN
ame
();
// make up a name for an anonymous workspace
if
(
wsName
.
empty
())
{
wsName
=
name
+
"_"
+
std
::
to_string
(
i
+
1
);
...
...
@@ -211,9 +211,9 @@ void AnalysisDataServiceImpl::deepRemoveGroup(const std::string &name) {
WorkspaceGroup_sptr
gws
=
boost
::
dynamic_pointer_cast
<
WorkspaceGroup
>
(
ws
);
if
(
gws
)
{
// if a member is a group remove its items as well
deepRemoveGroup
(
gws
->
n
ame
());
deepRemoveGroup
(
gws
->
getN
ame
());
}
else
{
remove
(
ws
->
n
ame
());
remove
(
ws
->
getN
ame
());
}
}
remove
(
name
);
...
...
Framework/API/src/MultiPeriodGroupWorker.cpp
View file @
68d83e83
...
...
@@ -136,7 +136,8 @@ std::string MultiPeriodGroupWorker::createFormattedInputWorkspaceNames(
std
::
string
prefix
;
std
::
string
inputWorkspaces
;
for
(
const
auto
&
vecWorkspaceGroup
:
vecWorkspaceGroups
)
{
inputWorkspaces
+=
prefix
+
vecWorkspaceGroup
->
getItem
(
periodIndex
)
->
name
();
inputWorkspaces
+=
prefix
+
vecWorkspaceGroup
->
getItem
(
periodIndex
)
->
getName
();
prefix
=
","
;
}
return
inputWorkspaces
;
...
...
@@ -283,7 +284,7 @@ void MultiPeriodGroupWorker::validateMultiPeriodGroupInputs(
if
(
nPeriods
!=
benchMarkGroupSize
)
{
throw
std
::
runtime_error
(
"Missmatch between nperiods log and the "
"number of workspaces in the input group: "
+
vecMultiPeriodGroups
[
i
]
->
n
ame
());
vecMultiPeriodGroups
[
i
]
->
getN
ame
());
}
Property
*
currentPeriodProperty
=
currentNestedWS
->
run
().
getLogData
(
"current_period"
);
...
...
@@ -291,7 +292,7 @@ void MultiPeriodGroupWorker::validateMultiPeriodGroupInputs(
if
(
currentPeriod
!=
(
j
+
1
))
{
throw
std
::
runtime_error
(
"Multiperiod group workspaces must be "
"ordered by current_period. Correct: "
+
currentNestedWS
->
n
ame
());
currentNestedWS
->
getN
ame
());
}
}
}
...
...
Framework/API/src/ScopedWorkspace.cpp
View file @
68d83e83
...
...
@@ -74,9 +74,9 @@ void ScopedWorkspace::remove() {
void
ScopedWorkspace
::
set
(
Workspace_sptr
newWS
)
{
AnalysisDataServiceImpl
&
ads
=
AnalysisDataService
::
Instance
();
if
(
!
newWS
->
n
ame
().
empty
()
&&
ads
.
doesExist
(
newWS
->
n
ame
()))
if
(
!
newWS
->
getN
ame
().
empty
()
&&
ads
.
doesExist
(
newWS
->
getN
ame
()))
throw
std
::
invalid_argument
(
"Workspace is already in the ADS under the name "
+
newWS
->
n
ame
());
"Workspace is already in the ADS under the name "
+
newWS
->
getN
ame
());
// Remove previous workspace entry
remove
();
...
...
Framework/API/src/WorkspaceGroup.cpp
View file @
68d83e83
...
...
@@ -36,7 +36,7 @@ const std::string WorkspaceGroup::toString() const {
std
::
string
descr
=
this
->
id
()
+
"
\n
"
;
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
for
(
const
auto
&
workspace
:
m_workspaces
)
{
descr
+=
" -- "
+
workspace
->
n
ame
()
+
"
\n
"
;
descr
+=
" -- "
+
workspace
->
getN
ame
()
+
'
\n
'
;
}
return
descr
;
}
...
...
@@ -94,7 +94,7 @@ void WorkspaceGroup::sortMembersByName() {
}
std
::
sort
(
m_workspaces
.
begin
(),
m_workspaces
.
end
(),
[](
const
Workspace_sptr
&
w1
,
const
Workspace_sptr
&
w2
)
{
return
(
w1
->
n
ame
()
<
w2
->
n
ame
());
return
(
w1
->
getN
ame
()
<
w2
->
getN
ame
());
});
}
...
...
@@ -123,7 +123,7 @@ void WorkspaceGroup::addWorkspace(Workspace_sptr workspace) {
bool
WorkspaceGroup
::
contains
(
const
std
::
string
&
wsName
)
const
{
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
for
(
const
auto
&
workspace
:
m_workspaces
)
{
if
(
(
*
workspace
).
n
ame
()
==
wsName
)
if
(
workspace
->
getN
ame
()
==
wsName
)
return
true
;
}
return
false
;
...
...
@@ -158,7 +158,7 @@ std::vector<std::string> WorkspaceGroup::getNames() const {
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
std
::
vector
<
std
::
string
>
out
;
for
(
const
auto
&
workspace
:
m_workspaces
)
{
out
.
push_back
(
(
*
workspace
).
n
ame
());
out
.
push_back
(
workspace
->
getN
ame
());
}
return
out
;
}
...
...
@@ -188,7 +188,7 @@ Workspace_sptr WorkspaceGroup::getItem(const size_t index) const {
Workspace_sptr
WorkspaceGroup
::
getItem
(
const
std
::
string
wsName
)
const
{
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
for
(
const
auto
&
workspace
:
m_workspaces
)
{
if
(
(
*
workspace
).
n
ame
()
==
wsName
)
if
(
workspace
->
getN
ame
()
==
wsName
)
return
workspace
;
}
throw
std
::
out_of_range
(
"Workspace "
+
wsName
+
...
...
@@ -207,7 +207,7 @@ void WorkspaceGroup::removeByADS(const std::string &wsName) {
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
auto
it
=
m_workspaces
.
begin
();
for
(;
it
!=
m_workspaces
.
end
();
++
it
)
{
if
((
**
it
).
n
ame
()
==
wsName
)
{
if
((
**
it
).
getN
ame
()
==
wsName
)
{
m_workspaces
.
erase
(
it
);
break
;
}
...
...
@@ -219,8 +219,8 @@ void WorkspaceGroup::removeByADS(const std::string &wsName) {
void
WorkspaceGroup
::
print
()
const
{
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
for
(
const
auto
&
workspace
:
m_workspaces
)
{
g_log
.
debug
()
<<
"Workspace name in group vector = "
<<
(
*
workspace
).
name
()
<<
'\n'
;
g_log
.
debug
()
<<
"Workspace name in group vector = "
<<
workspace
->
getName
()
<<
'\n'
;
}
}
...
...
@@ -233,7 +233,7 @@ void WorkspaceGroup::print() const {
void
WorkspaceGroup
::
removeItem
(
const
size_t
index
)
{
std
::
lock_guard
<
std
::
recursive_mutex
>
_lock
(
m_mutex
);
// do not allow this way of removing for groups in the ADS
if
(
!
n
ame
().
empty
())
{
if
(
!
this
->
getN
ame
().
empty
())
{
throw
std
::
runtime_error
(
"AnalysisDataService must be used to remove a workspace from group."
);
}
...
...
@@ -339,7 +339,7 @@ bool WorkspaceGroup::areNamesSimilar() const {
// Check all the members are of similar names
for
(
const
auto
&
workspace
:
m_workspaces
)
{
const
std
::
string
wsName
=
(
*
workspace
).
n
ame
();
const
std
::
string
&
wsName
=
workspace
->
getN
ame
();
// Find the last underscore _
std
::
size_t
pos
=
wsName
.
find_last_of
(
'_'
);
// No underscore = not similar
...
...
@@ -348,7 +348,7 @@ bool WorkspaceGroup::areNamesSimilar() const {
// The part before the underscore has to be the same
// as the group name to be similar
std
::
string
commonpart
(
wsName
.
substr
(
0
,
pos
));
if
(
this
->
n
ame
()
!=
commonpart
)
if
(
this
->
getN
ame
()
!=
commonpart
)
return
false
;
}
return
true
;
...
...
Framework/API/test/AlgorithmTest.h
View file @
68d83e83
...
...
@@ -577,7 +577,7 @@ public:
WorkspaceGroup_sptr
group
=
boost
::
dynamic_pointer_cast
<
WorkspaceGroup
>
(
out1
);
TS_ASSERT_EQUALS
(
group
->
n
ame
(),
"D"
)
TS_ASSERT_EQUALS
(
group
->
getN
ame
(),
"D"
)
TS_ASSERT_EQUALS
(
group
->
getNumberOfEntries
(),
expectedNumber
)
if
(
group
->
getNumberOfEntries
()
<
1
)
return
group
;
...
...
@@ -603,12 +603,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1,A_2,A_3"
,
"B"
,
"B_1,B_2,B_3"
,
"C"
,
"C_1,C_2,C_3"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B_1+C_1"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A_2+B_2+C_2"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A_3+B_3+C_3"
);
}
...
...
@@ -617,12 +617,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1,A_2,A_3"
,
"B"
,
"B_1,B_2,B_3"
,
"C"
,
"alice,bob,charlie"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"A_1_B_1_alice_D"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"A_1_B_1_alice_D"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B_1+alice"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"A_2_B_2_bob_D"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"A_2_B_2_bob_D"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A_2+B_2+bob"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"A_3_B_3_charlie_D"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"A_3_B_3_charlie_D"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A_3+B_3+charlie"
);
}
...
...
@@ -631,12 +631,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1,A_2,A_3"
,
"B"
,
""
,
"C"
,
""
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B+C"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A_2+B+C"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A_3+B+C"
);
}
...
...
@@ -645,12 +645,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1,A_2,A_3"
,
"B"
,
""
,
""
,
""
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B+"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A_2+B+"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A_3+B+"
);
}
...
...
@@ -659,12 +659,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1,A_2,A_3"
,
""
,
""
,
"C"
,
"C_1,C_2,C_3"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1++C_1"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D_2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A_2++C_2"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D_3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A_3++C_3"
);
}
...
...
@@ -673,7 +673,7 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1"
,
"B"
,
""
,
"C"
,
""
,
false
,
1
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B+C"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
}
...
...
@@ -683,7 +683,7 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A_1"
,
"B"
,
"B_1"
,
"C"
,
""
,
false
,
1
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D_1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A_1+B_1+C"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
}
...
...
@@ -715,12 +715,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"D"
,
"D1,D2,D3"
,
"B"
,
"B1,B2,B3"
,
"C"
,
"C1,C2,C3"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"D1+B1+C1"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"D2+B2+C2"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"D3+B3+C3"
);
}
...
...
@@ -730,12 +730,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A1,A2,A3"
,
"D"
,
"D1,D2,D3"
,
"C"
,
"C1,C2,C3"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A1+D1+C1"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A2+D2+C2"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A3+D3+C3"
);
}
...
...
@@ -745,12 +745,12 @@ public:
WorkspaceGroup_sptr
group
=
do_test_groups
(
"A"
,
"A1,A2,A3"
,
"D"
,
"D1,D2,D3"
,
"D"
,
"D1,D2,D3"
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"D1"
);
TS_ASSERT_EQUALS
(
ws1
->
getTitle
(),
"A1+D1+D1"
);
TS_ASSERT_EQUALS
(
ws1
->
readY
(
0
)[
0
],
234
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
"D2"
);
TS_ASSERT_EQUALS
(
ws2
->
getTitle
(),
"A2+D2+D2"
);
TS_ASSERT_EQUALS
(
ws3
->
n
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getN
ame
(),
"D3"
);
TS_ASSERT_EQUALS
(
ws3
->
getTitle
(),
"A3+D3+D3"
);
}
...
...
Framework/API/test/NotebookBuilderTest.h
View file @
68d83e83
...
...
@@ -234,7 +234,7 @@ public:
view
->
unrollAll
();
NotebookBuilder
builder
(
view
);
std
::
string
notebookText
=
builder
.
build
(
ws
->
n
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
builder
.
build
(
ws
->
getN
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
std
::
vector
<
std
::
string
>
notebookLines
;
std
::
string
line
;
...
...
@@ -286,7 +286,7 @@ public:
NotebookBuilder
builder
(
view
);
std
::
string
notebookText
=
builder
.
build
(
ws
->
n
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
builder
.
build
(
ws
->
getN
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
std
::
vector
<
std
::
string
>
notebookLines
;
std
::
string
line
;
...
...
@@ -329,7 +329,7 @@ public:
NotebookBuilder
builder
(
wsHist
.
createView
());
std
::
string
notebookText
=
builder
.
build
(
ws
->
n
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
builder
.
build
(
ws
->
getN
ame
(),
ws
->
getTitle
(),
ws
->
getComment
());
std
::
vector
<
std
::
string
>
notebookLines
;
std
::
string
line
;
...
...
@@ -346,4 +346,4 @@ public:
}
};
#endif // MANTID_NOTEBOOKBUILDERTEST_H_
\ No newline at end of file
#endif // MANTID_NOTEBOOKBUILDERTEST_H_
Framework/API/test/ScopedWorkspaceTest.h
View file @
68d83e83
...
...
@@ -179,13 +179,13 @@ public:
MockWorkspace_sptr
ws1
=
MockWorkspace_sptr
(
new
MockWorkspace
);
test
.
set
(
ws1
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
test
.
name
());
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
test
.
name
());
MockWorkspace_sptr
ws2
=
MockWorkspace_sptr
(
new
MockWorkspace
);
test
.
set
(
ws2
);
TS_ASSERT_EQUALS
(
ws2
->
n
ame
(),
test
.
name
());
TS_ASSERT
(
ws1
->
n
ame
().
empty
());
TS_ASSERT_EQUALS
(
ws2
->
getN
ame
(),
test
.
name
());
TS_ASSERT
(
ws1
->
getN
ame
().
empty
());
TS_ASSERT_EQUALS
(
m_ads
.
getObjectNames
(
Mantid
::
Kernel
::
DataServiceSort
::
Unsorted
,
Mantid
::
Kernel
::
DataServiceHidden
::
Include
).
size
(),
...
...
Framework/API/test/WorkspaceGroupTest.h
View file @
68d83e83
...
...
@@ -192,7 +192,7 @@ public:
void
test_getItem
()
{
WorkspaceGroup_sptr
group
=
makeGroup
();
Workspace_sptr
ws1
=
group
->
getItem
(
1
);
TS_ASSERT_EQUALS
(
ws1
->
n
ame
(),
"ws1"
);
TS_ASSERT_EQUALS
(
ws1
->
getN
ame
(),
"ws1"
);
// Test the 'by name' overload
Workspace_sptr
ws11
=
group
->
getItem
(
"ws1"
);
TS_ASSERT_EQUALS
(
ws1
,
ws11
);
...
...
Framework/Algorithms/src/CalculateCountRate.cpp
View file @
68d83e83
...
...
@@ -151,7 +151,7 @@ void CalculateCountRate::exec() {
DataObjects
::
EventWorkspace_sptr
sourceWS
=
getProperty
(
"Workspace"
);
API
::
EventType
et
=
sourceWS
->
getEventType
();
if
(
et
==
API
::
EventType
::
WEIGHTED_NOTIME
)
{
throw
std
::
runtime_error
(
"Event workspace "
+
sourceWS
->
n
ame
()
+
throw
std
::
runtime_error
(
"Event workspace "
+
sourceWS
->
getN
ame
()
+
" contains events without necessary frame "
"information. Can not process counting rate"
);
}
...
...
@@ -510,7 +510,7 @@ void CalculateCountRate::setSourceWSandXRanges(
API
::
MatrixWorkspace_sptr
wst
;
if
(
unit
->
unitID
()
!=
RangeUnits
)
{
auto
conv
=
createChildAlgorithm
(
"ConvertUnits"
,
0
,
1
);
std
::
string
wsName
=
InputWorkspace
->
n
ame
();
std
::
string
wsName
=
InputWorkspace
->
getN
ame
();
if
(
wsName
.
empty
())
{
wsName
=
"_CountRate_UnitsConverted"
;
}
else
{
...
...
Framework/Algorithms/src/CompareWorkspaces.cpp
View file @
68d83e83
...
...
@@ -130,8 +130,10 @@ void CompareWorkspaces::exec() {
std
::
string
message
=
m_Messages
->
cell
<
std
::
string
>
(
0
,
0
);
g_log
.
notice
()
<<
"The workspaces did not match: "
<<
message
<<
'\n'
;
}
else
{
std
::
string
ws1
=
Workspace_const_sptr
(
getProperty
(
"Workspace1"
))
->
name
();
std
::
string
ws2
=
Workspace_const_sptr
(
getProperty
(
"Workspace2"
))
->
name
();
std
::
string
ws1
=
Workspace_const_sptr
(
getProperty
(
"Workspace1"
))
->
getName
();
std
::
string
ws2
=
Workspace_const_sptr
(
getProperty
(
"Workspace2"
))
->
getName
();
g_log
.
notice
()
<<
"The workspaces
\"
"
<<
ws1
<<
"
\"
and
\"
"
<<
ws2
<<
"
\"
matched!
\n
"
;
}
...
...
@@ -174,8 +176,8 @@ bool CompareWorkspaces::processGroups() {
}
if
(
m_Result
&&
ws1
&&
ws2
)
{
g_log
.
notice
()
<<
"All workspaces in workspace groups
\"
"
<<
ws1
->
n
ame
()
<<
"
\"
and
\"
"
<<
ws2
->
n
ame
()
<<
"
\"
matched!
\n
"
;
g_log
.
notice
()
<<
"All workspaces in workspace groups
\"
"
<<
ws1
->
getN
ame
()
<<
"
\"
and
\"
"
<<
ws2
->
getN
ame
()
<<
"
\"
matched!
\n
"
;
}
setProperty
(
"Result"
,
m_Result
);
...
...
@@ -1156,11 +1158,11 @@ void CompareWorkspaces::recordMismatch(std::string msg, std::string ws1,
// Workspace names default to the workspaces currently being compared
if
(
ws1
.
empty
())
{
Workspace_const_sptr
w1
=
getProperty
(
"Workspace1"
);
ws1
=
w1
->
n
ame
();
ws1
=
w1
->
getN
ame
();
}
if
(
ws2
.
empty
())
{
Workspace_const_sptr
w2
=
getProperty
(
"Workspace2"
);
ws2
=
w2
->
n
ame
();
ws2
=
w2
->
getN
ame
();
}
// Add new row and flag this comparison as a mismatch
...
...
Framework/Algorithms/src/CreateLogTimeCorrection.cpp
View file @
68d83e83
...
...
@@ -49,7 +49,7 @@ void CreateLogTimeCorrection::exec() {
// Check whether the output workspace name is same as input
string
outwsname
=
getPropertyValue
(
"OutputWorkspace"
);
if
(
outwsname
.
compare
(
m_dataWS
->
n
ame
())
==
0
)
{
if
(
outwsname
.
compare
(
m_dataWS
->
getN
ame
())
==
0
)
{
stringstream
errmsg
;
errmsg
<<
"It is not allowed to use the same name by both input matrix "
"workspace and output table workspace."
;
...
...
Framework/Algorithms/src/ExtractMaskToTable.cpp
View file @
68d83e83
...
...
@@ -56,7 +56,7 @@ void ExtractMaskToTable::exec() {
bool
m_inputIsMask
=
false
;
if
(
maskws
)
{
g_log
.
notice
()
<<
"InputWorkspace "
<<
m_dataWS
->
n
ame
()
g_log
.
notice
()
<<
"InputWorkspace "
<<
m_dataWS
->
getN
ame
()
<<
" is a MaskWorkspace.
\n
"
;
m_inputIsMask
=
true
;
}
else
{
...
...
@@ -135,8 +135,8 @@ std::vector<detid_t> ExtractMaskToTable::parseMaskTable(
chkcolumans
[
2
]
=
"DetectorIDsList"
;
for
(
int
i
=
0
;
i
<
3
;
++
i
)
{
if
(
colnames
[
i
]
!=
chkcolumans
[
i
])
{
g_log
.
error
()
<<
"Mask table workspace "
<<
masktablews
->
n
ame
()
<<
"'s "
<<
i
<<
"-th column name is "
<<
colnames
[
i
]
g_log
.
error
()
<<
"Mask table workspace "
<<
masktablews
->
getN
ame
()
<<
"'s "
<<
i
<<
"-th column name is "
<<
colnames
[
i
]
<<
", while it should be "
<<
chkcolumans
[
i
]
<<
". MaskWorkspace is invalid"
<<
" and thus not used.
\n
"
;
...
...
@@ -264,7 +264,7 @@ void ExtractMaskToTable::copyTableWorkspaceContent(
vector
<
string
>
targetcolnames
=
targetWS
->
getColumnNames
();
if
(
sourcecolnames
.
size
()
!=
targetcolnames
.
size
())
{
stringstream
errmsg
;
errmsg
<<
"Soruce table workspace "
<<
sourceWS
->
n
ame
()
errmsg
<<
"Soruce table workspace "
<<
sourceWS
->
getN
ame
()
<<
" has different number of columns ("
<<
sourcecolnames
.
size
()
<<
") than target table workspace's ("
<<
targetcolnames
.
size
()
<<
")"
;
...
...
Framework/Algorithms/src/FilterByLogValue.cpp
View file @
68d83e83
...
...
@@ -90,7 +90,7 @@ std::map<std::string, std::string> FilterByLogValue::validateInputs() {
}
catch
(
Exception
::
NotFoundError
&
)
{
errors
[
"LogName"
]
=
"The log '"
+
logname
+
"' does not exist in the workspace '"
+
inputWS
->
n
ame
()
+
"'."
;
inputWS
->
getN
ame
()
+
"'."
;
return
errors
;
}
...
...
Framework/Algorithms/src/FilterEvents.cpp
View file @
68d83e83
...
...
@@ -207,7 +207,7 @@ void FilterEvents::exec() {
std
::
vector
<
std
::
string
>
outputwsnames
;
std
::
map
<
int
,
DataObjects
::
EventWorkspace_sptr
>::
iterator
miter
;
for
(
miter
=
m_outputWS
.
begin
();
miter
!=
m_outputWS
.
end
();
++
miter
)
{
outputwsnames
.
push_back
(
miter
->
second
->
n
ame
());
outputwsnames
.
push_back
(
miter
->
second
->
getN
ame
());
}
setProperty
(
"OutputWorkspaceNames"
,
outputwsnames
);
...
...
@@ -706,13 +706,13 @@ void FilterEvents::setupCustomizedTOFCorrection() {
if
(
toffactormap
.
size
()
>
numhist
)
{
g_log
.
warning
()
<<
"Input correction table workspace has more detectors ("
<<
toffactormap
.
size
()
<<
") than input workspace "
<<
m_eventWS
->
n
ame
()
<<
"'s spectra number ("
<<
numhist
<<
m_eventWS
->
getN
ame
()
<<
"'s spectra number ("
<<
numhist
<<
".
\n
"
;
}
else
if
(
toffactormap
.
size
()
<
numhist
)
{
stringstream
errss
;
errss
<<
"Input correction table workspace has more detectors ("
<<
toffactormap
.
size
()
<<
") than input workspace "
<<
m_eventWS
->
n
ame
()
<<
"'s spectra number ("
<<
numhist
<<
".
\n
"
;
<<
m_eventWS
->
getN
ame
()
<<
"'s spectra number ("
<<
numhist
<<
".
\n
"
;
throw
runtime_error
(
errss
.
str
());
}
...
...
@@ -751,7 +751,7 @@ void FilterEvents::setupCustomizedTOFCorrection() {