Skip to content

Commit

Permalink
code format
Browse files Browse the repository at this point in the history
  • Loading branch information
kpedro88 committed Sep 14, 2023
1 parent 5c19593 commit 3cbfecb
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
10 changes: 4 additions & 6 deletions FWCore/Framework/bin/cmsRun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ namespace {
std::vector<boost::program_options::option> result;
std::string configName;
if (!args.empty() and !args[0].empty()) {
if(args[0][0]!='-'){ // name is first positional arg -> doesn't start with '-'
if (args[0][0] != '-') { // name is first positional arg -> doesn't start with '-'
configName = args[0];
args.erase(args.begin());
}
else if(args[0]=="--" and args.size()>1){ // name can start with '-' if separator comes first
} else if (args[0] == "--" and args.size() > 1) { // name can start with '-' if separator comes first
configName = args[1];
args.erase(args.begin(),args.begin()+2);
args.erase(args.begin(), args.begin() + 2);
}
}
if (!configName.empty()) {
Expand Down Expand Up @@ -260,8 +259,7 @@ int main(int argc, char* argv[]) {
<< "For usage and an options list, please do 'cmsRun --help'.";
edm::HaltMessageLogging();
return edm::errors::ConfigFileNotFound;
}
else
} else
fileName = vm[kParameterSetOpt].as<std::string>();
std::vector<std::string> pythonOptValues;
if (vm.count(kPythonOpt)) {
Expand Down
6 changes: 4 additions & 2 deletions FWCore/Integration/test/ProcessAccelerator_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,15 +227,17 @@ TEST_CASE("Configuration with ModuleTypeResolver", s_tag) {

SECTION("Configuration hash is not changed") {
std::unique_ptr<edm::ParameterSet> pset_auto, pset_cpu, pset_other, pset_cpuExplicit;
std::unique_ptr<edm::ParameterSet> pset_otherExplicit, psetOtherDisabled_auto, psetOtherDisabled_cpu, psetOtherDisabled_other;
std::unique_ptr<edm::ParameterSet> pset_otherExplicit, psetOtherDisabled_auto, psetOtherDisabled_cpu,
psetOtherDisabled_other;
edm::makeParameterSets(baseConfig_auto, pset_auto);
edm::makeParameterSets(baseConfig_cpu, pset_cpu);
edm::makeParameterSets(baseConfig_other, pset_other);
edm::makeParameterSets(baseConfig_cpuExplicit, pset_cpuExplicit);
edm::makeParameterSets(baseConfig_otherExplicit, pset_otherExplicit);
edm::makeParameterSets(baseConfigOtherDisabled_auto, psetOtherDisabled_auto);
edm::makeParameterSets(baseConfigOtherDisabled_cpu, psetOtherDisabled_cpu);
REQUIRE_THROWS_WITH(edm::makeParameterSets(baseConfigOtherDisabled_other, psetOtherDisabled_other), Catch::Contains("UnavailableAccelerator"));
REQUIRE_THROWS_WITH(edm::makeParameterSets(baseConfigOtherDisabled_other, psetOtherDisabled_other),
Catch::Contains("UnavailableAccelerator"));
pset_auto->registerIt();
pset_cpu->registerIt();
pset_other->registerIt();
Expand Down
9 changes: 4 additions & 5 deletions FWCore/PythonParameterSet/src/PyBind11ProcessDesc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,15 @@ PyBind11InterpreterSentry::~PyBind11InterpreterSentry() {

PyBind11ProcessDesc::PyBind11ProcessDesc() : theProcessPSet(), theInterpreter(false) {}

PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile) : theProcessPSet(), theInterpreter(true) {
PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile)
: theProcessPSet(), theInterpreter(true) {
edm::python::initializePyBind11Module();
prepareToRead();
read(config, isFile);
}

PyBind11ProcessDesc::PyBind11ProcessDesc(std::string const& config, bool isFile, const std::vector<std::string>& args)
: theProcessPSet(),
theInterpreter(true)
{
: theProcessPSet(), theInterpreter(true) {
edm::python::initializePyBind11Module();
prepareToRead();
{
Expand Down Expand Up @@ -69,7 +68,7 @@ void PyBind11ProcessDesc::read(std::string const& config, bool isFile) {
if (isFile)
readFile(config);
else
readString(config);
readString(config);
} catch (pybind11::error_already_set const& e) {
edm::pythonToCppException("Configuration", e.what());
}
Expand Down
2 changes: 1 addition & 1 deletion FWCore/PythonParameterSet/test/makeprocess_t.cppunit.cc
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class testmakeprocess : public CppUnit::TestFixture {
typedef std::shared_ptr<edm::ParameterSet> ParameterSetPtr;
ParameterSetPtr pSet(char const* c) {
//ParameterSetPtr result( new edm::ProcessDesc(std::string(c)) );
ParameterSetPtr result = PyBind11ProcessDesc(std::string(c),false).parameterSet();
ParameterSetPtr result = PyBind11ProcessDesc(std::string(c), false).parameterSet();
CPPUNIT_ASSERT(result->getParameter<std::string>("@process_name") == "test");
return result;
}
Expand Down

0 comments on commit 3cbfecb

Please sign in to comment.