Skip to content

Commit 473bc51

Browse files
committed
Removed FileInPath::isLocal to avoid user confusion
Several users thought FileInPath::isLocal would tell them if the file was found at all rather than just stating that the last time the file was found (say in a different job) it was found in the user’s work area. Given this was only used in a couple of places we decided it was better to just remove the method all together and require users to call FileInPath::location() if they wanted to get the same information.
1 parent 6744d7d commit 473bc51

File tree

4 files changed

+3
-13
lines changed

4 files changed

+3
-13
lines changed

FWCore/ParameterSet/interface/FileInPath.h

-3
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,6 @@ namespace edm
9797
/// Where was the file found?
9898
LocationCode location() const;
9999

100-
/// Was the file found under the "local" area?
101-
bool isLocal() const;
102-
103100
/// Return a string that can be used to open the referenced
104101
/// file.
105102
///

FWCore/ParameterSet/src/FileInPath.cc

-6
Original file line numberDiff line numberDiff line change
@@ -161,12 +161,6 @@ namespace edm
161161
return location_;
162162
}
163163

164-
bool
165-
FileInPath::isLocal() const
166-
{
167-
return Local == location_;
168-
}
169-
170164
std::string
171165
FileInPath::fullPath() const
172166
{

FWCore/PythonParameterSet/src/PythonModule.h

-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ BOOST_PYTHON_MODULE(libFWCoreParameterSet)
6262
boost::python::class_<edm::FileInPath>("FileInPath", boost::python::init<std::string>())
6363
.def("fullPath", &edm::FileInPath::fullPath)
6464
.def("relativePath", &edm::FileInPath::relativePath)
65-
.def("isLocal", &edm::FileInPath::isLocal)
6665
;
6766

6867
boost::python::class_<edm::LuminosityBlockRange>("LuminosityBlockRange", boost::python::init<unsigned int, unsigned int, unsigned int, unsigned int>())

FWCore/PythonParameterSet/test/makepset_t.cppunit.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ void testmakepset::fileinpathAux() {
207207
char *releaseBase = getenv("CMSSW_RELEASE_BASE");
208208
bool localArea = (releaseBase != 0 && strlen(releaseBase) != 0);
209209
if(localArea) {
210-
CPPUNIT_ASSERT(fip.isLocal() == true);
210+
CPPUNIT_ASSERT(fip.location() == edm::FileInPath::Local);
211211
}
212212
CPPUNIT_ASSERT(fip.relativePath() == "FWCore/ParameterSet/python/Config.py");
213213
CPPUNIT_ASSERT(ufip.relativePath() == "FWCore/ParameterSet/python/Types.py");
@@ -220,7 +220,7 @@ void testmakepset::fileinpathAux() {
220220
std::string tmpout = fullpath.substr(0, fullpath.find("FWCore/ParameterSet/python/Config.py")) + "tmp.py";
221221

222222
edm::FileInPath topo = innerps.getParameter<edm::FileInPath>("topo");
223-
CPPUNIT_ASSERT(topo.isLocal() == false);
223+
CPPUNIT_ASSERT(topo.location() != edm::FileInPath::Local);
224224
CPPUNIT_ASSERT(topo.relativePath() == "Geometry/TrackerSimData/data/trackersens.xml");
225225
fullpath = topo.fullPath();
226226
CPPUNIT_ASSERT(!fullpath.empty());
@@ -261,7 +261,7 @@ void testmakepset::fileinpathAux() {
261261
edm::ParameterSet const& innerps2 = ps2->getParameterSet("main");
262262
edm::FileInPath fip2 = innerps2.getParameter<edm::FileInPath>("fip2");
263263
if (localArea) {
264-
CPPUNIT_ASSERT(fip2.isLocal() == true);
264+
CPPUNIT_ASSERT(fip2.location() == edm::FileInPath::Local);
265265
}
266266
CPPUNIT_ASSERT(fip2.relativePath() == "tmp.py");
267267
std::string fullpath2 = fip2.fullPath();

0 commit comments

Comments
 (0)