Class: Chemicalml::Convention::Compchem::Constraints::InitializationAtMostOneMolecule
- Inherits:
-
Chemicalml::Convention::Constraint::NodeConstraint
- Object
- Constraint
- Chemicalml::Convention::Constraint::NodeConstraint
- Chemicalml::Convention::Compchem::Constraints::InitializationAtMostOneMolecule
- Includes:
- ModulePredicates
- Defined in:
- lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb
Overview
The initialization module MUST NOT contain more than one molecule child.
Instance Method Summary collapse
Methods included from ModulePredicates
#calculation_module?, #child_modules_with, #cml_module?, #compchem_root?, #environment_module?, #finalization_module?, #initialization_module?, #job_list_module?, #job_module?
Methods inherited from Chemicalml::Convention::Constraint::NodeConstraint
Instance Method Details
#check_node(node, path) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/chemicalml/convention/compchem/constraints/initialization_at_most_one_molecule.rb', line 13 def check_node(node, path) molecules = node.molecules || [] return [] if molecules.length <= 1 [violation(path: path.join('/'), message: 'initialization module must not contain more than ' \ "one molecule (found #{molecules.length})")] end |