Skip to content

Commit

Permalink
Fixed final problems with building nest inputs and ran astyle
Browse files Browse the repository at this point in the history
  • Loading branch information
Gareth Aneurin Tribello committed May 22, 2024
1 parent 4739c14 commit 2fdf250
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
22 changes: 11 additions & 11 deletions src/cltools/Driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,16 +787,16 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) {
}
ActionWithValue* av=dynamic_cast<ActionWithValue*>(pp.get());
if( av && av->getNumberOfComponents()>0 ) {
Keywords keys; p.getKeywordsForAction( av->getName(), keys );
Keywords keys; p.getKeywordsForAction( av->getName(), keys );
if( firsta ) { valuefile.printf(" \"%s\" : {\n \"action\" : \"%s\"", av->getLabel().c_str(), keys.getDisplayName().c_str() ); firsta=false; }
else valuefile.printf(",\n \"%s\" : {\n \"action\" : \"%s\"", av->getLabel().c_str(), keys.getDisplayName().c_str() );
for(unsigned i=0; i<av->getNumberOfComponents(); ++i) {
Value* myval = av->copyOutput(i); std::string compname = myval->getName(), description;
Value* myval = av->copyOutput(i); std::string compname = myval->getName(), description;
if( av->getLabel()==compname ) {
description = keys.getOutputComponentDescription(".#!value");
description = keys.getOutputComponentDescription(".#!value");
} else {
std::size_t dot=compname.find(av->getLabel() + "."); std::string cname = compname.substr(dot + av->getLabel().length() + 1);
description = av->getOutputComponentDescription( cname, keys );
std::size_t dot=compname.find(av->getLabel() + "."); std::string cname = compname.substr(dot + av->getLabel().length() + 1);
description = av->getOutputComponentDescription( cname, keys );
}
if( description.find("\\")!=std::string::npos ) error("found invalid backslash character in documentation for component " + compname + " in action " + av->getName() + " with label " + av->getLabel() );
valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() );
Expand All @@ -810,7 +810,7 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) {

if( firsta ) { valuefile.printf(" \"shortcut_%s\" : {\n \"action\" : \"%s\"", as->getShortcutLabel().c_str(), as->getName().c_str() ); firsta=false; }
else valuefile.printf(",\n \"shortcut_%s\" : {\n \"action\" : \"%s\"", as->getShortcutLabel().c_str(), as->getName().c_str() );
Keywords keys; p.getKeywordsForAction( as->getName(), keys );
Keywords keys; p.getKeywordsForAction( as->getName(), keys );
for(unsigned i=0; i<cnames.size(); ++i) {
ActionWithValue* av2=p.getActionSet().selectWithLabel<ActionWithValue*>( cnames[i] );
if( !av2 ) plumed_merror("could not find value created by shortcut with name " + cnames[i] );
Expand All @@ -822,13 +822,13 @@ int Driver<real>::main(FILE* in,FILE*out,Communicator& pc) {
valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() );
} else {
for(unsigned j=0; j<av2->getNumberOfComponents(); ++j) {
Value* myval = av2->copyOutput(j); std::string compname = myval->getName(), description;
Value* myval = av2->copyOutput(j); std::string compname = myval->getName(), description;
if( av2->getLabel()==compname ) {
plumed_merror("should not be outputting description of value from action when using shortcuts");
plumed_merror("should not be outputting description of value from action when using shortcuts");
} else {
std::size_t dot=compname.find(av2->getLabel() + "."); std::string cname = compname.substr(dot+av2->getLabel().length() + 1);
description = av2->getOutputComponentDescription( cname, keys );
}
std::size_t dot=compname.find(av2->getLabel() + "."); std::string cname = compname.substr(dot+av2->getLabel().length() + 1);
description = av2->getOutputComponentDescription( cname, keys );
}
if( description.find("\\")!=std::string::npos ) error("found invalid backslash character in documentation for component " + compname + " in action " + av2->getName() + " with label " + av2->getLabel() );
valuefile.printf(",\n \"%s\" : { \"type\": \"%s\", \"description\": \"%s\" }", myval->getName().c_str(), myval->getValueType().c_str(), description.c_str() );
}
Expand Down
1 change: 0 additions & 1 deletion src/core/ActionWithValue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ void ActionWithValue::addComponentWithDerivatives( const std::string& name, cons

std::string ActionWithValue::getOutputComponentDescription( const std::string& cname, const Keywords& keys ) const {
std::size_t und=cname.find_last_of("_"); std::size_t hyph=cname.find_first_of("-");
if( und!=std::string::npos && hyph!=std::string::npos ) plumed_merror("cannot use underscore and hyphen in name");
if( und!=std::string::npos ) return keys.getOutputComponentDescription(cname.substr(und)) + " This particular component measures this quantity for the input CV named " + cname.substr(0,und);
if( hyph!=std::string::npos ) return keys.getOutputComponentDescription(cname.substr(0,hyph)) + " This is the " + cname.substr(hyph+1) + "th of these quantities";
plumed_massert( keys.outputComponentExists(cname), "component " + cname + " does not exist in " + keys.getDisplayName() + " if the component names are customizable then you should override this function" );
Expand Down
2 changes: 1 addition & 1 deletion src/core/PlumedMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1489,7 +1489,7 @@ bool PlumedMain::parseOnlyMode() const {
}

void PlumedMain::getKeywordsForAction( const std::string& action, Keywords& keys ) const {
actionRegister().getKeywords( dlloader.getHandles(), action, keys );
actionRegister().getKeywords( dlloader.getHandles(), action, keys );
}

#ifdef __PLUMED_HAS_PYTHON
Expand Down

1 comment on commit 2fdf250

@PlumedBot
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found broken examples in automatic/ANGLES.tmp
Found broken examples in automatic/ANN.tmp
Found broken examples in automatic/CAVITY.tmp
Found broken examples in automatic/CLASSICAL_MDS.tmp
Found broken examples in automatic/CLUSTER_DIAMETER.tmp
Found broken examples in automatic/CLUSTER_DISTRIBUTION.tmp
Found broken examples in automatic/CLUSTER_PROPERTIES.tmp
Found broken examples in automatic/CONSTANT.tmp
Found broken examples in automatic/CONTACT_MATRIX.tmp
Found broken examples in automatic/CONTACT_MATRIX_PROPER.tmp
Found broken examples in automatic/COORDINATIONNUMBER.tmp
Found broken examples in automatic/DFSCLUSTERING.tmp
Found broken examples in automatic/DISTANCE_FROM_CONTOUR.tmp
Found broken examples in automatic/EDS.tmp
Found broken examples in automatic/EMMI.tmp
Found broken examples in automatic/ENVIRONMENTSIMILARITY.tmp
Found broken examples in automatic/FIND_CONTOUR.tmp
Found broken examples in automatic/FIND_CONTOUR_SURFACE.tmp
Found broken examples in automatic/FIND_SPHERICAL_CONTOUR.tmp
Found broken examples in automatic/FOURIER_TRANSFORM.tmp
Found broken examples in automatic/FUNCPATHGENERAL.tmp
Found broken examples in automatic/FUNCPATHMSD.tmp
Found broken examples in automatic/FUNNEL.tmp
Found broken examples in automatic/FUNNEL_PS.tmp
Found broken examples in automatic/GHBFIX.tmp
Found broken examples in automatic/GPROPERTYMAP.tmp
Found broken examples in automatic/HBOND_MATRIX.tmp
Found broken examples in automatic/INCLUDE.tmp
Found broken examples in automatic/INCYLINDER.tmp
Found broken examples in automatic/INENVELOPE.tmp
Found broken examples in automatic/INTERPOLATE_GRID.tmp
Found broken examples in automatic/LOCAL_AVERAGE.tmp
Found broken examples in automatic/MAZE_OPTIMIZER_BIAS.tmp
Found broken examples in automatic/MAZE_RANDOM_ACCELERATION_MD.tmp
Found broken examples in automatic/MAZE_SIMULATED_ANNEALING.tmp
Found broken examples in automatic/MAZE_STEERED_MD.tmp
Found broken examples in automatic/MULTICOLVARDENS.tmp
Found broken examples in automatic/OUTPUT_CLUSTER.tmp
Found broken examples in automatic/PAMM.tmp
Found broken examples in automatic/PCA.tmp
Found broken examples in automatic/PCAVARS.tmp
Found broken examples in automatic/PIV.tmp
Found broken examples in automatic/PLUMED.tmp
Found broken examples in automatic/PYCVINTERFACE.tmp
Found broken examples in automatic/PYTHONFUNCTION.tmp
Found broken examples in automatic/Q3.tmp
Found broken examples in automatic/Q4.tmp
Found broken examples in automatic/Q6.tmp
Found broken examples in automatic/QUATERNION.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_LINEAR_PROJ.tmp
Found broken examples in automatic/SIZESHAPE_POSITION_MAHA_DIST.tmp
Found broken examples in automatic/SPRINT.tmp
Found broken examples in automatic/TETRAHEDRALPORE.tmp
Found broken examples in automatic/TORSIONS.tmp
Found broken examples in automatic/WHAM_WEIGHTS.tmp
Found broken examples in AnalysisPP.md
Found broken examples in CollectiveVariablesPP.md
Found broken examples in MiscelaneousPP.md

Please sign in to comment.