From fcd82f2d4eb26a1c401a800802a54cdfd635c062 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Tue, 23 Jan 2024 12:16:30 +0100 Subject: [PATCH 01/14] Prepare for development --- ChangeLog.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog.rst b/ChangeLog.rst index 4e15b65..68df92f 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -4,6 +4,10 @@ Changes ####### +develop +======= + + v0.15.0 (2024-01-26) ==================== From 6ca706f63fab107d376a900fb8f4480aa0997a84 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sat, 17 Feb 2024 22:47:40 +0100 Subject: [PATCH 02/14] Add LabelAny constraint --- doc/source/formats/gml.rst | 6 +- .../GraphMorphism/Constraints/AllVisitor.hpp | 3 + .../Constraints/CheckVisitor.hpp | 4 + .../GraphMorphism/Constraints/LabelAny.hpp | 75 +++++++++++++++++++ .../lib/GraphMorphism/IO/WriteConstraints.hpp | 20 +++++ libs/libmod/src/mod/lib/IO/GML.hpp | 7 +- .../mod/lib/RC/Visitor/MatchConstraints.hpp | 58 ++++++++++++++ libs/libmod/src/mod/lib/Rules/IO/Read.cpp | 14 +++- libs/libmod/src/mod/lib/Rules/IO/Write.cpp | 15 ++++ .../src/mod/lib/Rules/Properties/String.cpp | 8 ++ .../src/mod/lib/Rules/Properties/Term.cpp | 7 ++ test/py/matchConstraints/labelAny.py | 23 ++++++ 12 files changed, 237 insertions(+), 3 deletions(-) create mode 100644 libs/libmod/src/mod/lib/GraphMorphism/Constraints/LabelAny.hpp create mode 100644 test/py/matchConstraints/labelAny.py diff --git a/doc/source/formats/gml.rst b/doc/source/formats/gml.rst index af51f54..2b0212b 100644 --- a/doc/source/formats/gml.rst +++ b/doc/source/formats/gml.rst @@ -71,7 +71,7 @@ The key-value structure is exemplified by the following grammar. leftSide: 'left [' (`node` | `edge`)* ']' context: 'context [' (`node` | `edge`)* ']' rightSide: 'right [' (`node` | `edge`)* ']' - matchConstraint: `adjacency` + matchConstraint: `adjacency` | `labelAny` adjacency: 'constrainAdj [' : 'id' int : 'op "' `op` '"' @@ -79,6 +79,10 @@ The key-value structure is exemplified by the following grammar. : [ 'nodeLabels [' `labelList` ']' ] : [ 'edgeLabels [' `labelList` ']' ] : ']' + labelAny: 'constrainLabelAny [' + : 'label' quoteEscapedString + : 'labels [' `labelList` ']' + : ']' labelList: ('label' quoteEscapedString)* op: '<' | '<=' | '=' | '>=' | '>' diff --git a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/AllVisitor.hpp b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/AllVisitor.hpp index 2c24a22..8d4cd65 100644 --- a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/AllVisitor.hpp +++ b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/AllVisitor.hpp @@ -1,6 +1,7 @@ #ifndef MOD_LIB_GRAPHMORPHISM_ALLVISITOR_HPP #define MOD_LIB_GRAPHMORPHISM_ALLVISITOR_HPP +#include #include #include #include @@ -20,6 +21,7 @@ struct AllVisitorNonConst : BaseVisitorNonConst, Visitor > ... template struct AllVisitor : detail::AllVisitor { @@ -27,6 +29,7 @@ struct AllVisitor : detail::AllVisitor struct AllVisitorNonConst : detail::AllVisitorNonConst { diff --git a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/CheckVisitor.hpp b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/CheckVisitor.hpp index b085908..c9a928a 100644 --- a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/CheckVisitor.hpp +++ b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/CheckVisitor.hpp @@ -14,6 +14,10 @@ struct CheckVisitor : AllVisitor { result = c.matches(*this, gDom, lgCodom, m, ls); } + virtual void operator()(const LabelAny &c) override { + result = c.matches(*this, gDom, lgCodom, m, ls); + } + virtual void operator()(const ShortestPath &c) override { result = c.matches(*this, gDom, lgCodom, m, ls); } diff --git a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/LabelAny.hpp b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/LabelAny.hpp new file mode 100644 index 0000000..234a67e --- /dev/null +++ b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/LabelAny.hpp @@ -0,0 +1,75 @@ +#ifndef MOD_LIB_GRAPHMORPHISM_LABEL_ANY_HPP +#define MOD_LIB_GRAPHMORPHISM_LABEL_ANY_HPP + +#include +#include +#include +#include + +#include +#include + +namespace mod::lib::GraphMorphism::Constraints { + +template +struct LabelAny : Constraint { + MOD_VISITABLE(); +public: + LabelAny(std::string label, std::vector labels) + : label(std::move(label)), labels(std::move(labels)) {} + + virtual std::unique_ptr > + clone() const override { + return std::make_unique(label, labels); + } + + virtual std::string name() const override { + return "LabelAny"; + } +private: + template + bool matchesImpl(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, + const LabelSettings ls, std::false_type) const { + // this is kind of stupid, as it doesn't depend on the graphs or the match + assert(ls.type == LabelType::String); // otherwise someone forgot to add the TermData prop + return labels.end() != std::find(labels.begin(), labels.end(), label); + } + + template + int matchesImpl(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, + const LabelSettings ls, std::true_type) const { + assert(ls.type == LabelType::Term); // otherwise someone did something very strange + lib::Term::Wam &machine = get_prop(TermDataT(), m).machine; + lib::Term::MGU mgu(machine.getHeap().size()); + const auto aTerm = machine.copyFromTemp(term); + const bool res = std::any_of(terms.begin(), terms.end(), [aTerm, &machine](std::size_t t) { + lib::Term::MGU mgu = machine.unifyHeapTemp(aTerm.addr, t); + machine.revert(mgu); + return mgu.status == lib::Term::MGU::Status::Exists; + }); + machine.revert(mgu); + return res; + } +public: + template + bool matches(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, + const LabelSettings ls) const { + using GraphCodom = typename LabelledGraphTraits::GraphType; + static_assert(std::is_same::GraphDom>::value, + ""); + static_assert( + std::is_same::GraphCodom>::value, + ""); + using HasTerm = GraphMorphism::HasTermData; + return matchesImpl(vis, gDom, lgCodom, m, ls, HasTerm()); + } +public: + std::string label; + std::vector labels; + std::size_t term; + std::vector terms; +}; + +} // namespace mod::lib::GraphMorphism::Constraints + +#endif // MOD_LIB_GRAPHMORPHISM_LABEL_ANY_HPP \ No newline at end of file diff --git a/libs/libmod/src/mod/lib/GraphMorphism/IO/WriteConstraints.hpp b/libs/libmod/src/mod/lib/GraphMorphism/IO/WriteConstraints.hpp index 97327d9..e2f920d 100644 --- a/libs/libmod/src/mod/lib/GraphMorphism/IO/WriteConstraints.hpp +++ b/libs/libmod/src/mod/lib/GraphMorphism/IO/WriteConstraints.hpp @@ -64,6 +64,17 @@ struct ConstraintsTexPrintVisitor : Constraints::AllVisitor { s << " " << c.count << "\n\\end{align*}\n"; } + virtual void operator()(const Constraints::LabelAny &c) override { + s << "$\\texttt{" << IO::escapeForLatex(c.label) << "} \\in \\{"; + bool first = true; + for(const std::string &str: c.labels) { + if(!first) s << ", "; + first = false; + s << " \\text{`\\texttt{" << IO::escapeForLatex(str) << "}'}"; + } + s << " \\}$\n"; + } + virtual void operator()(const Constraints::ShortestPath &c) override { s << "$\\mathrm{shortestPath}(" << get(boost::vertex_index_t(), g, c.vSrc) << ", " << get(boost::vertex_index_t(), g, c.vTar) << ") "; @@ -117,6 +128,15 @@ struct ConstraintsGMLPrintVisitor : Constraints::AllVisitor { s << prefix << "]\n"; } + virtual void operator()(const Constraints::LabelAny &c) { + s << prefix << "constrainLabelAny [\n"; + s << prefix << " label \"" << c.label << "\"\n"; + s << prefix << " labels ["; + for(const auto &str: c.labels) s << " label \"" << str << "\""; + s << " ]\n"; + s << prefix << "]\n"; + } + virtual void operator()(const Constraints::ShortestPath &c) { s << prefix << "constrainShortestPath [\n"; s << prefix << " source " << get(boost::vertex_index_t(), g, c.vSrc) diff --git a/libs/libmod/src/mod/lib/IO/GML.hpp b/libs/libmod/src/mod/lib/IO/GML.hpp index a93ee10..6c5fb21 100644 --- a/libs/libmod/src/mod/lib/IO/GML.hpp +++ b/libs/libmod/src/mod/lib/IO/GML.hpp @@ -40,13 +40,18 @@ struct AdjacencyConstraint { std::vector nodeLabels, edgeLabels; }; +struct LabelAnyConstraint { + std::string label; + std::vector labels; +}; + struct ShortestPathConstraint { int source, target; std::string op; int length; }; -using MatchConstraint = std::variant; +using MatchConstraint = std::variant; struct Rule { std::optional id; diff --git a/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp b/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp index 64ca31b..f2eab9a 100644 --- a/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp +++ b/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp @@ -12,6 +12,8 @@ using ConstraintVisitor = lib::GraphMorphism::Constraints::AllVisitor; template using Constraint = lib::GraphMorphism::Constraints::Constraint; template +using ConstraintLA = lib::GraphMorphism::Constraints::LabelAny; +template using ConstraintAdj = lib::GraphMorphism::Constraints::VertexAdjacency; template using ConstraintSP = lib::GraphMorphism::Constraints::ShortestPath; @@ -49,7 +51,26 @@ struct ConvertFirst : public ConstraintVisitor " << rSecond.getName() << std::endl; this->cResult = std::move(cResult); } +private: + template class LabelAN> + void convertLabelAN(const LabelAN &c) { + auto cResult = std::make_unique >(c); + switch(labelType) { + case LabelType::String: + cResult->terms.clear(); + break; + case LabelType::Term: + cResult->label.clear(); + cResult->labels.clear(); + break; + } + this->cResult = std::move(cResult); + } public: + virtual void operator()(const ConstraintLA &c) override { + return convertLabelAN(c); + } + virtual void operator()(const ConstraintSP &c) override { auto cResult = std::make_unique >(c); MOD_ABORT; @@ -129,7 +150,44 @@ struct ConvertSecond : public ConstraintVisitorcResult = std::move(cResult); // std::cout << "WARNING: check converted constraint on vertex " << vNew << " for " << rFirst.getName() << " -> " << rSecond.getName() << std::endl; } +private: + template class LabelAN> + void convertLabelAN(const LabelAN &c) { + auto cResult = std::make_unique >(c); + switch(labelType) { + case LabelType::String: + cResult->terms.clear(); + break; + case LabelType::Term: { + cResult->label.clear(); + cResult->labels.clear(); + // we need to make sure the terms referred to are actually in the result machine, + // and they need to be correct + auto terms = std::move(cResult->terms); + cResult->terms.clear(); + auto &m = getMachine(*result.pTerm); + const auto handleTerm = [&m](const auto tSecond) { + m.verify(); + // lib::IO::Term::Write::wam(m, lib::Term::getStrings(), std::cout << "Copy " << addr << "\n"); + auto res = m.copyFromTemp(tSecond); + // lib::IO::Term::Write::wam(m, lib::Term::getStrings(), std::cout << "After copy " << addr << "\n"); + m.verify(); + return res.addr; + }; + cResult->term = handleTerm(cResult->term); + for(const auto tSecond: terms) + cResult->terms.push_back(handleTerm(tSecond)); + break; + } + } + this->cResult = std::move(cResult); + // std::cout << "WARNING: check converted constraint on vertex " << vNew << " for " << rFirst.getName() << " -> " << rSecond.getName() << std::endl; + } public: + virtual void operator()(const ConstraintLA &c) override { + return convertLabelAN(c); + } + virtual void operator()(const ConstraintSP &c) override { const auto &gResult = result.rDPO->getCombinedGraph(); auto vResultSrc = get(result.mSecondToResult, get_graph(rSecond), gResult, c.vSrc); diff --git a/libs/libmod/src/mod/lib/Rules/IO/Read.cpp b/libs/libmod/src/mod/lib/Rules/IO/Read.cpp index 7191d04..1295364 100644 --- a/libs/libmod/src/mod/lib/Rules/IO/Read.cpp +++ b/libs/libmod/src/mod/lib/Rules/IO/Read.cpp @@ -1,5 +1,6 @@ #include "Read.hpp" +#include #include #include #include @@ -63,6 +64,9 @@ Result parseGML(std::string_view input) { (string("op", &GML::AdjacencyConstraint::op), 1, 1) (int_("count", &GML::AdjacencyConstraint::count), 1, 1) (nodeLabels)(edgeLabels); + auto constrainLabelAny = list("constrainLabelAny", &GML::Rule::matchConstraints) + (string("label", &GML::LabelAnyConstraint::label), 1, 1) + (list("labels")(string("label", &GML::LabelAnyConstraint::labels), 1), 1, 1); auto constrainShortestPath = list("constrainShortestPath", &GML::Rule::matchConstraints) (int_("source", &GML::ShortestPathConstraint::source), 1, 1) @@ -78,7 +82,7 @@ Result parseGML(std::string_view input) { (makeSide("left", &GML::Rule::left), 0, 1) (makeSide("context", &GML::Rule::context), 0, 1) (makeSide("right", &GML::Rule::right), 0, 1) - (constrainAdj)(constrainShortestPath); + (constrainAdj)(constrainLabelAny)(constrainShortestPath); auto iterBegin = * auto iterEnd = iterBegin + 1; try { @@ -188,6 +192,14 @@ struct MatchConstraintConverter { return Result<>(); } + Result<> operator()(const GML::LabelAnyConstraint &cGML) { + auto c = std::make_unique< + lib::GraphMorphism::Constraints::LabelAny + >(cGML.label, cGML.labels); + dpoResult.leftData.matchConstraints.push_back(std::move(c)); + return Result<>(); + } + Result<> operator()(const GML::ShortestPathConstraint &cGML) { const auto iterSrc = vLabelsFromId.find(cGML.source); const auto iterTar = vLabelsFromId.find(cGML.target); diff --git a/libs/libmod/src/mod/lib/Rules/IO/Write.cpp b/libs/libmod/src/mod/lib/Rules/IO/Write.cpp index e984655..e440797 100644 --- a/libs/libmod/src/mod/lib/Rules/IO/Write.cpp +++ b/libs/libmod/src/mod/lib/Rules/IO/Write.cpp @@ -879,7 +879,22 @@ void termState(const Real &r) { } } + virtual void operator()(const lib::GraphMorphism::Constraints::LabelAny &c) override { + const auto cStr = boost::lexical_cast(counter); + Address addr{AddressType::Heap, c.term}; + std::string msg = "LabelAny(" + cStr + ", label, " + side + ")"; + addrMap[addr].insert(std::move(msg)); + for(const auto a: c.terms) { + Address addr{AddressType::Heap, a}; + std::string msg = "LabelAny(" + cStr + ", labels, " + side + ")"; + addrMap[addr].insert(std::move(msg)); + } + ++counter; + } + virtual void operator()(const lib::GraphMorphism::Constraints::ShortestPath &c) override {} + private: + int counter = 0; public: std::unordered_map> &addrMap; const lib::DPO::CombinedRule::CombinedGraphType &gCombined; diff --git a/libs/libmod/src/mod/lib/Rules/Properties/String.cpp b/libs/libmod/src/mod/lib/Rules/Properties/String.cpp index 0b8c1f8..adc892c 100644 --- a/libs/libmod/src/mod/lib/Rules/Properties/String.cpp +++ b/libs/libmod/src/mod/lib/Rules/Properties/String.cpp @@ -75,6 +75,14 @@ PropString::PropString(const RuleType &rule, c.edgeLabels.insert(termToString(t)); } + virtual void operator()(lib::GraphMorphism::Constraints::LabelAny &c) override { + assert(c.label.size() == 0); + assert(c.labels.size() == 0); + c.label = termToString(c.term); + for(const auto &t: c.terms) + c.labels.push_back(termToString(t)); + } + virtual void operator()(lib::GraphMorphism::Constraints::ShortestPath &c) override {} private: HandlerType termToString; diff --git a/libs/libmod/src/mod/lib/Rules/Properties/Term.cpp b/libs/libmod/src/mod/lib/Rules/Properties/Term.cpp index 563ae69..0596cee 100644 --- a/libs/libmod/src/mod/lib/Rules/Properties/Term.cpp +++ b/libs/libmod/src/mod/lib/Rules/Properties/Term.cpp @@ -109,6 +109,13 @@ PropTerm::PropTerm(const RuleType &rule, c.edgeTerms.insert(handleLabel(s)); } + virtual void operator()(GraphMorphism::Constraints::LabelAny &c) override { + assert(c.terms.size() == 0); + c.term = handleLabel(c.label); + for(const std::string &s: c.labels) + c.terms.push_back(handleLabel(s)); + } + virtual void operator()(GraphMorphism::Constraints::ShortestPath &c) override {} private: HandlerType handleLabel; diff --git a/test/py/matchConstraints/labelAny.py b/test/py/matchConstraints/labelAny.py new file mode 100644 index 0000000..9e7ab70 --- /dev/null +++ b/test/py/matchConstraints/labelAny.py @@ -0,0 +1,23 @@ +smiles("[C]") +smiles("[O]") +smiles("[N]") +graphDFS("[x(_a)]") + +a = ruleGMLString("""rule [ + left [ + node [ id 0 label "_x" ] + ] + right [ + node [ id 0 label "a(_x)" ] + ] + constrainLabelAny [ + label "q(_x)" + labels [ label "q(C)" label "q(N)" ] + ] +]""") +a.print() +a.printTermState() +print(a.getGMLString()) +dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation)) +dg.calc() +dg.print() From ea7a05e8043db435fefaa63c629a519a556b826c Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Fri, 23 Feb 2024 11:40:49 +0100 Subject: [PATCH 03/14] Doc, add section on application constraints --- ChangeLog.rst | 6 ++ doc/source/formats/gml.rst | 6 +- doc/source/graphModel/index.rst | 148 +++++++++++++++++++++++++++++++- 3 files changed, 154 insertions(+), 6 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 68df92f..781ddb8 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -8,6 +8,12 @@ develop ======= +New Features +------------ + +- Added a new documentation section describing rule application constraints: + :ref:`rule-constraints`. + v0.15.0 (2024-01-26) ==================== diff --git a/doc/source/formats/gml.rst b/doc/source/formats/gml.rst index 2b0212b..c415241 100644 --- a/doc/source/formats/gml.rst +++ b/doc/source/formats/gml.rst @@ -74,10 +74,10 @@ The key-value structure is exemplified by the following grammar. matchConstraint: `adjacency` | `labelAny` adjacency: 'constrainAdj [' : 'id' int - : 'op "' `op` '"' - : 'count' unsignedInt : [ 'nodeLabels [' `labelList` ']' ] : [ 'edgeLabels [' `labelList` ']' ] + : 'op "' `op` '"' + : 'count' unsignedInt : ']' labelAny: 'constrainLabelAny [' : 'label' quoteEscapedString @@ -88,6 +88,8 @@ The key-value structure is exemplified by the following grammar. Note though that list elements can appear in any order. +For details on the constraints, see :ref:`rule-constraints`. + A Note on Term Labels --------------------- diff --git a/doc/source/graphModel/index.rst b/doc/source/graphModel/index.rst index 7fcafbc..475124f 100644 --- a/doc/source/graphModel/index.rst +++ b/doc/source/graphModel/index.rst @@ -193,11 +193,150 @@ Rule Model A :cpp:class:`rule::Rule`/:py:class:`Rule` represents a `Double Pushout `__ (DPO) graph transformation rule :math:`p = (L\xleftarrow{l}K\xrightarrow{r}R)`. -Specifically, they are in the DPO variant with all morphisms being at least -graph monomorphisms. +Specifically, they are in the DPO variant with all morphisms being graph +monomorphisms. + +.. _rule-constraints: + +Application Constraints +======================= + +A rule can have additional constriants that must be fulfilled before +transformation can proceed. Specifically, a constraint :math:`c` for a rule +:math:`L\leftarrow K\rightarrow R` is evaluated once a match morphism +:math:`m\colon L\rightarrow G` has been found. +In the literature such application constraints are also called "application conditions". + +Adjacency Constraint +-------------------- + +Parameters: + +- a vertex :math:`v\in V(L)`, +- a count :math:`n\in \mathbb{N}_0`, +- an operator :math:`op\in \{<, \leq, =, \geq, >\}`, +- a set of vertex labels :math:`Q_V\in 2^\Omega`, and +- a set of edge labels :math:`Q_E\in 2^\Omega`. + +String Mode +........... + +Given a match morphism :math:`m\colon L\rightarrow G` the constraint is satisfied if + +.. math:: + + |\{ e = (m(v), u)\in outEdges(m(v))\ |\ + l_G(u)\in Q_V \wedge l_G(e)\in Q_E\}| + \ op\ n + +That is, the vertex :math:`v` is mapped to :math:`G` and its incident edges are counted. +Only those edges with a label in :math:`Q_E` and the other endpoint with a +label in :math:`Q_V` are counted. +The resulting count is then compared to the given number :math:`n`. + +Term Mode +......... + +When using :cpp:any:`LabelType::Term`/:py:obj:`LabelType.Term` the label +comparison is changed to be a most general unifier computation: + +.. math:: + + |\{ e = (m(v), u)\in outEdges(m(v))\ |\ + \exists q_V\in Q_V \exists q_E\in Q_E : + hasMGU(l_G(u) \overset{?}{=} q_V, l_G(e) \overset{?}{=} q_E\}| + \ op\ n + +That is, each edge has an independent most general unifier computation where +there must exist vertex and edge labels from the given sets such that they +unify with the labels of the candidate edge and its other endpoint. + +Specification in GML +.................... + +The constraint is specified in GML as described in :token:`~gml:adjacency`, +but where omitting the ``nodeLabels`` (resp. ``edgeLabels``) list represents setting +:math:`Q_V = \Omega`` (resp. :math:`Q_E = \Omega`), effectively letting the +counting be unrestricted with respect to those labels. + +Examples +........ + +- A vertex must have at most 3 neighbours: + :math:`n = 3, Q_V = Q_E = \Omega` and use :math:`\leq` as :math:`op`. + Assuming the vertex has ID 42 in the rule, this becomes the following in GML: + ``constraintAdj [ id 42 op "<=" count 3 ]``. +- A vertex must have at least two neighbours with label ``H``: + :math:`n = 2, Q_V = \{\texttt{H}\}, Q_E = \Omega` and use :math:`\geq` as :math:`op`. + Assuming the vertex has ID 42 in the rule, this becomes the following in GML: + ``constraintAdj [ id 42 nodeLabels [ label "H" ] op ">=" count 2 ]``. +- A vertex must have exactly 1 neighbour with label either ``O`` or ``S`` where + the connecting edge has label ``=``: + :math:`n = 1, Q_V = \{\texttt{O}, \texttt{S}\}, Q_E = \{\texttt{=}\}` and use + :math:`=` as :math:`op`. + Assuming the vertex has ID 42 in the rule, this becomes the following in GML: + ``constraintAdj [ id 42 nodeLabels [ label "O" label "S" ] op "=" count 1 ]``. + + +Label Unification Constraint +---------------------------- + +Parameters: + +- a query label :math:`q\in \Omega` and +- a list of constraining labels :math:`Q\in 2^\Omega`. + +String Mode +........... + +While this constraint technically works when using +:cpp:any:`LabelType::String`/:py:obj:`LabelType.String`, it is not really +interesting: it is statisfied if :math:`q\in Q`, and can thus be evaluated statically, +independent of any match. + +Term Mode +......... + +When using :cpp:any:`LabelType::Term`/:py:obj:`LabelType.Term` the membership +is a most general unifier computation: the constraint is statisfied if there +exists a label :math:`q'\in Q` that unifies with :math:`q`. + +Specification in GML +..................... + +The constraint is specified in GML as described in :token:`~gml:labelAny`, + +Examples +........ + +All these examples assume we are in term mode. + +- Assume some vertex is supposed to act as wildcard, but constrained to only match, + ``O`` or ``S``. + We can then give the vertex a label ``_X``, i.e., a variable, and add the constraint + :math:`q = \texttt{_X}, Q = \{\texttt{O}, \texttt{S}\}`. + In GML this becomes + ``constrainLabelAny [ label "_X" labels [ label "O" label "S" ] ]``. +- Assume we have two such vertices, but we need them to be different, i.e., if + one is matched to a ``O`` then the other must be ``S``. + The two vertices can be given different variables as labels, ``_X`` and ``_Y``, + and we then add the constraint + :math:`q = \texttt{foo(_X, _Y)}, Q = \{\texttt{foo(O, S)}, \texttt{foo(S, O)}\}``. + In GML this becomes + ``constrainLabelAny [ label "foo(_X, _Y)" labels [ label "foo(O, S)" label "foo(S, O)" ] ]``. + We here use an arbitrary function symbol, ``foo``, just for the formulation + of the constraint. + + + +Resolution of Formal Issues +=========================== + +When relating the model to the formal description of DPO transformation in the +literature there are two issues that require elaboration. Label Change -============ +------------ The rules allow both for vertices and edges to change labels, but only the latter is well-defined in traditional DPO transformation. @@ -211,7 +350,7 @@ Note that all morphisms are required to be at least graph monomorphisms, so a loop edge can not be created inadvertently. Avoiding Parallel Edges -======================= +----------------------- Our graphs are defined to be without parallel edges, which presents a mathematical problem in that certain pushouts are not allowed. @@ -232,6 +371,7 @@ rules as having implicit negative application conditions (NACs): there is a NAC on :math:`R` preventing edges :math:`(l(u), l(v))`. + .. _mol-enc: Molecule Encoding From 0bd0e8a2a3187ced00b836d07d34221d2981bd33 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sat, 24 Feb 2024 23:21:55 +0100 Subject: [PATCH 04/14] Fix adjacency constraint in term mode --- ChangeLog.rst | 7 ++ .../Constraints/VertexAdjacency.hpp | 57 ++++++++-- .../py/matchConstraints/adjacency/10_const.py | 86 ++++++++++++++ .../20_rc_coreInsteadOfComponent.py} | 10 +- .../adjacency/51_term_dup_match.py | 75 ++++++++++++ .../adjacency/52_term_dependent.py | 18 +++ .../matchConstraints/vertexAdjacency/main.py | 107 ------------------ .../vertexAdjacency/termConversion.py | 47 -------- .../vertexAdjacency/vertexAndEdge.py | 18 --- 9 files changed, 240 insertions(+), 185 deletions(-) create mode 100644 test/py/matchConstraints/adjacency/10_const.py rename test/py/matchConstraints/{vertexAdjacency/coreInsteadOfComponent.py => adjacency/20_rc_coreInsteadOfComponent.py} (77%) create mode 100644 test/py/matchConstraints/adjacency/51_term_dup_match.py create mode 100644 test/py/matchConstraints/adjacency/52_term_dependent.py delete mode 100644 test/py/matchConstraints/vertexAdjacency/main.py delete mode 100644 test/py/matchConstraints/vertexAdjacency/termConversion.py delete mode 100644 test/py/matchConstraints/vertexAdjacency/vertexAndEdge.py diff --git a/ChangeLog.rst b/ChangeLog.rst index 781ddb8..9f6fe10 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -15,6 +15,13 @@ New Features :ref:`rule-constraints`. +Bugs Fixed +---------- + +- Fix adjacency constraint when in term mode and multiple labels in the constraint + matches the same label in the candidate graph. + + v0.15.0 (2024-01-26) ==================== diff --git a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/VertexAdjacency.hpp b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/VertexAdjacency.hpp index 1900d68..0e05563 100644 --- a/libs/libmod/src/mod/lib/GraphMorphism/Constraints/VertexAdjacency.hpp +++ b/libs/libmod/src/mod/lib/GraphMorphism/Constraints/VertexAdjacency.hpp @@ -9,6 +9,13 @@ #include #include +//#define DEBUG_ADJACENCY_CONSTRAINT +#ifdef DEBUG_ADJACENCY_CONSTRAINT + +#include + +#endif + namespace mod::lib::GraphMorphism::Constraints { template @@ -19,7 +26,7 @@ struct VertexAdjacency : Constraint { VertexAdjacency(Vertex vConstrained, Operator op, int count) : vConstrained(vConstrained), op(op), count(count), vertexLabels(1), edgeLabels(1) {} - virtual std::unique_ptr> clone() const override { + virtual std::unique_ptr> clone() const override { auto c = std::make_unique(vConstrained, op, count); c->vertexLabels = vertexLabels; c->edgeLabels = edgeLabels; @@ -32,7 +39,7 @@ struct VertexAdjacency : Constraint { private: template int matchesImpl(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, - const LabelSettings ls, std::false_type) const { + const LabelSettings ls, std::false_type) const { assert(ls.type == LabelType::String); // otherwise someone forgot to add the TermData prop using GraphCodom = typename LabelledGraphTraits::GraphType; const GraphCodom &gCodom = get_graph(lgCodom); @@ -55,7 +62,7 @@ struct VertexAdjacency : Constraint { template int matchesImpl(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, - const LabelSettings ls, std::true_type) const { + const LabelSettings ls, std::true_type) const { assert(ls.type == LabelType::Term); // otherwise someone did something very strange using GraphCodom = typename LabelledGraphTraits::GraphType; const GraphCodom &gCodom = get_graph(lgCodom); @@ -66,14 +73,17 @@ struct VertexAdjacency : Constraint { const auto countPerVertexTerms = [&](const auto h) { if(vertexTerms.empty()) { ++count; + return true; } else { for(const auto t: vertexTerms) { lib::Term::MGU mgu = machine.unifyHeapTemp(h, t); + machine.revert(mgu); if(mgu.status == lib::Term::MGU::Status::Exists) { ++count; + return true; } - machine.revert(mgu); } + return false; } }; const auto countPerEdgeTerms = [&](const auto hEdge, const auto hVertex) { @@ -83,9 +93,13 @@ struct VertexAdjacency : Constraint { for(const auto t: edgeTerms) { lib::Term::MGU mgu = machine.unifyHeapTemp(hEdge, t); if(mgu.status == lib::Term::MGU::Status::Exists) { - countPerVertexTerms(hVertex); + if(countPerVertexTerms(hVertex)) { + machine.revert(mgu); + return; + } + } else { + machine.revert(mgu); } - machine.revert(mgu); } } }; @@ -98,10 +112,11 @@ struct VertexAdjacency : Constraint { public: template bool matches(Visitor &vis, const Graph &gDom, const LabelledGraphCodom &lgCodom, VertexMap &m, - const LabelSettings ls) const { + const LabelSettings ls) const { using GraphCodom = typename LabelledGraphTraits::GraphType; - static_assert(std::is_same::GraphDom>::value, - ""); + static_assert( + std::is_same::GraphDom>::value, + ""); static_assert( std::is_same::GraphCodom>::value, ""); @@ -118,6 +133,30 @@ struct VertexAdjacency : Constraint { using HasTerm = GraphMorphism::HasTermData; const int count = matchesImpl(vis, gDom, lgCodom, m, ls, HasTerm()); +#ifdef DEBUG_ADJACENCY_CONSTRAINT + { + std::cout << "AdjacencyConstraint eval: {"; + for(const auto &s: vertexLabels) std::cout << " " << s; + std::cout << " } {"; + for(const auto &s: edgeLabels) std::cout << " " << s; + std::cout << " } = " << count << " "; + [this]() -> std::ostream & { + switch(op) { + case Operator::EQ: + return std::cout << "="; + case Operator::LT: + return std::cout << "<"; + case Operator::GT: + return std::cout << ">"; + case Operator::LEQ: + return std::cout << "<="; + case Operator::GEQ: + return std::cout << ">="; + } + return std::cout; + }() << " " << this->count << " hasTerm=" << std::boolalpha << HasTerm::value << std::endl; + } +#endif switch(op) { case Operator::EQ: return count == this->count; diff --git a/test/py/matchConstraints/adjacency/10_const.py b/test/py/matchConstraints/adjacency/10_const.py new file mode 100644 index 0000000..06c93f1 --- /dev/null +++ b/test/py/matchConstraints/adjacency/10_const.py @@ -0,0 +1,86 @@ +post.disableInvokeMake() + +lString = LabelSettings(LabelType.String, LabelRelation.Specialisation) +lTerm = LabelSettings(LabelType.Term, LabelRelation.Specialisation) + +Graph.fromDFS("[Q]({a}[A])({b}[B])({a}[C])({b}[C])({c}[C])({c}[C])") +ruleTemplate = """rule [ + ruleID "{}" + left [ node [ id 0 label "Q" ] ] + right [ node [ id 0 label "Q({})" ] ] + constrainAdj [ + id 0 op "{}" + count {} + {} + ] +]""" +ops = {'lt': '<', 'leq': '<=', 'eq': '=', 'geq': '>=', 'gt': '>'} +def evalOp(a, op, b): + if op == '<': return a < b + if op == '<=': return a <= b + if op == '=': return a == b + if op == '>=': return a >= b + if op == '>': return a > b + assert False +nodeLabels = { + '': '', + 'A': 'nodeLabels [ label "A" ]', + 'B': 'nodeLabels [ label "B" label "B" ]', # make sure duplicates don't do anything + 'C': 'nodeLabels [ label "C" ]', + 'AB': 'nodeLabels [ label "A" label "B" ]', + 'AC': 'nodeLabels [ label "A" label "C" ]', + 'BC': 'nodeLabels [ label "B" label "C" ]', + 'ABC': 'nodeLabels [ label "A" label "B" label "C" ]', +} +edgeLabels = { + '': '', + 'a': 'edgeLabels [ label "a" ]', + 'b': 'edgeLabels [ label "b" label "b" ]', + 'c': 'edgeLabels [ label "c" ]', + 'ab': 'edgeLabels [ label "a" label "b" ]', + 'ac': 'edgeLabels [ label "a" label "c" ]', + 'bc': 'edgeLabels [ label "b" label "c" ]', + 'abc': 'edgeLabels [ label "a" label "b" label "c" ]', +} +for count in range(10): + for opName, op in ops.items(): + for nlName, nl in nodeLabels.items(): + for elName, el in edgeLabels.items(): + name = ','.join([opName, str(count), f"V{nlName}", f"E{elName}"]) + labels = f"{nl}\n{el}\n" + Rule.fromGMLString(ruleTemplate.format(name, name, op, count, labels)) + +err = False + +def doDG(name, lSettings): + print(name + "\n" + "="*50) + dg = DG(graphDatabase=inputGraphs, labelSettings=lSettings) + dg.build().execute(addSubset(inputGraphs) >> inputRules) + found = set() + for vDG in dg.vertices: + g = vDG.graph + try: + v = next(a for a in g.vertices if a.stringLabel.startswith("Q(")) + except StopIteration: + continue + l = v.stringLabel + l = l[2:-1] + op, count, nl, el = l.split(',') + op, count, nl, el = ops[op], int(count), nl.strip()[1:], el.strip()[1:] + candCount = 0 + for e in v.incidentEdges: + if len(el) != 0 and e.stringLabel not in el: + continue + u = e.target + if len(nl) != 0 and e.target.stringLabel not in nl: + continue + candCount += 1 + if(not evalOp(candCount, op, count)): + print(f"Error: '{nl}' '{el}' = {candConut} {op} {count}") + err = True + +doDG("String", lString) +doDG("Term", lTerm) + +if err: + assert False diff --git a/test/py/matchConstraints/vertexAdjacency/coreInsteadOfComponent.py b/test/py/matchConstraints/adjacency/20_rc_coreInsteadOfComponent.py similarity index 77% rename from test/py/matchConstraints/vertexAdjacency/coreInsteadOfComponent.py rename to test/py/matchConstraints/adjacency/20_rc_coreInsteadOfComponent.py index caf5242..7c8177e 100644 --- a/test/py/matchConstraints/vertexAdjacency/coreInsteadOfComponent.py +++ b/test/py/matchConstraints/adjacency/20_rc_coreInsteadOfComponent.py @@ -1,6 +1,8 @@ +post.disableInvokeMake() + # test case for the bug where the constraint is checked in the core graph # instead of the component graph -rLeft = ruleGMLString("""rule [ +rLeft = Rule.fromGMLString("""rule [ left [ edge [ source 1 target 2 label "-" ] ] @@ -9,16 +11,16 @@ node [ id 2 label "O" ] ] ]""") -rRight = ruleGMLString("""rule [ +rRight = Rule.fromGMLString("""rule [ context [ node [ id 1 label "C" ] ] constrainAdj [ - id 1 count 0 op "=" + id 1 nodeLabels [ label "O" ] + count 0 op "=" ] ]""") rc = rcEvaluator(inputRules) exp = rc.eval(rLeft *rcSuper(enforceConstraints=True)* rRight) assert len(exp) > 0 -for a in exp: a.print() diff --git a/test/py/matchConstraints/adjacency/51_term_dup_match.py b/test/py/matchConstraints/adjacency/51_term_dup_match.py new file mode 100644 index 0000000..f6114f8 --- /dev/null +++ b/test/py/matchConstraints/adjacency/51_term_dup_match.py @@ -0,0 +1,75 @@ +post.disableInvokeMake() + +lTerm = LabelSettings(LabelType.Term, LabelRelation.Specialisation) + +# test that multiple different matches of constraints don't increase the count + +Graph.fromDFS("[Q]({a}[A])({b}[B])") +ruleTemplate = """rule [ + ruleID "{}" + left [ node [ id 0 label "Q" ] ] + right [ node [ id 0 label "Q({})" ] ] + constrainAdj [ + id 0 op "{}" + count {} + {} + ] +]""" +ops = {'lt': '<', 'leq': '<=', 'eq': '=', 'geq': '>=', 'gt': '>'} +def evalOp(a, op, b): + if op == '<': return a < b + if op == '<=': return a <= b + if op == '=': return a == b + if op == '>=': return a >= b + if op == '>': return a > b + assert False +nodeLabels = { + '': '', + 'A': 'nodeLabels [ label "_A" ]', + 'AA': 'nodeLabels [ label "_A" label "_A" ]', + 'AB': 'nodeLabels [ label "_A" label "_B" ]', +} +edgeLabels = { + '': '', + 'a': 'edgeLabels [ label "_a" ]', + 'aa': 'edgeLabels [ label "_a" label "_a" ]', + 'ab': 'edgeLabels [ label "_a" label "_b" ]', +} +valid = set() +for count in range(0, 4): + for opName, op in ops.items(): + for nlName, nl in nodeLabels.items(): + for elName, el in edgeLabels.items(): + if evalOp(2, op, count): + valid.add((nlName, elName, op, count)) + name = ','.join([opName, str(count), f"V{nlName}", f"E{elName}"]) + labels = f"{nl}\n{el}\n" + Rule.fromGMLString(ruleTemplate.format(name, name, op, count, labels)) + + +dg = DG(graphDatabase=inputGraphs, labelSettings=lTerm) +dg.build().execute(addSubset(inputGraphs) >> inputRules) +dg.print() +found = set() +for vDG in dg.vertices: + g = vDG.graph + try: + v = next(a for a in g.vertices if a.stringLabel.startswith("Q(")) + except StopIteration: + continue + l = v.stringLabel + l = l[2:-1] + op, count, nl, el = l.split(',') + op, count, nl, el = ops[op], int(count), nl.strip()[1:], el.strip()[1:] + found.add((nl, el, op, count)) +err = False +for e in sorted(found): + if e not in valid: + print("Invalid:", e) + err = True +for e in sorted(valid): + if e not in found: + print("Missing valid:", e) + err = True +if err: + assert False diff --git a/test/py/matchConstraints/adjacency/52_term_dependent.py b/test/py/matchConstraints/adjacency/52_term_dependent.py new file mode 100644 index 0000000..cabde0b --- /dev/null +++ b/test/py/matchConstraints/adjacency/52_term_dependent.py @@ -0,0 +1,18 @@ +post.disableInvokeMake() + +# check that the node and edge label unifications must happen at the same time +Graph.fromDFS("[_x]{_x}[C]") +Rule.fromGMLString("""rule [ + left [ node [ id 0 label "C" ] ] + right [ node [ id 0 label "U" ] ] + constrainAdj [ + id 0 + nodeLabels [ label "a" ] + edgeLabels [ label "b" ] + op "=" count 1 + ] +]""") +dg = DG(graphDatabase=inputGraphs, + labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation)) +dg.build().execute(addSubset(inputGraphs) >> inputRules) +assert dg.numEdges == 0, f"|E| = {dg.numEdges}" diff --git a/test/py/matchConstraints/vertexAdjacency/main.py b/test/py/matchConstraints/vertexAdjacency/main.py deleted file mode 100644 index 0b22126..0000000 --- a/test/py/matchConstraints/vertexAdjacency/main.py +++ /dev/null @@ -1,107 +0,0 @@ -post.disableInvokeMake() - -lString = LabelSettings(LabelType.String, LabelRelation.Unification) -lTerm = LabelSettings(LabelType.Term, LabelRelation.Unification) - -graphGMLString("""graph [ - node [ id 0 label "C" ] - edge [ source 0 target 1 label "a" ] - node [ id 1 label "A" ] - edge [ source 0 target 2 label "b" ] - node [ id 2 label "B" ] -]""") -ruleTemplate = """rule [ - ruleID "%s" - left [ - node [ id 0 label "C" ] - ] - right [ - node [ id 0 label "C(%s)" ] - ] - constrainAdj [ - id 0 op "%s" - count %d - %s - ] -]""" -ops = {'lt': '<', 'leq': '<=', 'eq': '=', 'geq': '>=', 'gt': '>'} -def evalOp(a, op, b): - if op == '<': return a < b - if op == '<=': return a <= b - if op == '=': return a == b - if op == '>=': return a >= b - if op == '>': return a > b - assert False -nodeLabels = { - '': '', - 'A': 'nodeLabels [ label "A" ]', - 'AB': 'nodeLabels [ label "A" label "B" ]', -} -edgeLabels = { - '': '', - 'a': 'edgeLabels [ label "a" ]', - 'ab': 'edgeLabels [ label "a" label "b" ]', -} -trueCounts = { - ('', ''): 2, ('', 'a'): 1, ('', 'ab'): 2, - ('A', ''): 1, ('A', 'a'): 1, ('A', 'ab'): 1, - ('AB', ''): 2, ('AB', 'a'): 1, ('AB', 'ab'): 2 -} -valid = set() -for count in range(0, 4): - for opName, op in ops.items(): - for nlName, nl in nodeLabels.items(): - for elName, el in edgeLabels.items(): - if evalOp(trueCounts[(nlName, elName)], op, count): - valid.add((nlName, elName, opName, count)) - name = ','.join(a for a in [opName, str(count), nlName, elName] if len(a) > 0) - labels = nl + "\n" + el + "\n" - ruleGMLString(ruleTemplate % (name, name, op, count, labels)) -def doDG(name, lSettings): - print(name + "\n" + "="*50) - dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=lSettings) - dg.calc() - found = set() - for vDG in dg.vertices: - g = vDG.graph - v = next(a for a in g.vertices if a.stringLabel.startswith("C")) - l = v.stringLabel - if l == "C": continue - l = l[2:-1] - if l.find(', ') != -1: - ls = l.split(', ') - else: - ls = l.split(',') - if len(ls[2:]) == 0: - nl = '' - el = '' - elif len(ls[2:]) == 1: - if ls[2] in nodeLabels: - nl = ls[2] - el = '' - else: - assert ls[2] in edgeLabels - nl = '' - el = ls[2] - else: - assert len(ls[2:]) == 2 - nl = ls[2] - el = ls[3] - t = (nl, el, ls[0], int(ls[1])) - found.add(t) - print(ls[2:], ops[ls[0]], ls[1]) - err = False - for f in found: - if f not in valid: - print("Too much:", f) - err = True - for v in valid: - if v not in found: - print("Too little:", v) - err = True - if err: - print(sorted(found)) - print(sorted(valid)) - assert False -doDG("String", lString) -doDG("Term", lTerm) diff --git a/test/py/matchConstraints/vertexAdjacency/termConversion.py b/test/py/matchConstraints/vertexAdjacency/termConversion.py deleted file mode 100644 index b723df2..0000000 --- a/test/py/matchConstraints/vertexAdjacency/termConversion.py +++ /dev/null @@ -1,47 +0,0 @@ -ls = LabelSettings(LabelType.Term, LabelRelation.Unification) -rId = ruleGMLString("""rule [ - context [ - node [ id 0 label "C" ] - ] - right [ - node [ id 1 label "R" ] - edge [ source 0 target 1 label "-" ] - ] -]""") -rIdInv = rId.makeInverse() -rStr = """rule [ - context [ - node [ id 0 label "C" ] - node [ id 1 label "Q" ] - edge [ source 0 target 1 label "-" ] - ] - constrainAdj [ - id 1 op "=" count 1 - nodeLabels [ label "a" label "_x" label "b(c)" label "d(_y)" ] - edgeLabels [ label "g" label "_p" label "h(i)" label "j(_q)" ] - ] -]""" -a = ruleGMLString(rStr) -post.summaryChapter("TermState") -a.printTermState() -#b = a.makeInverse() - -post.summaryChapter("Compose first") -rc = rcEvaluator([], ls) -res = rc.eval(a *rcSuper* rId) -for b in res: - b.print() - b.printTermState() - -post.summaryChapter("Compose second") -rc = rcEvaluator([], ls) -res = rc.eval(rIdInv *rcSub* a) -for b in res: - b.print() - b.printTermState() - -post.summaryChapter("DGRuleComp") -graphDFS("C[Q]") -dg = dgRuleComp([], addSubset(inputGraphs) >> a, ls) -dg.calc() -dg.print() diff --git a/test/py/matchConstraints/vertexAdjacency/vertexAndEdge.py b/test/py/matchConstraints/vertexAdjacency/vertexAndEdge.py deleted file mode 100644 index 010b4a9..0000000 --- a/test/py/matchConstraints/vertexAdjacency/vertexAndEdge.py +++ /dev/null @@ -1,18 +0,0 @@ -graphDFS("[_x]{_x}[C]") -ruleGMLString("""rule [ - left [ - node [ id 0 label "C" ] - ] - right [ - node [ id 0 label "U" ] - ] - constrainAdj [ - id 0 op "=" count 1 - nodeLabels [ label "a" ] - edgeLabels [ label "b" ] - ] -]""") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, - labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation)) -dg.calc() -dg.print() From ad397bd1ed503b5c75d49c292f48ec953335f605 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 4 Mar 2024 09:17:31 +0100 Subject: [PATCH 05/14] CI, add macos-14 --- .github/workflows/Main.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/Main.yml b/.github/workflows/Main.yml index 895de3b..7fd8aac 100644 --- a/.github/workflows/Main.yml +++ b/.github/workflows/Main.yml @@ -151,3 +151,34 @@ jobs: run: cd build && ctest --output-on-failure -j 4 - name: Run simple test run: mod -e "smiles('O').print()" + macOS-14: + runs-on: macos-14 + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + fetch-depth: 0 + submodules: 'recursive' + - name: Install Brew dependencies + run: | + brew bundle + /usr/libexec/path_helper | sed -e 's/^PATH="//' -e 's/"; export PATH;//' | tr ":" "\n" | tail -r >> $GITHUB_PATH + - name: Install pip dependencies + run: pip3 install -r requirements.txt + - name: Bootstrap + run: ./bootstrap.sh + - name: Configure + run: | + mkdir build + cd build + cmake ../ -DBUILD_DOC=on -DBUILD_TESTING=on + - name: Build + run: cd build && make -j 3 + - name: Install + run: cd build && sudo make install + - name: Build tests + run: cd build && make tests -j 3 + - name: Run tests + run: cd build && ctest --output-on-failure -j 3 + - name: Run simple test + run: mod -e "smiles('O').print()" From 648fd7afb2474992a6a02c656a7384444aee5f83 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 4 Mar 2024 09:17:48 +0100 Subject: [PATCH 06/14] CI, update last checkouts to v3 --- .github/workflows/Main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/Main.yml b/.github/workflows/Main.yml index 7fd8aac..8bfaafb 100644 --- a/.github/workflows/Main.yml +++ b/.github/workflows/Main.yml @@ -124,7 +124,7 @@ jobs: runs-on: macos-13 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: 'recursive' @@ -155,7 +155,7 @@ jobs: runs-on: macos-14 steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 submodules: 'recursive' From 49f23445d545c929df3c2e9fcf676d3502c6e0f9 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 4 Mar 2024 09:19:04 +0100 Subject: [PATCH 07/14] CI, remove macos-11 --- .github/workflows/Main.yml | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/.github/workflows/Main.yml b/.github/workflows/Main.yml index 8bfaafb..88c0959 100644 --- a/.github/workflows/Main.yml +++ b/.github/workflows/Main.yml @@ -54,39 +54,6 @@ jobs: run: cd build && ctest --output-on-failure -j 2 - name: Run simple test run: mod -e "smiles('O').print()" - macOS-11: - runs-on: macos-11 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - submodules: 'recursive' - - name: Install Brew dependencies - run: brew bundle - - name: Install pip dependencies - run: pip3 install -r requirements.txt - - name: Set PATH - run: | - /usr/libexec/path_helper | sed -e 's/^PATH="//' -e 's/"; export PATH;//' | tr ":" "\n" | tail -r >> $GITHUB_PATH - python3 -c 'import os,sysconfig;print(sysconfig.get_path("scripts",f"{os.name}_prefix"))' >> $GITHUB_PATH - - name: Bootstrap - run: ./bootstrap.sh - - name: Configure - run: | - mkdir build - cd build - cmake ../ -DBUILD_DOC=on -DBUILD_TESTING=on - - name: Build - run: cd build && make -j 3 - - name: Install - run: cd build && sudo make install - - name: Build tests - run: cd build && make tests -j 3 - - name: Run tests - run: cd build && ctest --output-on-failure -j 3 - - name: Run simple test - run: mod -e "smiles('O').print()" macOS-12: runs-on: macos-12 steps: From b221f94e9f5050551daea8f7d894588c803d10ff Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Wed, 13 Mar 2024 12:13:58 +0100 Subject: [PATCH 08/14] Rule, fix makeInverse when no external IDs --- ChangeLog.rst | 2 ++ libs/libmod/src/mod/rule/Rule.cpp | 7 +++++-- test/py/rule/520_inverse.py | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 9f6fe10..6544f95 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -20,6 +20,8 @@ Bugs Fixed - Fix adjacency constraint when in term mode and multiple labels in the constraint matches the same label in the candidate graph. +- Fix :cpp:func:`rule::Rule::makeInverse`/:py:meth:`Rule.makeInverse` to not crash + when the rule has no external IDs recorded. v0.15.0 (2024-01-26) diff --git a/libs/libmod/src/mod/rule/Rule.cpp b/libs/libmod/src/mod/rule/Rule.cpp index f5ec158..64ec9a3 100644 --- a/libs/libmod/src/mod/rule/Rule.cpp +++ b/libs/libmod/src/mod/rule/Rule.cpp @@ -95,8 +95,11 @@ std::shared_ptr Rule::makeInverse() const { const bool ignore = getConfig().rule.ignoreConstraintsDuringInversion.get(); if(ignore) dpoRule.rightData.matchConstraints.clear(); auto rInner = std::make_unique(std::move(dpoRule), getLabelType()); - rInner->setName(this->getName() + ", inverse"); - return makeRule(std::move(rInner), *p->externalToInternalIds); + rInner->setName(this->getName() +", inverse"); + if(p->externalToInternalIds) + return makeRule(std::move(rInner), *p->externalToInternalIds); + else + return makeRule(std::move(rInner), {}); } std::pair Rule::print() const { diff --git a/test/py/rule/520_inverse.py b/test/py/rule/520_inverse.py index f18e4f4..c4895c8 100644 --- a/test/py/rule/520_inverse.py +++ b/test/py/rule/520_inverse.py @@ -40,6 +40,8 @@ def check(s1, s2): check('', 'node [ id 0 label "A" ]') check('node [ id 0 label "A" ]', 'node [ id 0 label "B" ]') check('node [ id 0 label "C" ]', 'node [ id 0 label "C" ]') +# in particular to test external ID propagation when none are present: +Rule.fromDFS("[A]>>[B]").makeInverse() # edges check(''' node [ id 0 label "X" ] From c0f3e85d98bfb69d68ed0ddba706b9595509c91b Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Wed, 17 Apr 2024 16:05:30 +0200 Subject: [PATCH 09/14] Docs, fix missing jquery in the build docs --- doc/source/conf.py | 3 ++- requirements.txt | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/source/conf.py b/doc/source/conf.py index 7e82d5f..17dd994 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -4,13 +4,14 @@ # -- General configuration ------------------------------------------------ needs_sphinx = '3.5.0' -sys.path.append(os.path.abspath('extensions')) +sys.path.insert(0, os.path.abspath('extensions')) extensions = [ 'sphinx.ext.todo', 'sphinx.ext.mathjax', 'sphinx.ext.githubpages', 'sphinx.ext.intersphinx', 'sphinx_bootstrap_theme', + 'sphinxcontrib.jquery', 'ignore_missing_refs', 'sphinx_design', ] diff --git a/requirements.txt b/requirements.txt index 09accb8..6cc7f1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ -r requirements_nodoc.txt sphinx>=3.5 sphinx_design +sphinxcontrib-jquery # for the bootstrap theme From 7bd04552def4228703116da3443c103ebec4d76c Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Wed, 12 Jun 2024 07:42:08 +0200 Subject: [PATCH 10/14] [hax] add config.dg.doRuleIsomorphismDuringBinding --- libs/libmod/src/mod/Config.hpp | 3 +- .../libmod/src/mod/lib/DG/NonHyperBuilder.cpp | 31 ++++++++++------ .../src/mod/lib/DG/RuleApplicationUtils.hpp | 37 ++++++++++--------- .../libmod/src/mod/lib/DG/Strategies/Rule.cpp | 1 + .../src/mod/lib/DG/Strategies/Strategy.hpp | 5 ++- 5 files changed, 46 insertions(+), 31 deletions(-) diff --git a/libs/libmod/src/mod/Config.hpp b/libs/libmod/src/mod/Config.hpp index 6399aef..3baffe0 100644 --- a/libs/libmod/src/mod/Config.hpp +++ b/libs/libmod/src/mod/Config.hpp @@ -341,6 +341,7 @@ struct Config { ((bool, disableRepeatFixedPointCheck, false)) \ ((bool, applyAssumeConfluence, false)) \ ((int, applyLimit, -1)) \ + ((bool, doRuleIsomorphismDuringBinding, true)) \ )) \ ((Graph, graph, \ ((bool, smilesCheckAST, false)) \ @@ -399,7 +400,7 @@ struct Config { #define MOD_toString(s) MOD_toString1(s) #define MOD_toString1(s) #s -BOOST_PP_SEQ_FOR_EACH(MOD_CONFIG_nsIter, ~, MOD_CONFIG_DATA()) + BOOST_PP_SEQ_FOR_EACH(MOD_CONFIG_nsIter, ~, MOD_CONFIG_DATA()) #undef MOD_CONFIG_settingIterCons #undef MOD_CONFIG_settingIter diff --git a/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp b/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp index 8cf444e..6947fdf 100644 --- a/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp +++ b/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp @@ -37,7 +37,7 @@ void ExecuteResult::list(bool withUniverse) const { // ----------------------------------------------------------------------------- Builder::Builder(NonHyperBuilder *dg, - std::shared_ptr> onNewVertex, + std::shared_ptr> onNewVertex, std::shared_ptr> onNewHyperEdge) : dg(dg) { if(dg->getHasCalculated()) { this->dg = nullptr; @@ -103,8 +103,9 @@ std::pair Builder::addDerivation(const Derivations &d, Iso } struct NonHyperBuilder::ExecutionEnv final : public Strategies::ExecutionEnv { - ExecutionEnv(NonHyperBuilder &owner, LabelSettings labelSettings, Rules::GraphAsRuleCache &graphAsRuleCache) - : Strategies::ExecutionEnv(labelSettings, graphAsRuleCache), owner(owner) {} + ExecutionEnv(NonHyperBuilder &owner, LabelSettings labelSettings, bool doRuleIsomorphism, + Rules::GraphAsRuleCache &graphAsRuleCache) + : Strategies::ExecutionEnv(labelSettings, doRuleIsomorphism, graphAsRuleCache), owner(owner) {} void tryAddGraph(std::shared_ptr gCand) override { owner.tryAddGraph(gCand); @@ -184,8 +185,10 @@ struct NonHyperBuilder::ExecutionEnv final : public Strategies::ExecutionEnv { ExecuteResult Builder::execute(std::unique_ptr strategy_, int verbosity, bool ignoreRuleLabelTypes) { + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); NonHyperBuilder::StrategyExecution exec{ - std::make_unique(*dg, dg->getLabelSettings(), dg->graphAsRuleCache), + std::make_unique(*dg, dg->getLabelSettings(), doRuleIsomorphism, + dg->graphAsRuleCache), std::make_unique(), std::move(strategy_) }; @@ -196,8 +199,9 @@ Builder::execute(std::unique_ptr strategy_, int verbosity, if(dg->getLabelSettings().type == LabelType::Term) { const auto &term = get_term(gCand->getGraph().getLabelledGraph()); if(!isValid(term)) { - std::string msg = "Parsing failed for graph '" + gCand->getName() + "' in static add strategy. " + - term.getParsingError(); + std::string msg = + "Parsing failed for graph '" + gCand->getName() + "' in static add strategy. " + + term.getParsingError(); throw TermParsingError(std::move(msg)); } } @@ -232,6 +236,7 @@ std::vector> Builder::apply(const std::vector> &graphs, std::shared_ptr rOrig, int verbosity, IsomorphismPolicy graphPolicy) { + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); IO::Logger logger(std::cout); dg->rules.insert(rOrig); switch(graphPolicy) { @@ -288,7 +293,7 @@ Builder::apply(const std::vector> &graphs, verbosity, logger, round, firstGraph, firstGraph + round + 1, inputRules, - dg->graphAsRuleCache, ls, + dg->graphAsRuleCache, ls, doRuleIsomorphism, onOutput); for(BoundRule &br: outputRules) { // always go to the next graph @@ -353,6 +358,7 @@ std::vector> Builder::applyRelaxed(const std::vector> &graphs, std::shared_ptr rOrig, int verbosity, IsomorphismPolicy graphPolicy) { + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); IO::Logger logger(std::cout); dg->rules.insert(rOrig); switch(graphPolicy) { @@ -439,7 +445,7 @@ Builder::applyRelaxed(const std::vector> &graphs, (verbosity, logger, round, firstGraph, lastGraph, inputRules, - dg->graphAsRuleCache, ls, + dg->graphAsRuleCache, ls, doRuleIsomorphism, onOutput); for(BoundRule &br: outputRules) { // always go to the next graph @@ -656,7 +662,8 @@ bool Builder::trustLoadDump(nlohmann::json &&j, for(int src: e[1]) { auto gIter = graphFromId.find(src); if(gIter == end(graphFromId)) { - err << "Corrupt data for edge " << e[0].get() << ". Source " << src << " is not a yet a vertex."; + err << "Corrupt data for edge " << e[0].get() << ". Source " << src + << " is not a yet a vertex."; return false; } srcGraphs.push_back(gIter->second); @@ -664,7 +671,8 @@ bool Builder::trustLoadDump(nlohmann::json &&j, for(int tar: e[2]) { auto gIter = graphFromId.find(tar); if(gIter == end(graphFromId)) { - err << "Corrupt data for edge " << e[0].get() << ". Target " << tar << " is not a yet a vertex."; + err << "Corrupt data for edge " << e[0].get() << ". Target " << tar + << " is not a yet a vertex."; return false; } tarGraphs.push_back(gIter->second); @@ -676,7 +684,8 @@ bool Builder::trustLoadDump(nlohmann::json &&j, } else { for(const int rId: ruleIds) { if(rId < 0 || rId >= rules.size()) { - err << "Corrupt data for edge " << e[0].get() << ". Rule offset " << rId << " is not in range."; + err << "Corrupt data for edge " << e[0].get() << ". Rule offset " << rId + << " is not in range."; return false; } const auto r = rules[rId]; diff --git a/libs/libmod/src/mod/lib/DG/RuleApplicationUtils.hpp b/libs/libmod/src/mod/lib/DG/RuleApplicationUtils.hpp index c2dfd4c..8d63b7a 100644 --- a/libs/libmod/src/mod/lib/DG/RuleApplicationUtils.hpp +++ b/libs/libmod/src/mod/lib/DG/RuleApplicationUtils.hpp @@ -35,7 +35,7 @@ struct BoundRule { friend std::ostream &operator<<(std::ostream &s, const BoundRule &br) { s << "{rule=" << br.rule->getName() << ", boundGraphs=["; bool first = true; - for(const auto *g : br.boundGraphs) { + for(const auto *g: br.boundGraphs) { if(!first) s << ", "; else first = false; s << g->getName(); @@ -67,6 +67,7 @@ template const std::vector &inputRules, Rules::GraphAsRuleCache &graphAsRuleCache, const LabelSettings labelSettings, + const bool doRuleIsomorphism, OnOutput onOutput) { if(verbosity >= V_RuleApplication) { logger.indent() << "Bind round " << (bindRound + 1) << " with " @@ -77,7 +78,7 @@ template int numDup = 0; int numUnique = 0; std::vector outputRules; - for(const BoundRule &brInput : inputRules) { + for(const BoundRule &brInput: inputRules) { if(verbosity >= V_RuleApplication_Binding) { logger.indent() << "Processing input rule " << brInput << std::endl; ++logger.indentLevel; @@ -92,7 +93,7 @@ template ++logger.indentLevel; } const auto reporter = - [labelSettings, &logger, &brInput, &outputRules, firstGraph, iterGraph, onOutput, &numUnique, &numDup] + [labelSettings, doRuleIsomorphism, &logger, &brInput, &outputRules, firstGraph, iterGraph, onOutput, &numUnique, &numDup] (std::unique_ptr r) -> bool { BoundRule brOutput{r.release(), brInput.boundGraphs, static_cast(iterGraph - firstGraph)}; @@ -100,11 +101,13 @@ template if(!brOutput.rule->isOnlyRightSide()) { // check if we have it already brOutput.makeCanonical(); - for(const BoundRule &brStored : outputRules) { - if(brStored.isomorphicTo(brOutput, labelSettings)) { - delete brOutput.rule; - ++numDup; - return true; + if(doRuleIsomorphism) { + for(const BoundRule &brStored: outputRules) { + if(brStored.isomorphicTo(brOutput, labelSettings)) { + delete brOutput.rule; + ++numDup; + return true; + } } } // we store a copy of the bound info so the user can mess with their copy @@ -155,7 +158,7 @@ struct BoundRuleStorage { return g1->getId() < g2->getId(); }); - for(BoundRule &rp : ruleStore) { + for(BoundRule &rp: ruleStore) { if(rThis.size() != rp.boundGraphs.size()) continue; std::vector &rOther = rp.boundGraphs; @@ -183,7 +186,7 @@ struct BoundRuleStorage { ruleStore.push_back(p); if(verbose) { logger.indent() << "BoundRules: added <" << r->getName() << ", {"; - for(const auto *g : p.boundGraphs) + for(const auto *g: p.boundGraphs) logger.s << " " << g->getName(); logger.s << " }> onlyRight: " << std::boolalpha << r->isOnlySide(lib::Rules::Membership::R) << std::endl; @@ -235,14 +238,14 @@ std::vector> splitRule(const lib::Rules::LabelledR auto rpString = get_string(get_labelled_right(rDPO)); assert(num_vertices(gRight) == num_vertices(get_graph(rDPO))); std::vector vertexMap(num_vertices(gRight)); - for(const auto vSide : asRange(vertices(gRight))) { + for(const auto vSide: asRange(vertices(gRight))) { const auto comp = compMap[get(boost::vertex_index_t(), gRight, vSide)]; auto &p = products[comp]; const auto v = add_vertex(*p.gPtr); vertexMap[get(boost::vertex_index_t(), gRight, vSide)] = v; p.pStringPtr->addVertex(v, rpString[vSide]); } - for(const auto eSide : asRange(edges(gRight))) { + for(const auto eSide: asRange(edges(gRight))) { const auto vSideSrc = source(eSide, gRight); const auto vSideTar = target(eSide, gRight); const auto comp = compMap[get(boost::vertex_index_t(), gRight, vSideSrc)]; @@ -256,16 +259,16 @@ std::vector> splitRule(const lib::Rules::LabelledR if(withStereo && has_stereo(rDPO)) { // make the inverse vertex maps - for(auto &p : products) + for(auto &p: products) p.vertexMap.resize(num_vertices(*p.gPtr)); - for(const auto vSide : asRange(vertices(gRight))) { + for(const auto vSide: asRange(vertices(gRight))) { const auto comp = compMap[get(boost::vertex_index_t(), gRight, vSide)]; auto &p = products[comp]; const auto v = vertexMap[get(boost::vertex_index_t(), gRight, vSide)]; p.vertexMap[get(boost::vertex_index_t(), *p.gPtr, v)] = vSide; } - for(auto &p : products) { + for(auto &p: products) { const auto &lgRight = get_labelled_right(rDPO); assert(has_stereo(lgRight)); const auto vertexMap = [&p](const auto &vProduct) { @@ -288,13 +291,13 @@ std::vector> splitRule(const lib::Rules::LabelledR } // end of stereo prop // wrap them std::vector> right; - for(auto &g : products) { + for(auto &g: products) { // check against the database auto gCand = std::make_unique(std::move(g.gPtr), std::move(g.pStringPtr), std::move(g.pStereoPtr)); std::shared_ptr gWrapped = checkIfNew(std::move(gCand)); // checkIfNew does not add the graph, so we must check against the previous products as well - for(auto gPrev : right) { + for(auto gPrev: right) { const auto ls = mod::LabelSettings(labelType, LabelRelation::Isomorphism, withStereo, LabelRelation::Isomorphism); const bool iso = lib::Graph::Single::isomorphic(gPrev->getGraph(), gWrapped->getGraph(), ls); diff --git a/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp b/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp index d108222..d03c616 100644 --- a/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp +++ b/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp @@ -263,6 +263,7 @@ void Rule::executeImpl(PrintSettings settings, const GraphState &input) { firstGraph, lastGraph, inputRules, getExecutionEnv().graphAsRuleCache, getExecutionEnv().labelSettings, + getExecutionEnv().doRuleIsomorphism, onOutput); if(round != 0) { // in round 0 the inputRules is the actual original input rule, so don't delete it diff --git a/libs/libmod/src/mod/lib/DG/Strategies/Strategy.hpp b/libs/libmod/src/mod/lib/DG/Strategies/Strategy.hpp index ef26122..a2d043f 100644 --- a/libs/libmod/src/mod/lib/DG/Strategies/Strategy.hpp +++ b/libs/libmod/src/mod/lib/DG/Strategies/Strategy.hpp @@ -13,8 +13,8 @@ namespace mod::lib::DG::Strategies { class GraphState; struct ExecutionEnv { - ExecutionEnv(LabelSettings labelSettings, Rules::GraphAsRuleCache &graphAsRuleCache) - : labelSettings(labelSettings), graphAsRuleCache(graphAsRuleCache) {} + ExecutionEnv(LabelSettings labelSettings, bool doRuleIsomorphism, Rules::GraphAsRuleCache &graphAsRuleCache) + : labelSettings(labelSettings), doRuleIsomorphism(doRuleIsomorphism), graphAsRuleCache(graphAsRuleCache) {} virtual ~ExecutionEnv() {}; // May throw LogicError if exists. virtual void tryAddGraph(std::shared_ptr g) = 0; @@ -37,6 +37,7 @@ struct ExecutionEnv { virtual void popRightPredicate() = 0; public: const LabelSettings labelSettings; + const bool doRuleIsomorphism; Rules::GraphAsRuleCache &graphAsRuleCache; }; From 23aee4386abea26e3b8790060ad3fa2f3f77bbc7 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Sat, 15 Jun 2024 10:31:21 +0200 Subject: [PATCH 11/14] [changelog] add missing entry for new constraint --- ChangeLog.rst | 1 + doc/source/graphModel/index.rst | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog.rst b/ChangeLog.rst index 6544f95..47341f6 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -13,6 +13,7 @@ New Features - Added a new documentation section describing rule application constraints: :ref:`rule-constraints`. +- Added a new rule application constraint, :ref:`label-unification-constraint`. Bugs Fixed diff --git a/doc/source/graphModel/index.rst b/doc/source/graphModel/index.rst index 475124f..2397d60 100644 --- a/doc/source/graphModel/index.rst +++ b/doc/source/graphModel/index.rst @@ -277,6 +277,7 @@ Examples Assuming the vertex has ID 42 in the rule, this becomes the following in GML: ``constraintAdj [ id 42 nodeLabels [ label "O" label "S" ] op "=" count 1 ]``. +.. _label-unification-constraint: Label Unification Constraint ---------------------------- From 8929632368bc6c7ead64e017cdacdd3a2a3f602c Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 17 Jun 2024 17:33:55 +0200 Subject: [PATCH 12/14] Update for new version --- .drone.jsonnet | 7 +- .drone.yml | 1560 +++++++++++++---- .github/workflows/Docker.yml | 2 +- CMakeLists.txt | 25 +- ChangeLog.rst | 115 +- cmake/MODUtils.cmake | 2 +- conda/conda_build_config.yaml | 2 +- doc/source/conf.py | 2 +- doc/source/exe/index.rst | 3 +- .../ignore_missing_refs/__init__.py | 2 +- .../bootstrap/layout.html | 3 +- doc/source/formats/dg.rst | 2 +- docker/Arch.Dockerfile | 13 +- docker/Conda.Dockerfile | 5 +- docker/Fedora.Dockerfile | 19 +- docker/Ubuntu.Dockerfile | 7 +- examples/CMakeLists.txt | 27 +- examples/libmod_cmake/CMakeLists.txt | 2 +- examples/py/fileRenames.json | 6 + examples/pymod_extension/CMakeLists.txt | 29 +- external/graph_canon | 2 +- libs/libmod/CMakeLists.txt | 8 - libs/libmod/src/mod/Config.hpp | 66 +- libs/libmod/src/mod/Misc.hpp | 8 +- libs/libmod/src/mod/dg/Builder.cpp | 8 +- libs/libmod/src/mod/dg/DG.cpp | 26 +- libs/libmod/src/mod/dg/GraphInterface.cpp | 25 +- libs/libmod/src/mod/dg/Printer.cpp | 9 + libs/libmod/src/mod/dg/Printer.hpp | 6 +- libs/libmod/src/mod/lib/Chem/SmilesRead.cpp | 6 +- .../src/mod/lib/DG/IO/WriteDerivation.cpp | 2 +- libs/libmod/src/mod/lib/DG/NonHyper.cpp | 2 +- .../libmod/src/mod/lib/DG/NonHyperBuilder.cpp | 12 +- .../src/mod/lib/DG/Strategies/Repeat.cpp | 2 +- .../libmod/src/mod/lib/DG/Strategies/Rule.cpp | 2 +- .../src/mod/lib/Graph/Canonicalisation.cpp | 2 +- libs/libmod/src/mod/lib/Graph/Collection.cpp | 2 +- libs/libmod/src/mod/lib/Graph/IO/Write.cpp | 1 - .../src/mod/lib/Graph/Properties/Term.cpp | 17 +- .../src/mod/lib/Graph/Properties/Term.hpp | 2 + libs/libmod/src/mod/lib/Graph/Single.cpp | 111 +- .../src/mod/lib/GraphMorphism/Finder.hpp | 2 +- libs/libmod/src/mod/lib/GraphPimpl.hpp | 2 +- .../src/mod/lib/RC/ComposeRuleRealGeneric.hpp | 4 +- libs/libmod/src/mod/lib/RC/IO/Write.cpp | 4 +- .../src/mod/lib/RC/MatchMaker/Common.hpp | 2 +- .../lib/RC/MatchMaker/ComponentWiseUtil.hpp | 2 +- .../src/mod/lib/RC/MatchMaker/Super.hpp | 2 +- .../mod/lib/RC/Visitor/MatchConstraints.hpp | 2 +- libs/libmod/src/mod/lib/Rules/IO/Write.cpp | 10 +- libs/libmod/src/mod/lib/Term/IO/Write.cpp | 18 +- libs/libmod/src/mod/rule/Rule.cpp | 12 +- libs/post_mod/share/mod/summary.tex | 2 +- libs/pymod/CMakeLists.txt | 8 - libs/pymod/bin/mod.in | 15 +- libs/pymod/lib/mod/__init__.py | 53 +- libs/pymod/lib/mod/libpymod.pyi | 104 +- libs/pymod/lib/mod/post.pyi | 9 + libs/pymod/share/mod/extra.supp | 7 + libs/pymod/src/mod/py/Collections.cpp | 2 - libs/pymod/src/mod/py/Config.cpp | 25 +- libs/pymod/src/mod/py/Misc.cpp | 2 +- libs/pymod/src/mod/py/Module.cpp | 16 +- libs/pymod/src/mod/py/Post.cpp | 143 +- libs/pymod/src/mod/py/dg/Builder.cpp | 29 +- libs/pymod/src/mod/py/dg/DG.cpp | 36 +- libs/pymod/src/mod/py/dg/GraphInterface.cpp | 36 +- libs/pymod/src/mod/py/dg/Printer.cpp | 29 +- libs/pymod/src/mod/py/dg/VertexMapper.cpp | 6 +- libs/pymod/src/mod/py/rule/Composition.cpp | 2 +- requirements.txt | 2 +- scripts/makePyExamples.py | 2 +- .../project/CMakeLists.txt | 2 +- test/cmake_import/CMakeLists.txt | 13 +- test/cmake_import/project/CMakeLists.txt | 2 +- test/py/DGSmilesProblem.py | 4 +- test/py/derivation.py | 54 + test/py/dg/000_basic.py | 5 +- test/py/dg/001_graphInterface.py | 22 +- test/py/dg/010_find.py | 34 +- test/py/dg/019_dump.py | 8 +- test/py/dg/050_build_addDerivation.py | 6 +- test/py/dg/051_build_addHyperEdge.py | 2 +- test/py/dg/100_build_execute_basic.py | 7 +- test/py/dg/400_printer.py | 10 +- test/py/dg/410_printData.py | 12 +- test/py/dg/450_print_dpo_fail.py | 6 +- test/py/dg/600_vertexMap_basic.py | 2 +- test/py/dg/900_dgDerivations.py | 2 +- test/py/dg/old/dgDiff.py | 24 +- test/py/function.py | 8 +- test/py/graph/850_annotated.py | 20 + test/py/makeReactionSmiles.py | 48 + .../adjacency/90_term_conversion.py | 48 + test/py/matchConstraints/labelAny.py | 4 +- test/py/matchConstraints/shortestPath.py | 8 +- .../17_tetra_icgt/code/310_stereoDpo.py | 4 +- .../17_tetra_icgt/code/320_aconitase.py | 4 +- .../papers/17_tetra_icgt/code/330_tartaric.py | 4 +- test/py/papers/17_tetra_icgt/code/340_tree.py | 4 +- .../17_tetra_icgt/figures/tartaric/doIt.py | 4 +- .../papers/17_tetra_icgt/figures/tree/doIt.py | 4 +- test/py/post.py | 1 - test/py/pppCommon/dgStrict.py | 4 +- test/py/reactionSmilesMake.py | 44 + ...actionSmiles.py => reactionSmilesParse.py} | 7 +- test/py/rule/520_inverse.py | 2 +- test/py/term/makeVars.py | 4 +- test/py/xxx_graphInterface.py | 2 +- 109 files changed, 2170 insertions(+), 1009 deletions(-) create mode 100644 libs/pymod/lib/mod/post.pyi create mode 100644 test/py/graph/850_annotated.py create mode 100644 test/py/makeReactionSmiles.py create mode 100644 test/py/matchConstraints/adjacency/90_term_conversion.py create mode 100644 test/py/reactionSmilesMake.py rename test/py/{parseReactionSmiles.py => reactionSmilesParse.py} (93%) diff --git a/.drone.jsonnet b/.drone.jsonnet index 6e484a6..49737c1 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -1,5 +1,5 @@ local image = "localhost:5000/jla/mod"; -local boostArg(v) = "-DBOOST_ROOT=/opt/boost/%s" % v; +local boostArg(v) = "-DCMAKE_PREFIX_PATH=/opt/boost/%s" % v; local CoverageStep(withCoverage, compiler, boost) = if !withCoverage then [] else [{ name: "coverage", @@ -67,7 +67,8 @@ local Configure(compiler, boost, dep=false) = { "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on %s" % [boostArg(boost)], + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on %s" + % [boostArg(boost)], ], [ if dep then "depends_on"]: [ "bootstrap" ], }; @@ -254,6 +255,6 @@ local Pipeline(withCoverage, compiler, boost) = { ] for boost in [ "1_76_0", "1_77_0", "1_78_0", "1_79_0", "1_80_0", "1_81_0", "1_82_0", "1_83_0", - "1_84_0", + "1_84_0", "1_85_0", ] ] diff --git a/.drone.yml b/.drone.yml index 0cf2ea7..6692cf8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -54,7 +54,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "g++", @@ -156,7 +156,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { "CXX": "g++-9", @@ -168,7 +168,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -247,7 +247,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { "CXX": "g++-9", @@ -259,7 +259,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -338,7 +338,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { "CXX": "g++-9", @@ -350,7 +350,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -429,7 +429,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { "CXX": "g++-9", @@ -441,7 +441,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -520,7 +520,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "g++-9", @@ -532,7 +532,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -611,7 +611,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "g++-9", @@ -623,7 +623,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -702,7 +702,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "g++-9", @@ -714,7 +714,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -793,7 +793,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "g++-9", @@ -805,7 +805,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -884,7 +884,98 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" + ], + "environment": { + "CXX": "g++-9", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-9, Boost 1_85_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "g++-9", @@ -896,7 +987,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -975,7 +1065,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { "CXX": "g++-10", @@ -987,7 +1077,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1066,7 +1156,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { "CXX": "g++-10", @@ -1078,7 +1168,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1157,7 +1247,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { "CXX": "g++-10", @@ -1169,7 +1259,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1248,7 +1338,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { "CXX": "g++-10", @@ -1260,7 +1350,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1339,7 +1429,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "g++-10", @@ -1351,7 +1441,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1430,7 +1520,98 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" + ], + "environment": { + "CXX": "g++-10", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-10, Boost 1_82_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "g++-10", @@ -1442,7 +1623,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1500,12 +1681,780 @@ } } ], - "volumes": [ ] + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-10, Boost 1_83_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" + ], + "environment": { + "CXX": "g++-10", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-10, Boost 1_84_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" + ], + "environment": { + "CXX": "g++-10", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-10, Boost 1_85_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" + ], + "environment": { + "CXX": "g++-10", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-11, Boost 1_76_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" + ], + "environment": { + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-11, Boost 1_77_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" + ], + "environment": { + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-11, Boost 1_78_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" + ], + "environment": { + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-11, Boost 1_79_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" + ], + "environment": { + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ ] +} +--- +{ + "kind": "pipeline", + "name": "g++-11, Boost 1_80_0", + "steps": [ + { + "commands": [ + "git fetch --tags", + "git submodule update --init --recursive", + "./bootstrap.sh" + ], + "image": "localhost:5000/jla/mod", + "name": "bootstrap" + }, + { + "commands": [ + "bindep testing", + "mkdir build", + "cd build", + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" + ], + "environment": { + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "configure" + }, + { + "commands": [ + "cd build", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", + "make" + ], + "image": "localhost:5000/jla/mod", + "name": "build" + }, + { + "commands": [ + "cd build", + "make install" + ], + "image": "localhost:5000/jla/mod", + "name": "install" + }, + { + "commands": [ + "cd build", + "make tests" + ], + "image": "localhost:5000/jla/mod", + "name": "build-test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -E cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test" + }, + { + "commands": [ + "cd build", + "make install", + "cd ../", + "mod -e \"smiles('O').print()\"" + ], + "image": "localhost:5000/jla/mod", + "name": "simple test" + }, + { + "commands": [ + "cd build", + "make install", + "ctest --output-on-failure -R cmake_add_subdirectory_build" + ], + "image": "localhost:5000/jla/mod", + "name": "test subdirectory build", + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + }, + { + "commands": [ + "bindep testing", + "mkdir covBuild", + "cd covBuild", + "cmake ../ -DENABLE_IPO=off -DCMAKE_BUILD_TYPE=OptDebug -DBUILD_TESTING=on -DBUILD_COVERAGE=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", + "make", + "make install", + "make tests", + "make coverage_collect", + "make coverage_build", + "/copyCoverage.sh" + ], + "environment": { + "CTEST_OUTPUT_ON_FAILURE": 1, + "CXX": "g++-11", + "CXXFLAGS": "-Werror" + }, + "image": "localhost:5000/jla/mod", + "name": "coverage", + "volumes": [ + { + "name": "www", + "path": "/www" + } + ], + "when": { + "ref": [ + "refs/heads/develop", + "refs/heads/master", + "refs/tags/v*" + ] + } + } + ], + "volumes": [ + { + "host": { + "path": "/www/results/mod" + }, + "name": "www" + } + ] } --- { "kind": "pipeline", - "name": "g++-10, Boost 1_82_0", + "name": "g++-11, Boost 1_81_0", "steps": [ { "commands": [ @@ -1521,10 +2470,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { - "CXX": "g++-10", + "CXX": "g++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -1533,7 +2482,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1596,7 +2545,7 @@ --- { "kind": "pipeline", - "name": "g++-10, Boost 1_83_0", + "name": "g++-11, Boost 1_82_0", "steps": [ { "commands": [ @@ -1612,10 +2561,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { - "CXX": "g++-10", + "CXX": "g++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -1624,7 +2573,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1687,7 +2636,7 @@ --- { "kind": "pipeline", - "name": "g++-10, Boost 1_84_0", + "name": "g++-11, Boost 1_83_0", "steps": [ { "commands": [ @@ -1703,10 +2652,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { - "CXX": "g++-10", + "CXX": "g++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -1715,7 +2664,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1778,7 +2727,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_76_0", + "name": "g++-11, Boost 1_84_0", "steps": [ { "commands": [ @@ -1794,7 +2743,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "g++-11", @@ -1806,7 +2755,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1869,7 +2818,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_77_0", + "name": "g++-11, Boost 1_85_0", "steps": [ { "commands": [ @@ -1885,7 +2834,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "g++-11", @@ -1897,7 +2846,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -1960,7 +2908,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_78_0", + "name": "g++-12, Boost 1_76_0", "steps": [ { "commands": [ @@ -1976,10 +2924,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -1988,7 +2936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2051,7 +2999,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_79_0", + "name": "g++-12, Boost 1_77_0", "steps": [ { "commands": [ @@ -2067,10 +3015,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2079,7 +3027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2142,7 +3090,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_80_0", + "name": "g++-12, Boost 1_78_0", "steps": [ { "commands": [ @@ -2158,10 +3106,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2170,7 +3118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2226,55 +3174,14 @@ "refs/tags/v*" ] } - }, - { - "commands": [ - "bindep testing", - "mkdir covBuild", - "cd covBuild", - "cmake ../ -DENABLE_IPO=off -DCMAKE_BUILD_TYPE=OptDebug -DBUILD_TESTING=on -DBUILD_COVERAGE=on -DBOOST_ROOT=/opt/boost/1_80_0", - "make", - "make install", - "make tests", - "make coverage_collect", - "make coverage_build", - "/copyCoverage.sh" - ], - "environment": { - "CTEST_OUTPUT_ON_FAILURE": 1, - "CXX": "g++-11", - "CXXFLAGS": "-Werror" - }, - "image": "localhost:5000/jla/mod", - "name": "coverage", - "volumes": [ - { - "name": "www", - "path": "/www" - } - ], - "when": { - "ref": [ - "refs/heads/develop", - "refs/heads/master", - "refs/tags/v*" - ] - } } ], - "volumes": [ - { - "host": { - "path": "/www/results/mod" - }, - "name": "www" - } - ] + "volumes": [ ] } --- { "kind": "pipeline", - "name": "g++-11, Boost 1_81_0", + "name": "g++-12, Boost 1_79_0", "steps": [ { "commands": [ @@ -2290,10 +3197,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2302,7 +3209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2365,7 +3272,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_82_0", + "name": "g++-12, Boost 1_80_0", "steps": [ { "commands": [ @@ -2381,10 +3288,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2393,7 +3300,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2456,7 +3363,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_83_0", + "name": "g++-12, Boost 1_81_0", "steps": [ { "commands": [ @@ -2472,10 +3379,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2484,7 +3391,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2547,7 +3454,7 @@ --- { "kind": "pipeline", - "name": "g++-11, Boost 1_84_0", + "name": "g++-12, Boost 1_82_0", "steps": [ { "commands": [ @@ -2563,10 +3470,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { - "CXX": "g++-11", + "CXX": "g++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2575,7 +3482,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2638,7 +3545,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_76_0", + "name": "g++-12, Boost 1_83_0", "steps": [ { "commands": [ @@ -2654,7 +3561,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "g++-12", @@ -2666,7 +3573,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2729,7 +3636,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_77_0", + "name": "g++-12, Boost 1_84_0", "steps": [ { "commands": [ @@ -2745,7 +3652,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "g++-12", @@ -2757,7 +3664,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2820,7 +3727,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_78_0", + "name": "g++-12, Boost 1_85_0", "steps": [ { "commands": [ @@ -2836,7 +3743,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "g++-12", @@ -2848,7 +3755,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -2911,7 +3817,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_79_0", + "name": "g++-13, Boost 1_76_0", "steps": [ { "commands": [ @@ -2927,10 +3833,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -2939,7 +3845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3002,7 +3908,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_80_0", + "name": "g++-13, Boost 1_77_0", "steps": [ { "commands": [ @@ -3018,10 +3924,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3030,7 +3936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3093,7 +3999,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_81_0", + "name": "g++-13, Boost 1_78_0", "steps": [ { "commands": [ @@ -3109,10 +4015,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3121,7 +4027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3184,7 +4090,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_82_0", + "name": "g++-13, Boost 1_79_0", "steps": [ { "commands": [ @@ -3200,10 +4106,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3212,7 +4118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3275,7 +4181,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_83_0", + "name": "g++-13, Boost 1_80_0", "steps": [ { "commands": [ @@ -3291,10 +4197,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3303,7 +4209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3366,7 +4272,7 @@ --- { "kind": "pipeline", - "name": "g++-12, Boost 1_84_0", + "name": "g++-13, Boost 1_81_0", "steps": [ { "commands": [ @@ -3382,10 +4288,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { - "CXX": "g++-12", + "CXX": "g++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3394,7 +4300,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3457,7 +4363,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_76_0", + "name": "g++-13, Boost 1_82_0", "steps": [ { "commands": [ @@ -3473,7 +4379,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "g++-13", @@ -3485,7 +4391,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3548,7 +4454,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_77_0", + "name": "g++-13, Boost 1_83_0", "steps": [ { "commands": [ @@ -3564,7 +4470,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "g++-13", @@ -3576,7 +4482,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3639,7 +4545,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_78_0", + "name": "g++-13, Boost 1_84_0", "steps": [ { "commands": [ @@ -3655,7 +4561,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "g++-13", @@ -3667,7 +4573,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3730,7 +4636,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_79_0", + "name": "g++-13, Boost 1_85_0", "steps": [ { "commands": [ @@ -3746,7 +4652,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "g++-13", @@ -3758,7 +4664,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3821,7 +4726,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_80_0", + "name": "clang++-11, Boost 1_76_0", "steps": [ { "commands": [ @@ -3837,10 +4742,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "g++-13", + "CXX": "clang++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3849,7 +4754,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -3912,7 +4817,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_81_0", + "name": "clang++-11, Boost 1_77_0", "steps": [ { "commands": [ @@ -3928,10 +4833,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "g++-13", + "CXX": "clang++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -3940,7 +4845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4003,7 +4908,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_82_0", + "name": "clang++-11, Boost 1_78_0", "steps": [ { "commands": [ @@ -4019,10 +4924,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { - "CXX": "g++-13", + "CXX": "clang++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4031,7 +4936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4094,7 +4999,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_83_0", + "name": "clang++-11, Boost 1_79_0", "steps": [ { "commands": [ @@ -4110,10 +5015,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { - "CXX": "g++-13", + "CXX": "clang++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4122,7 +5027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4185,7 +5090,7 @@ --- { "kind": "pipeline", - "name": "g++-13, Boost 1_84_0", + "name": "clang++-11, Boost 1_80_0", "steps": [ { "commands": [ @@ -4201,10 +5106,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { - "CXX": "g++-13", + "CXX": "clang++-11", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4213,7 +5118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4276,7 +5181,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_76_0", + "name": "clang++-11, Boost 1_81_0", "steps": [ { "commands": [ @@ -4292,7 +5197,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "clang++-11", @@ -4304,7 +5209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4367,7 +5272,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_77_0", + "name": "clang++-11, Boost 1_82_0", "steps": [ { "commands": [ @@ -4383,7 +5288,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "clang++-11", @@ -4395,7 +5300,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4458,7 +5363,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_78_0", + "name": "clang++-11, Boost 1_83_0", "steps": [ { "commands": [ @@ -4474,7 +5379,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "clang++-11", @@ -4486,7 +5391,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4549,7 +5454,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_79_0", + "name": "clang++-11, Boost 1_84_0", "steps": [ { "commands": [ @@ -4565,7 +5470,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "clang++-11", @@ -4577,7 +5482,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4640,7 +5545,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_80_0", + "name": "clang++-11, Boost 1_85_0", "steps": [ { "commands": [ @@ -4656,7 +5561,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "clang++-11", @@ -4668,7 +5573,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4731,7 +5635,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_81_0", + "name": "clang++-12, Boost 1_76_0", "steps": [ { "commands": [ @@ -4747,10 +5651,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "clang++-11", + "CXX": "clang++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4759,7 +5663,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4822,7 +5726,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_82_0", + "name": "clang++-12, Boost 1_77_0", "steps": [ { "commands": [ @@ -4838,10 +5742,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "clang++-11", + "CXX": "clang++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4850,7 +5754,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -4913,7 +5817,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_83_0", + "name": "clang++-12, Boost 1_78_0", "steps": [ { "commands": [ @@ -4929,10 +5833,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { - "CXX": "clang++-11", + "CXX": "clang++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -4941,7 +5845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5004,7 +5908,7 @@ --- { "kind": "pipeline", - "name": "clang++-11, Boost 1_84_0", + "name": "clang++-12, Boost 1_79_0", "steps": [ { "commands": [ @@ -5020,10 +5924,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { - "CXX": "clang++-11", + "CXX": "clang++-12", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -5032,7 +5936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5095,7 +5999,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_76_0", + "name": "clang++-12, Boost 1_80_0", "steps": [ { "commands": [ @@ -5111,7 +6015,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "clang++-12", @@ -5123,7 +6027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5186,7 +6090,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_77_0", + "name": "clang++-12, Boost 1_81_0", "steps": [ { "commands": [ @@ -5202,7 +6106,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "clang++-12", @@ -5214,7 +6118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5277,7 +6181,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_78_0", + "name": "clang++-12, Boost 1_82_0", "steps": [ { "commands": [ @@ -5293,7 +6197,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "clang++-12", @@ -5305,7 +6209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5368,7 +6272,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_79_0", + "name": "clang++-12, Boost 1_83_0", "steps": [ { "commands": [ @@ -5384,7 +6288,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "clang++-12", @@ -5396,7 +6300,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5459,7 +6363,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_80_0", + "name": "clang++-12, Boost 1_84_0", "steps": [ { "commands": [ @@ -5475,7 +6379,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "clang++-12", @@ -5487,7 +6391,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5550,7 +6454,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_81_0", + "name": "clang++-12, Boost 1_85_0", "steps": [ { "commands": [ @@ -5566,7 +6470,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "clang++-12", @@ -5578,7 +6482,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5641,7 +6544,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_82_0", + "name": "clang++-13, Boost 1_76_0", "steps": [ { "commands": [ @@ -5657,10 +6560,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "clang++-12", + "CXX": "clang++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -5669,7 +6572,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5732,7 +6635,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_83_0", + "name": "clang++-13, Boost 1_77_0", "steps": [ { "commands": [ @@ -5748,10 +6651,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "clang++-12", + "CXX": "clang++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -5760,7 +6663,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5823,7 +6726,7 @@ --- { "kind": "pipeline", - "name": "clang++-12, Boost 1_84_0", + "name": "clang++-13, Boost 1_78_0", "steps": [ { "commands": [ @@ -5839,10 +6742,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { - "CXX": "clang++-12", + "CXX": "clang++-13", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -5851,7 +6754,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -5914,7 +6817,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_76_0", + "name": "clang++-13, Boost 1_79_0", "steps": [ { "commands": [ @@ -5930,7 +6833,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { "CXX": "clang++-13", @@ -5942,7 +6845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6005,7 +6908,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_77_0", + "name": "clang++-13, Boost 1_80_0", "steps": [ { "commands": [ @@ -6021,7 +6924,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "clang++-13", @@ -6033,7 +6936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6096,7 +6999,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_78_0", + "name": "clang++-13, Boost 1_81_0", "steps": [ { "commands": [ @@ -6112,7 +7015,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "clang++-13", @@ -6124,7 +7027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6187,7 +7090,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_79_0", + "name": "clang++-13, Boost 1_82_0", "steps": [ { "commands": [ @@ -6203,7 +7106,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "clang++-13", @@ -6215,7 +7118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6278,7 +7181,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_80_0", + "name": "clang++-13, Boost 1_83_0", "steps": [ { "commands": [ @@ -6294,7 +7197,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "clang++-13", @@ -6306,7 +7209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6369,7 +7272,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_81_0", + "name": "clang++-13, Boost 1_84_0", "steps": [ { "commands": [ @@ -6385,7 +7288,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "clang++-13", @@ -6397,7 +7300,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6460,7 +7363,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_82_0", + "name": "clang++-13, Boost 1_85_0", "steps": [ { "commands": [ @@ -6476,7 +7379,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "clang++-13", @@ -6488,7 +7391,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6551,7 +7453,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_83_0", + "name": "clang++-14, Boost 1_76_0", "steps": [ { "commands": [ @@ -6567,10 +7469,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "clang++-13", + "CXX": "clang++-14", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -6579,7 +7481,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6642,7 +7544,7 @@ --- { "kind": "pipeline", - "name": "clang++-13, Boost 1_84_0", + "name": "clang++-14, Boost 1_77_0", "steps": [ { "commands": [ @@ -6658,10 +7560,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { - "CXX": "clang++-13", + "CXX": "clang++-14", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -6670,7 +7572,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6733,7 +7635,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_76_0", + "name": "clang++-14, Boost 1_78_0", "steps": [ { "commands": [ @@ -6749,7 +7651,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { "CXX": "clang++-14", @@ -6761,7 +7663,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6824,7 +7726,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_77_0", + "name": "clang++-14, Boost 1_79_0", "steps": [ { "commands": [ @@ -6840,7 +7742,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { "CXX": "clang++-14", @@ -6852,7 +7754,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -6915,7 +7817,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_78_0", + "name": "clang++-14, Boost 1_80_0", "steps": [ { "commands": [ @@ -6931,7 +7833,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "clang++-14", @@ -6943,7 +7845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7006,7 +7908,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_79_0", + "name": "clang++-14, Boost 1_81_0", "steps": [ { "commands": [ @@ -7022,7 +7924,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "clang++-14", @@ -7034,7 +7936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7097,7 +7999,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_80_0", + "name": "clang++-14, Boost 1_82_0", "steps": [ { "commands": [ @@ -7113,7 +8015,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "clang++-14", @@ -7125,7 +8027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7188,7 +8090,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_81_0", + "name": "clang++-14, Boost 1_83_0", "steps": [ { "commands": [ @@ -7204,7 +8106,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "clang++-14", @@ -7216,7 +8118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7279,7 +8181,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_82_0", + "name": "clang++-14, Boost 1_84_0", "steps": [ { "commands": [ @@ -7295,7 +8197,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "clang++-14", @@ -7307,7 +8209,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7370,7 +8272,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_83_0", + "name": "clang++-14, Boost 1_85_0", "steps": [ { "commands": [ @@ -7386,7 +8288,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "clang++-14", @@ -7398,7 +8300,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7461,7 +8362,7 @@ --- { "kind": "pipeline", - "name": "clang++-14, Boost 1_84_0", + "name": "clang++-15, Boost 1_76_0", "steps": [ { "commands": [ @@ -7477,10 +8378,10 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0" ], "environment": { - "CXX": "clang++-14", + "CXX": "clang++-15", "CXXFLAGS": "-Werror" }, "image": "localhost:5000/jla/mod", @@ -7489,7 +8390,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_76_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7552,7 +8453,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_76_0", + "name": "clang++-15, Boost 1_77_0", "steps": [ { "commands": [ @@ -7568,7 +8469,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_76_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0" ], "environment": { "CXX": "clang++-15", @@ -7580,7 +8481,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_76_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_77_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7643,7 +8544,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_77_0", + "name": "clang++-15, Boost 1_78_0", "steps": [ { "commands": [ @@ -7659,7 +8560,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_77_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0" ], "environment": { "CXX": "clang++-15", @@ -7671,7 +8572,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_77_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_78_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7734,7 +8635,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_78_0", + "name": "clang++-15, Boost 1_79_0", "steps": [ { "commands": [ @@ -7750,7 +8651,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_78_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0" ], "environment": { "CXX": "clang++-15", @@ -7762,7 +8663,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_78_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_79_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7825,7 +8726,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_79_0", + "name": "clang++-15, Boost 1_80_0", "steps": [ { "commands": [ @@ -7841,7 +8742,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_79_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0" ], "environment": { "CXX": "clang++-15", @@ -7853,7 +8754,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_79_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_80_0", "make" ], "image": "localhost:5000/jla/mod", @@ -7916,7 +8817,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_80_0", + "name": "clang++-15, Boost 1_81_0", "steps": [ { "commands": [ @@ -7932,7 +8833,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_80_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0" ], "environment": { "CXX": "clang++-15", @@ -7944,7 +8845,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_80_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_81_0", "make" ], "image": "localhost:5000/jla/mod", @@ -8007,7 +8908,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_81_0", + "name": "clang++-15, Boost 1_82_0", "steps": [ { "commands": [ @@ -8023,7 +8924,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_81_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0" ], "environment": { "CXX": "clang++-15", @@ -8035,7 +8936,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_81_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_82_0", "make" ], "image": "localhost:5000/jla/mod", @@ -8098,7 +8999,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_82_0", + "name": "clang++-15, Boost 1_83_0", "steps": [ { "commands": [ @@ -8114,7 +9015,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_82_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0" ], "environment": { "CXX": "clang++-15", @@ -8126,7 +9027,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_82_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_83_0", "make" ], "image": "localhost:5000/jla/mod", @@ -8189,7 +9090,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_83_0", + "name": "clang++-15, Boost 1_84_0", "steps": [ { "commands": [ @@ -8205,7 +9106,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_83_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0" ], "environment": { "CXX": "clang++-15", @@ -8217,7 +9118,7 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_83_0", + "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DCMAKE_PREFIX_PATH=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", @@ -8280,7 +9181,7 @@ --- { "kind": "pipeline", - "name": "clang++-15, Boost 1_84_0", + "name": "clang++-15, Boost 1_85_0", "steps": [ { "commands": [ @@ -8296,7 +9197,7 @@ "bindep testing", "mkdir build", "cd build", - "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DBOOST_ROOT=/opt/boost/1_84_0" + "cmake ../ -DCMAKE_BUILD_TYPE=OptDebug -DENABLE_IPO=off -DBUILD_DOC=on -DBUILD_TESTING=on -DCPLEX_DIR=/opt/ILOG_CPLEX -DWITH_GUROBI=no -DCMAKE_PREFIX_PATH=/opt/boost/1_85_0" ], "environment": { "CXX": "clang++-15", @@ -8308,7 +9209,6 @@ { "commands": [ "cd build", - "cmake ../ -DBUILD_TESTING=on -DBUILD_TESTING_SANITIZERS=off -DBOOST_ROOT=/opt/boost/1_84_0", "make" ], "image": "localhost:5000/jla/mod", diff --git a/.github/workflows/Docker.yml b/.github/workflows/Docker.yml index 0e95505..c4a27b0 100644 --- a/.github/workflows/Docker.yml +++ b/.github/workflows/Docker.yml @@ -61,7 +61,7 @@ jobs: tar -xf boost_1_80_0.tar.gz cd boost_1_80_0 ./bootstrap.sh --with-python=python3 --prefix=/opt/boost - ./b2 -j 2 --with-python --with-graph --with-iostreams ---with-test install + ./b2 -j 2 --with-python --with-graph --with-iostreams --with-test install - name: Bootstrap run: ./bootstrap.sh - name: Configure diff --git a/CMakeLists.txt b/CMakeLists.txt index aebf723..5d34600 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) include(FindPythonModule) include(MODUtils) @@ -53,7 +53,6 @@ option(BUILD_COVERAGE "Enable code coverage." OFF) option(ENABLE_SYMBOL_HIDING "Hide internal symbols in the library." ON) option(ENABLE_DEP_SYMBOL_HIDING "Hide symbols provided by library dependencies." ON) option(ENABLE_IPO "Using link-time optimization." ON) -include(CheckIPOSupported) option(USE_NESTED_GRAPH_CANON "Use the GraphCanon version in external/graph_canon." ON) option(USE_NESTED_NLOHMANN_JSON "Use the nlohmann/json version in external/nlohmann_json." ON) @@ -68,6 +67,19 @@ if(hasParent) set(BUILD_EXAMPLES 0) set(BUILD_TESTING 0) set(BUILD_COVERAGE 0) +else() + set(CMAKE_POLICY_DEFAULT_CMP0069 NEW) + include(CheckIPOSupported) + if(ENABLE_IPO) + check_ipo_supported(RESULT result OUTPUT output) + if(result) + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION TRUE) + else() + message(FATAL_ERROR "Interprocedural optimization was requested ('ENABLE_IPO=on'), but it is not supported: ${output}") + endif() + else() + set(CMAKE_INTERPROCEDURAL_OPTIMIZATION FALSE) + endif() endif() if(NOT BUILD_TESTING) set(BUILD_EXAMPLES OFF) @@ -97,6 +109,7 @@ if(BUILD_PY_MOD) if(Boost_FOUND) find_package(Boost ${v} COMPONENTS ${lib}) set(PYTHON_TARGET ${lib}) + string(APPEND libmod_config_dependencies "find_dependency(Boost ${v} COMPONENTS ${lib})\n") break() endif() endforeach() @@ -110,10 +123,8 @@ if(BUILD_TESTING) else() find_package(Boost ${v} REQUIRED COMPONENTS graph iostreams) endif() -message(STATUS "(Boost include dir is ${Boost_INCLUDE_DIRS})") -string(APPEND libmod_config_dependencies "set(Boost_NO_BOOST_CMAKE ON)\n") -string(APPEND libmod_config_dependencies "set(BOOST_FOUND 0)\n") # TODO: remove when CMake 3.15 is required https://gitlab.kitware.com/cmake/cmake/issues/18590 string(APPEND libmod_config_dependencies "find_dependency(Boost ${v} COMPONENTS graph iostreams)\n") +message(STATUS "(Boost include dir is ${Boost_INCLUDE_DIRS})") # GraphCanon @@ -210,13 +221,11 @@ endif() if(WITH_OPENBABEL) find_package(OpenBabel3 3) if(OpenBabel3_FOUND) - string(APPEND libmod_config_dependencies "set(OpenBabel3_FOUND 0)\n") # TODO: remove with CMake 3.15 is required https://gitlab.kitware.com/cmake/cmake/issues/18590 string(APPEND libmod_config_dependencies "find_dependency(OpenBabel3 3)\n") list(APPEND libmod_config_find_files "FindOpenBabel3.cmake") else() find_package(OpenBabel2 2.3.2) if(OpenBabel2_FOUND) - string(APPEND libmod_config_dependencies "set(OpenBabel2_FOUND 0)\n") # TODO: remove with CMake 3.15 is required https://gitlab.kitware.com/cmake/cmake/issues/18590 string(APPEND libmod_config_dependencies "find_dependency(OpenBabel2 2.3.2)\n") list(APPEND libmod_config_find_files "FindOpenBabel2.cmake") else() @@ -248,6 +257,7 @@ endif() # ------------------------------------------------------------------------- if(BUILD_PY_MOD) find_package(Python3 REQUIRED COMPONENTS Interpreter Development) + string(APPEND libmod_config_dependencies "find_dependency(Python3 REQUIRED COMPONENTS Interpreter Development)\n") endif() @@ -276,6 +286,7 @@ if(BUILD_EPIM) endif() + ########################################################################### # Targets and Artefacts ########################################################################### diff --git a/ChangeLog.rst b/ChangeLog.rst index 47341f6..532317f 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -4,9 +4,29 @@ Changes ####### + develop ======= +Incompatible Changes +-------------------- + +- Several classes have in Python become nested classes and changed name: + + - ``DGVertex`` to :py:class:`DG.Vertex` + - ``DGHyperEdge`` to :py:class:`DG.HyperEdge` + - ``DGVertexRange`` to :py:class:`DG.VertexRange` + - ``DGEdgeRange`` to :py:class:`DG.EdgeRange` + - ``DGInEdgeRange`` to :py:class:`DG.InEdgeRange` + - ``DGOutEdgeRange`` to :py:class:`DG.OutEdgeRange` + - ``DGSourceRange`` to :py:class:`DG.SourceRange` + - ``DGTargetRange`` to :py:class:`DG.TargetRange` + - ``DGRuleRange`` to :py:class:`DG.RuleRange` + - ``DGBuilder`` to :py:class:`DG.Builder` + - ``DGExecuteResult`` to :py:class:`DG.Builder.ExecuteResult` + +- The version requirement for Sphinx has been raised to 7.3. + New Features ------------ @@ -14,15 +34,31 @@ New Features - Added a new documentation section describing rule application constraints: :ref:`rule-constraints`. - Added a new rule application constraint, :ref:`label-unification-constraint`. +- Instead of VF2, use canonicalization when checking for isomorhpism of + :cpp:class:`graph::Graph`/:py:class:`Graph`, when in term mode, + when there are no variables in the attached terms, + thereby speeding up the check. +- Make :cpp:class:`dg::Printer`/:py:class:`DGPrinter` copyable. +- Add optinal callbacks to :cpp:func:`dg::DG::build`/:py:meth:`DG.build`, + to enable real-time status of what is being added. Bugs Fixed ---------- +- Summary generation: fix page numbers to use "of" instead of "af". - Fix adjacency constraint when in term mode and multiple labels in the constraint matches the same label in the candidate graph. - Fix :cpp:func:`rule::Rule::makeInverse`/:py:meth:`Rule.makeInverse` to not crash when the rule has no external IDs recorded. +- Document the value of the default nested + :cpp:class:`graph::Printer`/:py:class:`GraphPrinter` in + :cpp:class:`dg::Printer`/:py:class:`DGPrinter`. +- Clarify what :option:`mod -q` does. +- Actually throw an exception when using + :cpp:func:`dg::DG::Vertex::getGraph`/:py:attr:`DG.Vertex.graph` on a null vertex, + instead of having undefined behaviour. +- Doc, show default arguments for :py:func:`rcEvaluator`. v0.15.0 (2024-01-26) @@ -32,11 +68,11 @@ Incompatible Changes -------------------- - The graphs created by - :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DGBuilder.addAbstract` + :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DG.Builder.addAbstract` will no longer be empty, but have a single vertex with the label set to the identifier given in the description. - Repeated calls to - :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DGBuilder.addAbstract` + :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DG.Builder.addAbstract` will no longer create subnetworks independently, but will act as if a single call was made with a concatenation of the inputs. - CMake, change the option ``BUILD_TESTING_SANITIZERS`` to ``BUILD_WITH_SANITIZERS`` @@ -55,7 +91,7 @@ New Features - Added :envvar:`MOD_DEBUGGER` to overwrite which debugger is invoked. - Added :cpp:func:`graph::Graph::enumerateIsomorphisms`/:py:meth:`Graph.enumerateIsomorphisms`. - Added :cpp:func:`graph::Union::printTermState`/:py:meth:`UnionGraph.printTermState`. -- Added ``verbosity`` argument for :cpp:func:`dg::DG::HyperEdge::print`/:py:meth:`DGHyperEdge.print` for printing debug information. +- Added ``verbosity`` argument for :cpp:func:`dg::DG::HyperEdge::print`/:py:meth:`DG.HyperEdge.print` for printing debug information. - Added ``printStereoWarnings`` flag to several loading functions: - :cpp:func:`graph::Graph::fromGMLString`/:py:meth:`Graph.fromGMLString`/:py:func:`graphGMLString` @@ -163,7 +199,7 @@ New Features - :cpp:func:`graph::Graph::fromSDFileMulti`/:py:func:`Graph.fromSDFileMulti`, - PyMØD: add installation of the bindings via ``pip``. See the setting ``-DBUILD_PY_MOD_PIP=on`` in :ref:`compiling`. -- Added :cpp:func:`dg::Builder::addHyperEdge`/:py:meth:`DGBuilder.addHyperEdge`. +- Added :cpp:func:`dg::Builder::addHyperEdge`/:py:meth:`DG.Builder.addHyperEdge`. - Added :cpp:func:`graph::Printer::setRaiseIsotopes`/:cpp:func:`graph::Printer::getRaiseIsotopes`/:py:attr:`GraphPrinter.raiseIsotopes`. It was previously only available in the internal interface. - Added :cpp:func:`graph::Printer::setWithGraphvizCoords`/:cpp:func:`graph::Printer::getWithGraphvizCoords`/:py:attr:`GraphPrinter.withGraphvizCoords`. @@ -177,19 +213,20 @@ New Features See :ref:`cpp-Post`/:ref:`py-Post`. - Added :cpp:func:`graph::Graph::enumerateMonomorphisms`/:py:meth:`Graph.enumerateMonomorphisms`. - Added :cpp:func:`dg::Printer::setImageOverwrite`/:py:meth:`DGPrinter.setImageOverwrite`. -- Added :cpp:func:`dg::Builder::getDG`/:py:attr:`DGBuilder.dg` and - :py:attr:`DGBuilder.isActive`. +- Added :cpp:func:`dg::Builder::getDG`/:py:attr:`DG.Builder.dg` and + :py:attr:`DG.Builder.isActive`. + Bugs Fixed ---------- - Rule GML loading, check for edges dangling due to wrong vertex membership. -- :cpp:func:`dg::Builder::execute`/:py:meth:`DGBuilder.execute` and - :cpp:func:`dg::Builder::apply`/:py:meth:`DGBuilder.apply`, +- :cpp:func:`dg::Builder::execute`/:py:meth:`DG.Builder.execute` and + :cpp:func:`dg::Builder::apply`/:py:meth:`DG.Builder.apply`, properly ignore direct derivations with empty right-hand sides, instead of crashing. - :cpp:func:`dg::DG::load`/:py:meth:`DG.load` and - :cpp:func:`dg::Builder::load`/:py:meth:`DGBuilder.load`, + :cpp:func:`dg::Builder::load`/:py:meth:`DG.Builder.load`, reenable loading of very old dump formats. - Fix critical bugs in :cpp:class:`rule::CompositionMatch`/:py:class:`RCMatch`. @@ -212,7 +249,7 @@ Bugs Fixed - Py, use :py:func:`inspect.getfullargspec` instead of the deprecated/removed ``inspect.getargspec()``. - ``mod_post`` scrub more unreproducible meta-info from figure PDFs. -- Fix memory leaks in :cpp:func:`dg::Builder::apply`/:py:meth:`DGBuilder.apply`. +- Fix memory leaks in :cpp:func:`dg::Builder::apply`/:py:meth:`DG.Builder.apply`. - Fix colour on changed stereo-information in the right-side graph when printing rules and direct derivations. - Stop recreating vertex-orders for connected components of rule sides, @@ -269,7 +306,7 @@ Incompatible Changes behaviour. - The ``BUILD_DOC`` option for building from source now defaults to ``OFF``. - Add :cpp:class:`rule::CompositionMatch`/:py:class:`RCMatch`. -- The file parameter for :py:func:`DG.load` and :py:func:`DGBuilder.load` +- The file parameter for :py:func:`DG.load` and :py:func:`DG.Builder.load` has been changed name from ``file`` to ``f``. - :py:func:`Graph.fromSMILES` has changed order of parameters, ``add`` is now the last one. @@ -334,7 +371,7 @@ Bugs Fixed :cpp:func:`graph::Graph::fromGMLFile`/:py:func:`Graph.fromGMLFile`, :cpp:func:`rule::Rule::fromGMLFile`/:py:func:`Rule.fromGMLFile`, :cpp:func:`dg::DG::load`/:py:meth:`DG.load`, - :cpp:func:`dg::Builder::load`/:py:meth:`DGBuilder.load`. + :cpp:func:`dg::Builder::load`/:py:meth:`DG.Builder.load`. - Fixes to support Boost 1.76. - Fixes to support GCC 11. - Build system, use ``add_custom_command`` to avoid recompilation of @@ -359,7 +396,7 @@ Other - Doc, properly document that a :py:class:`CWDPath` is a valid argument for - :py:func:`DG.load`, - - :py:func:`DGBuilder.load`, + - :py:func:`DG.Builder.load`, - :py:func:`Graph.fromGMLFile`, and - :py:func:`Rule.fromGMLFile`. - Doc, clarify conditions on methods in :cpp:class:`dg::DG`/:py:class:`DG` @@ -407,12 +444,12 @@ New Features - Update ``bindep.txt`` and :ref:`quick-start` guide for Arch. - Add ``Brewfile`` to to make installation of dependencies much easier on macOS. - Improved verbose output from "add" strategies during - :cpp:func:`dg::Builder::execute`/:py:func:`DGBuilder.execute`. + :cpp:func:`dg::Builder::execute`/:py:func:`DG.Builder.execute`. - Improved rule application performance when evaluating :ref:`rule strategies ` and executing - :cpp:func:`dg::Builder::apply`/:py:meth:`DGBuilder.apply`. + :cpp:func:`dg::Builder::apply`/:py:meth:`DG.Builder.apply`. - Added a relaxed mode to - :cpp:func:`dg::Builder::apply`/:py:meth:`DGBuilder.apply` + :cpp:func:`dg::Builder::apply`/:py:meth:`DG.Builder.apply` via the ``onlyProper`` parameter. - Add missing ``graph`` attributes to vertices and edges of the four graph interfaces of :py:class:`Rule`. @@ -441,7 +478,7 @@ Bugs Fixed ---------- - Flush stdout in the end of - :cpp:func:`dg::ExecuteResult::list`/:py:func:`DGExecuteResult.list`. + :cpp:func:`dg::ExecuteResult::list`/:py:func:`DG.Builder.ExecuteResult.list`. - Fix printing/stringification of a null vertices for :cpp:class:`graph::Graph`/:py:class:`Graph`, :cpp:class:`rule::Rule`/:py:class:`Rule`, @@ -486,11 +523,11 @@ Incompatible Changes :cpp:func:`dg::Printer::pushVertexLabel`/:py:func:`DGPrinter.pushVertexLabel`, and :cpp:func:`dg::Printer::pushVertexColour`/:py:func:`DGPrinter.pushVertexColour` now requies a callback taking a - :cpp:class:`dg::DG::Vertex`/:py:class:`DGVertex`, instead of a + :cpp:class:`dg::DG::Vertex`/:py:class:`DG.Vertex`, instead of a :cpp:class:`graph::Graph`/:py:class:`Graph` and :cpp:class:`dg::DG`/:py:class:`DG`. The previous style is removed in libMØD and deprecated in PyMØD. -- :cpp:func:`dg::DG::HyperEdge::print`/:py:func:`DGHyperEdge.print` +- :cpp:func:`dg::DG::HyperEdge::print`/:py:func:`DG.HyperEdge.print` now throws exceptions if either no rules are associated with the hyperedge or if at least one of the associated rules does not lead to a derivation. - :cpp:class:`dg::PrintData`/:py:class:`DGPrintData`, many interface changes, @@ -506,7 +543,7 @@ Incompatible Changes New Features ------------ -- Added :cpp:func:`dg::Builder::apply`/:py:meth:`DGBuilder.apply` +- Added :cpp:func:`dg::Builder::apply`/:py:meth:`DG.Builder.apply` as a lower-level function for computing proper direct derivations. - :cpp:func:`graph::Graph::fromSMILES`/:py:meth:`smiles`: @@ -527,11 +564,11 @@ New Features - Added :cpp:func:`dg::Printer::setGraphvizPrefix`/:cpp:func:`dg::Printer::getGraphvizPrefix`/:py:attr:`DGPrinter.graphvizPrefix`. - Added ``makeUniqueFilePrefix``/:py:func:`makeUniqueFilePrefix`. - Improve verbosity level 8 information from - :cpp:func:`dg::Builder::execute`/:py:func:`DGBuilder.execute` to the universe + :cpp:func:`dg::Builder::execute`/:py:func:`DG.Builder.execute` to the universe size. - Make :cpp:class:`LabelSettings`/:py:class:`LabelSettings` equality comparable. -- Added :cpp:func:`dg::Builder::load`/:py:func:`DGBuilder.load`. +- Added :cpp:func:`dg::Builder::load`/:py:func:`DG.Builder.load`. - Added :cpp:func:`rngUniformReal`/:py:func:`rngUniformReal`. @@ -542,7 +579,7 @@ Bugs Fixed - :cpp:class:`Derivation`/:py:class:`Derivation` printing. - :cpp:class:`Derivations`/:py:class:`Derivations` printing. - - :cpp:func:`dg::Builder::addDerivation`/:py:meth:`DGBuilder.apply`. + - :cpp:func:`dg::Builder::addDerivation`/:py:meth:`DG.Builder.apply`. - :cpp:func:`dg::Builder::execute` - :cpp:func:`dg::DG::make`/:py:meth:`DG.__init__` - :cpp:func:`dg::DG::findVertex`/:py:meth:`DG.findVertex` @@ -594,7 +631,7 @@ Bugs Fixed - :cpp:func:`dg::DG::print`/:py:meth:`DG.print`, fix missing labels on shortcut edges when using a :cpp:class:`dg::Printer`/:py:class:`DGPrinter` with "labels as Latex math" set to false. -- :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DGBuilder.addAbstract`: +- :cpp:func:`dg::Builder::addAbstract`/:py:meth:`DG.Builder.addAbstract`: - Improve parsing error messages. - Fix assertion on non-ASCII input. @@ -627,8 +664,8 @@ Other - :py:attr:`AtomData.atomId` - :py:attr:`AtomData.isotope` - - :py:attr:`DGVertex.inDegree` - - :py:attr:`DGVertex.outDegree` + - :py:attr:`DG.Vertex.inDegree` + - :py:attr:`DG.Vertex.outDegree` - Doc, various typo fixes. - :ref:`mod `, don't log output when invoked with @@ -663,18 +700,18 @@ Incompatible Changes -------------------- - ``dg::DG::abstract``/``dgAbstract`` has been removed. Use - :cpp:func:`dg::Builder::addAbstract`/:py:func:`DGBuilder.addAbstract` + :cpp:func:`dg::Builder::addAbstract`/:py:func:`DG.Builder.addAbstract` instead. Added slightly better documentation as well, :ref:`dg_abstract-desc`. - ``dg::DG::derivations`` has been removed. Use the repeated calls to :cpp:func:`dg::Builder::addDerivation` instead. - ``dg::DG::ruleComp`` and ``dg::DG::calc()`` has been removed. Use the new :cpp:func:`dg::Builder::execute` instead. - ``dgRuleComp`` and ``DG.calc`` has been deprecated, - and their implementation is now based on :py:meth:`DGBuilder.execute`. - Use :py:meth:`DGBuilder.execute` directly instead. + and their implementation is now based on :py:meth:`DG.Builder.execute`. + Use :py:meth:`DG.Builder.execute` directly instead. - The implementation of ``dgDerivations`` has changed and the function is now deprecated. Use repeated calls to - :py:meth:`DGBuilder.addDerivation` instead. + :py:meth:`DG.Builder.addDerivation` instead. - :cpp:func:`dg::Strategy::makeAdd` overloads, :py:meth:`DGStrat.makeAddStatic`, and :py:meth:`DGStrat.makeAddDynamic` now requires another argument of type @@ -682,7 +719,7 @@ Incompatible Changes - :ref:`strat-addSubset` and :ref:`strat-addUniverse` now accepts a new optional keyword argument ``graphPolicy`` of type :py:class:`IsomorphismPolicy`. - ``dg::DG::list``/``DG.list`` has been removed, - use :cpp:func:`dg::ExecuteResult::list`/:py:meth:`DGExecuteResult.list` + use :cpp:func:`dg::ExecuteResult::list`/:py:meth:`DG.Builder.ExecuteResult.list` instead. - Information from strategies has been updated. @@ -697,7 +734,7 @@ New Features derivation graph with this new interface. - :py:meth:`DG.build`/:cpp:func:`dg::DG::build` for obtaining an RAII-style proxy object for controlling the construction - (:py:class:`DGBuilder`/:cpp:class:`dg::Builder`). + (:py:class:`DG.Builder`/:cpp:class:`dg::Builder`). - :py:attr:`DG.hasActiveBuilder`/:cpp:func:`dg::DG::hasActiveBuilder` - :py:attr:`DG.locked`/:cpp:func:`dg::DG::isLocked` @@ -723,7 +760,7 @@ Bugs Fixed the same time, which prevent MØD from accessing Open Babel operations.. - Document and check proper preconditions on :cpp:class:`dg::DG`/:py:class:`DG`. - Document and check precondition on - :cpp:func:`dg::DG::HyperEdge::getInverse`/:py:attr:`DGHyperEdge.inverse`, + :cpp:func:`dg::DG::HyperEdge::getInverse`/:py:attr:`DG.HyperEdge.inverse`, that it is only avilable after the DG is locked. - Properly throw an exception if :py:meth:`DGStrat.makeSequence`/:cpp:func:`dg::Strategy::makeSequence` @@ -842,7 +879,7 @@ New Features This mirrors the previously added :cpp:any:`graph::Graph::getSmilesWithIds`/:py:obj:`Graph.smilesWithIds`. - Improve error messages from GML parsing of lists. - Changed the return type of :cpp:func:`dg::DG::getGraphDatabase` from a `std::set` to a `std::unordered_set`. -- :cpp:func:`dg::DG::HyperEdge::print`/:py:func:`DGHyperEdge.print` now returns a list of file data. +- :cpp:func:`dg::DG::HyperEdge::print`/:py:func:`DG.HyperEdge.print` now returns a list of file data. - The vertices and edges of all graph interfaces now have a conversion to bool: - :cpp:class:`graph::Graph::Vertex`/:py:class:`Graph.Vertex`, @@ -855,8 +892,8 @@ New Features :cpp:class:`rule::Rule::ContextGraph::Edge`/:py:class:`Rule.ContextGraph.Edge` - :cpp:class:`rule::Rule::RightGraph::Vertex`/:py:class:`Rule.RightGraph.Vertex`, :cpp:class:`rule::Rule::RightGraph::Edge`/:py:class:`Rule.RightGraph.Edge` - - :cpp:class:`dg::DG::Vertex`/:py:class:`DGVertex`, - :cpp:class:`dg::DG::HyperEdge`/:py:class:`DGHyperEdge` + - :cpp:class:`dg::DG::Vertex`/:py:class:`DG.Vertex`, + :cpp:class:`dg::DG::HyperEdge`/:py:class:`DG.HyperEdge` - The vertices of all graph interfaces now have a proper hash support. - Added :cpp:func:`dg::Printer::setRotationOverwrite`/:py:func:`DGPrinter.setRotationOverwrite` @@ -904,7 +941,7 @@ Incompatible Changes `GraphCanon `__ and `PermGroup `__, are now required dependencies. - Sphinx 1.7.1 is now required for building the documentation. -- :cpp:any:`dg::DG::HyperEdge::print`/:py:obj:`DGHyperEdge.print` +- :cpp:any:`dg::DG::HyperEdge::print`/:py:obj:`DG.HyperEdge.print` now also takes an argument for colouring vertices/edges that are not matched by the rule. The default is now that matched vertices/edges are the default colour, while those that are not matched are grey. @@ -1002,7 +1039,7 @@ Incompatible Changes Use the graph interface instead. E.g., - Deprecate ``DerivationRef``. They now interconvert with - :cpp:any:`dg::DG::HyperEdge`/:py:obj:`DGHyperEdge`. + :cpp:any:`dg::DG::HyperEdge`/:py:obj:`DG.HyperEdge`. - Change ``DG::getDerivationRef`` into :cpp:any:`dg::DG::findEdge`/:py:obj:`DG.findEdge`. - Make ``DG.derivations`` return the edges instead in the Python interface. It is removed in the C++ interface. It will be removed from Python in the future. @@ -1023,7 +1060,7 @@ Incompatible Changes the two printers are equal. - :cpp:any:`rule::Rule::print`/:py:obj:`Rule.print`, change the default colours used to indicate changes. Now different colours are used in L, K, R. -- :py:obj:`DGHyperEdge.print`, change the default match colour. +- :py:obj:`DG.HyperEdge.print`, change the default match colour. - Add < operator to vertices and edges of Graph, Rule, and DG. diff --git a/cmake/MODUtils.cmake b/cmake/MODUtils.cmake index f0f82d3..cfff6b9 100644 --- a/cmake/MODUtils.cmake +++ b/cmake/MODUtils.cmake @@ -7,7 +7,7 @@ function(make_py_test fileName testName extraEnv) COMMAND ${CMAKE_INSTALL_FULL_BINDIR}/mod -f ${CMAKE_CURRENT_LIST_DIR}/${fileName}.py WORKING_DIRECTORY ${workDir}) set_tests_properties(${testName} PROPERTIES - ENVIRONMENT "MOD_NUM_POST_THREADS=1;PYTHONWARNINGS=error${extraEnv}") + ENVIRONMENT "MOD_NUM_POST_THREADS=1;MOD_NO_DEPRECATED=1;PYTHONWARNINGS=error${extraEnv}") add_coverage_case(${testName}) endfunction() diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml index b38fafb..43d43e8 100644 --- a/conda/conda_build_config.yaml +++ b/conda/conda_build_config.yaml @@ -8,7 +8,7 @@ python: - 3.11 - 3.12 boost: - - 1.78.0 # currently globally pinned version in conda-forge + - 1.84.0 # currently globally pinned version in conda-forge pin_run_as_build: python: x.x boost: x.x.x diff --git a/doc/source/conf.py b/doc/source/conf.py index 17dd994..e997d17 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -2,7 +2,7 @@ import os # -- General configuration ------------------------------------------------ -needs_sphinx = '3.5.0' +needs_sphinx = '7.3.0' sys.path.insert(0, os.path.abspath('extensions')) extensions = [ diff --git a/doc/source/exe/index.rst b/doc/source/exe/index.rst index a9e99d7..7a2576b 100644 --- a/doc/source/exe/index.rst +++ b/doc/source/exe/index.rst @@ -82,7 +82,8 @@ Execution Customization .. option:: -q - Use quiet mode. Certain messages are not printed. + Do not print messages from the wrapper script and the :py:func:`include` function. + This does not influence the library. .. envvar:: MOD_PYTHON diff --git a/doc/source/extensions/ignore_missing_refs/__init__.py b/doc/source/extensions/ignore_missing_refs/__init__.py index 4a4a93d..b6ee185 100644 --- a/doc/source/extensions/ignore_missing_refs/__init__.py +++ b/doc/source/extensions/ignore_missing_refs/__init__.py @@ -11,7 +11,7 @@ "lib", "boost", ], 'py': [ - "DGRuleRange", "DGSourceRange", "DGTargetRange", "DGOutEdgeRange", "DGInEdgeRange", "DGEdgeRange", "DGVertexRange", + "DG.RuleRange", "DG.SourceRange", "DG.TargetRange", "DG.OutEdgeRange", "DG.InEdgeRange", "DG.EdgeRange", "DG.VertexRange", ], } prefixes = { diff --git a/doc/source/extensions/sphinx_bootstrap_theme/bootstrap/layout.html b/doc/source/extensions/sphinx_bootstrap_theme/bootstrap/layout.html index fae952d..74fb04f 100644 --- a/doc/source/extensions/sphinx_bootstrap_theme/bootstrap/layout.html +++ b/doc/source/extensions/sphinx_bootstrap_theme/bootstrap/layout.html @@ -3,7 +3,7 @@ {% set bootstrap_version, navbar_version = "4.4.1", "" %} {% set bs_span_prefix = "col-md-" %} -{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and sidebars %} +{%- set render_sidebar = False and (not embedded) and (not theme_nosidebar|tobool) and sidebars %} {%- set bs_content_width = render_sidebar and "9" or "12"%} @@ -24,6 +24,7 @@ {%- endmacro %} {%- block extrahead %} + diff --git a/doc/source/formats/dg.rst b/doc/source/formats/dg.rst index 30c37e7..7530d61 100644 --- a/doc/source/formats/dg.rst +++ b/doc/source/formats/dg.rst @@ -19,4 +19,4 @@ Note that the :token:`~dgAbstract:identifier` definition in particular means that whitespace is important between coefficients and identifiers. E.g., ``2 A -> B`` is different from ``2A -> B``. -See also :py:func:`DGBuilder.addAbstract`/:cpp:func:`dg::Builder::addAbstract`. +See also :py:func:`DG.Builder.addAbstract`/:cpp:func:`dg::Builder::addAbstract`. diff --git a/docker/Arch.Dockerfile b/docker/Arch.Dockerfile index 57240c7..b27c3c9 100644 --- a/docker/Arch.Dockerfile +++ b/docker/Arch.Dockerfile @@ -10,16 +10,17 @@ ENV PATH="$VIRTUAL_ENV/bin:$PATH" WORKDIR /opt/mod COPY ./build/mod-*.tar.gz ./ RUN tar xzf mod-*.tar.gz --strip-components=1 -RUN pip install -r requirements_nodoc.txt \ - && pacman -Suy --noconfirm \ - $(bindep -b testing | tr '\n' ' ') \ +RUN pip install -r requirements_nodoc.txt \ + && pacman -Suy --noconfirm \ + $(bindep -b testing | tr '\n' ' ') \ && rm -rf /var/cache/pacman WORKDIR /opt/mod/build ENV CXXFLAGS=-Werror -Wno-error=maybe-uninitialized -RUN cmake ../ -DBUILD_DOC=no \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ +RUN cmake ../ -DBUILD_DOC=no \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" \ + -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ -DBUILD_TESTING=on \ && make -j $j \ && make tests -j $j \ diff --git a/docker/Conda.Dockerfile b/docker/Conda.Dockerfile index b862be5..c9c84ca 100644 --- a/docker/Conda.Dockerfile +++ b/docker/Conda.Dockerfile @@ -35,8 +35,9 @@ WORKDIR /opt/mod/build ENV CXXFLAGS=-Werror RUN conda activate mod-env && conda env list && \ cmake ../ -DBUILD_DOC=no \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" \ + -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ -DBUILD_TESTING=on \ -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX \ && make -j $j \ diff --git a/docker/Fedora.Dockerfile b/docker/Fedora.Dockerfile index a285a12..571ca96 100644 --- a/docker/Fedora.Dockerfile +++ b/docker/Fedora.Dockerfile @@ -5,21 +5,22 @@ WORKDIR /opt/mod COPY ./build/mod-*.tar.gz ./ RUN tar xzf mod-*.tar.gz --strip-components=1 -RUN dnf install -y \ - python3-pip \ - && pip3 install -r requirements_nodoc.txt \ - && dnf install -y \ - $(bindep -b testing | tr '\n' ' ') \ - && dnf clean all \ +RUN dnf install -y \ + python3-pip \ + && pip3 install -r requirements_nodoc.txt \ + && dnf install -y \ + $(bindep -b testing | tr '\n' ' ') \ + && dnf clean all \ && rm -rf /var/cache/yum WORKDIR /opt/mod/build ENV BABEL_LIBDIR=/usr/lib64/openbabel3 ENV CXXFLAGS=-Werror -RUN cmake ../ -DBUILD_DOC=no \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ +RUN cmake ../ -DBUILD_DOC=no \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" \ + -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ -DBUILD_TESTING=on \ && make -j $j \ && make tests -j $j \ diff --git a/docker/Ubuntu.Dockerfile b/docker/Ubuntu.Dockerfile index b36ca53..9e9b736 100644 --- a/docker/Ubuntu.Dockerfile +++ b/docker/Ubuntu.Dockerfile @@ -62,9 +62,10 @@ RUN \ WORKDIR /opt/mod/build ENV CXXFLAGS=-Werror -RUN cmake ../ -DBUILD_DOC=no \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ +RUN cmake ../ -DBUILD_DOC=no \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_MODULE_LINKER_FLAGS="-flto=$j" \ + -DCMAKE_SHARED_LINKER_FLAGS="-flto=$j" \ -DBUILD_TESTING=on \ && make -j $j \ && make tests -j $j \ diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 3c0b00a..c0b9d72 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -8,17 +8,20 @@ set(workDir ${CMAKE_CURRENT_BINARY_DIR}/workDir/libmod_cmake) file(MAKE_DIRECTORY ${workDir}) add_test(NAME example_libmod_cmake_configure COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" - -DBOOST_ROOT=${BOOST_ROOT} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/libmod_cmake WORKING_DIRECTORY ${workDir}) add_test(NAME example_libmod_cmake_build COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${workDir}) -set_tests_properties(example_libmod_cmake_configure PROPERTIES - FIXTURES_SETUP example_libmod_cmake) -set_tests_properties(example_libmod_cmake_build PROPERTIES - FIXTURES_REQUIRED example_libmod_cmake) +add_test(NAME example_libmod_cmake_run + COMMAND ./doStuff + WORKING_DIRECTORY ${workDir}) +set_tests_properties(example_libmod_cmake_configure PROPERTIES FIXTURES_SETUP example_libmod_cmake_build) +set_tests_properties(example_libmod_cmake_build PROPERTIES FIXTURES_REQUIRED example_libmod_cmake_build) +set_tests_properties(example_libmod_cmake_build PROPERTIES FIXTURES_SETUP example_libmod_cmake_run) +set_tests_properties(example_libmod_cmake_run PROPERTIES FIXTURES_REQUIRED example_libmod_cmake_run) # pymod_extension # ============================================================================= @@ -27,8 +30,8 @@ if(BUILD_PY_MOD) file(MAKE_DIRECTORY ${workDir}) add_test(NAME example_pymod_extension_configure COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" - -DBOOST_ROOT=${BOOST_ROOT} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/pymod_extension WORKING_DIRECTORY ${workDir}) add_test(NAME example_pymod_extension_build @@ -37,14 +40,10 @@ if(BUILD_PY_MOD) add_test(NAME example_pymod_extension_run COMMAND ${CMAKE_INSTALL_FULL_BINDIR}/mod -f ${CMAKE_CURRENT_SOURCE_DIR}/pymod_extension/test.py WORKING_DIRECTORY ${workDir}) - set_tests_properties(example_pymod_extension_configure PROPERTIES - FIXTURES_SETUP example_pymod_extension) - set_tests_properties(example_pymod_extension_build PROPERTIES - FIXTURES_REQUIRED example_pymod_extension) - set_tests_properties(example_pymod_extension_build PROPERTIES - FIXTURES_SETUP example_pymod_extension_run) - set_tests_properties(example_pymod_extension_run PROPERTIES - FIXTURES_REQUIRED example_pymod_extension_run) + set_tests_properties(example_pymod_extension_configure PROPERTIES FIXTURES_SETUP example_pymod_extension_build) + set_tests_properties(example_pymod_extension_build PROPERTIES FIXTURES_REQUIRED example_pymod_extension_build) + set_tests_properties(example_pymod_extension_build PROPERTIES FIXTURES_SETUP example_pymod_extension_run) + set_tests_properties(example_pymod_extension_run PROPERTIES FIXTURES_REQUIRED example_pymod_extension_run) endif() # py examples diff --git a/examples/libmod_cmake/CMakeLists.txt b/examples/libmod_cmake/CMakeLists.txt index 5ef885b..be8ccea 100644 --- a/examples/libmod_cmake/CMakeLists.txt +++ b/examples/libmod_cmake/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(LibmodTestProject CXX) diff --git a/examples/py/fileRenames.json b/examples/py/fileRenames.json index 90abd90..56e45bb 100644 --- a/examples/py/fileRenames.json +++ b/examples/py/fileRenames.json @@ -59,5 +59,11 @@ "5004_exec_space_simple.py": "900_epim/4_exec_space_simple.py", "5005_exec_space_recursive.py": "900_epim/5_exec_space_recursive.py", "5006_hospital.py": "900_epim/6_hospital.py" + }, + { + "050_flow/500_basicFlow.py": "050_hyperflow/500_basicFlow.py", + "050_flow/501_extraConstraints.py": "050_hyperflow/501_extraConstraints.py", + "050_flow/502_multipleSolutions.py": "050_hyperflow/502_multipleSolutions.py", + "050_flow/510_autocatalysis.py": "050_hyperflow/510_autocatalysis.py" } ] diff --git a/examples/pymod_extension/CMakeLists.txt b/examples/pymod_extension/CMakeLists.txt index a7175c1..682a26a 100644 --- a/examples/pymod_extension/CMakeLists.txt +++ b/examples/pymod_extension/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake) project(PyModTestProject CXX) @@ -10,38 +10,13 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON) # ------------------------------------------------------------------------- find_package(mod REQUIRED) - -# Boost.Python -# ------------------------------------------------------------------------- -set(v 1.64.0) -foreach(PY 3 37 38 39 310 311 312 313 314 315 316 317 318 319) - set(lib "python${PY}") - find_package(Boost ${v} QUIET COMPONENTS ${lib}) - if(Boost_FOUND) - find_package(Boost ${v} COMPONENTS ${lib}) - set(PYTHON_TARGET ${lib}) - break() - endif() -endforeach() -if(NOT Boost_FOUND) - find_package(Boost ${v} REQUIRED COMPONENTS python3) - message(FATAL_ERROR "Could not find Boost.Python for Python 3. Tried 'python' wih suffixes 3, 37, 38, 39, and 310 to 319.") -endif() - - -# Python 3 -# ------------------------------------------------------------------------- -find_package(Python3 REQUIRED COMPONENTS Interpreter Development) - - # Artefacts # ------------------------------------------------------------------------- - add_library(awesome MODULE pyModule.cpp stuff.cpp) set_target_properties(awesome PROPERTIES PREFIX "") # so it doesn't get the "lib" prefix -target_link_libraries(awesome PUBLIC mod::libmod Boost::${PYTHON_TARGET} Python3::Python) +target_link_libraries(awesome PUBLIC mod::pymodutils) target_compile_options(awesome PRIVATE -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-comment diff --git a/external/graph_canon b/external/graph_canon index 94cee8d..8df2b4b 160000 --- a/external/graph_canon +++ b/external/graph_canon @@ -1 +1 @@ -Subproject commit 94cee8d35854281b3a66480074aeb699bea8ed86 +Subproject commit 8df2b4bb116c3a0e6b688d71763287b49191785c diff --git a/libs/libmod/CMakeLists.txt b/libs/libmod/CMakeLists.txt index c59d482..b6eacd4 100644 --- a/libs/libmod/CMakeLists.txt +++ b/libs/libmod/CMakeLists.txt @@ -79,14 +79,6 @@ if(ENABLE_SYMBOL_HIDING) ) endif() target_compile_definitions(libmod PRIVATE MOD_SOURCE) -if(ENABLE_IPO) - check_ipo_supported(RESULT result OUTPUT output) - if(result) - set_property(TARGET libmod PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) - else() - message(FATAL_ERROR "Interprocedural optimization was requested ('ENABLE_IPO=on'), but it is not supported: ${output}") - endif() -endif() install(TARGETS libmod EXPORT PROJECT_exports diff --git a/libs/libmod/src/mod/Config.hpp b/libs/libmod/src/mod/Config.hpp index 3baffe0..2ba786f 100644 --- a/libs/libmod/src/mod/Config.hpp +++ b/libs/libmod/src/mod/Config.hpp @@ -253,54 +253,13 @@ struct MOD_DECL MDLOptions { Action onUnsupportedQueryBondType = Action::Error; }; + // rst: .. function:: Config &getConfig() // rst: // rst: :returns: the singleton :cpp:class:`Config` instance used by the library. // rst: MOD_DECL Config &getConfig(); -// rst-class: template ConfigSetting -// rst: -// rst: Holds a single option of type :cpp:any:`T`. -// rst-class-start: - -template -struct ConfigSetting { - ConfigSetting(T value, std::string name) : val(std::move(value)), name(std::move(name)) {} - - // rst: .. function:: void set(T value) - // rst: - // rst: Sets the configuration value. - // rst: - void set(T value) { - val = value; - }; - - // rst: .. function:: T get() const - // rst: - // rst: :returns: The configuration value. - // rst: - T get() const { - return val; - } - - // rst: .. function: T &operator()() - // rst: - // rst: Access the value. - // rst: - T &operator()() { - return val; - } - - const std::string &getName() const { - return name; - } -private: - T val; - const std::string name; -}; -// rst-class-end: - // rst-class: Config // rst: // rst: Holds all configuration settings. @@ -331,7 +290,6 @@ struct Config { ((bool, printStats, false)) \ )) \ ((Common, common, \ - ((bool, quiet, false)) \ ((bool, ignoreDeprecation, true)) \ ((unsigned int, numThreads, 1)) \ )) \ @@ -376,37 +334,27 @@ struct Config { Self &operator=(const Self&) = delete; \ BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS)(Self&&) = delete; \ Self &operator=(Self&&) = delete; \ - inline BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS)() : \ - BOOST_PP_SEQ_ENUM(BOOST_PP_SEQ_TRANSFORM(MOD_CONFIG_settingIterCons, \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS), \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 2, tNS)) \ - ) {} \ + inline BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS)() = default; \ + public: \ BOOST_PP_SEQ_FOR_EACH_I(MOD_CONFIG_settingIter, \ BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS), \ BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 2, tNS)) \ } BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 1, tNS); -#define MOD_CONFIG_settingIterCons(rSettting, dataSetting, tSetting) \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting)( \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 2, tSetting), \ - MOD_toString(dataSetting) "::" \ - MOD_toString(BOOST_PP_EXPAND(BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting))) \ - ) - #define MOD_CONFIG_settingIter(rSettting, dataSetting, nSetting, tSetting) \ - ConfigSetting \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting); + BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 0, tSetting) \ + BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting) = \ + BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 2, tSetting); #define MOD_toString(s) MOD_toString1(s) #define MOD_toString1(s) #s BOOST_PP_SEQ_FOR_EACH(MOD_CONFIG_nsIter, ~, MOD_CONFIG_DATA()) -#undef MOD_CONFIG_settingIterCons #undef MOD_CONFIG_settingIter #undef MOD_CONFIG_nsIter }; } // namespace mod -#endif // MOD_CONFIG_HPP +#endif // MOD_CONFIG_HPP \ No newline at end of file diff --git a/libs/libmod/src/mod/Misc.hpp b/libs/libmod/src/mod/Misc.hpp index f0ac7ef..8281a51 100644 --- a/libs/libmod/src/mod/Misc.hpp +++ b/libs/libmod/src/mod/Misc.hpp @@ -1,9 +1,9 @@ -#ifndef MOD_MISC_H -#define MOD_MISC_H +#ifndef MOD_MISC_HPP +#define MOD_MISC_HPP #include -#include #include +#include #include #include @@ -32,4 +32,4 @@ MOD_DECL void printGeometryGraph(); } // namespace mod -#endif /* MOD_MISC_H */ +#endif // MOD_MISC_HPP \ No newline at end of file diff --git a/libs/libmod/src/mod/dg/Builder.cpp b/libs/libmod/src/mod/dg/Builder.cpp index cf11a51..4c5b6e0 100644 --- a/libs/libmod/src/mod/dg/Builder.cpp +++ b/libs/libmod/src/mod/dg/Builder.cpp @@ -64,11 +64,11 @@ DG::HyperEdge Builder::addDerivation(const Derivations &d, IsomorphismPolicy gra return !p; }; if(std::any_of(d.left.begin(), d.left.end(), checkPtr)) - throw LogicError("Derivation has a nullptr in the left side: " + boost::lexical_cast(d)); + throw LogicError("Derivation has a null pointer in the left side: " + boost::lexical_cast(d)); if(std::any_of(d.right.begin(), d.right.end(), checkPtr)) - throw LogicError("Derivation has a nullptr in the right side: " + boost::lexical_cast(d)); + throw LogicError("Derivation has a null pointer in the right side: " + boost::lexical_cast(d)); if(std::any_of(d.rules.begin(), d.rules.end(), checkPtr)) - throw LogicError("Derivation has a nullptr in the rule list: " + boost::lexical_cast(d)); + throw LogicError("Derivation has a null pointer in the rule list: " + boost::lexical_cast(d)); auto innerRes = p->b.addDerivation(d, graphPolicy); return p->dg_->getHyper().getInterfaceEdge(p->dg_->getNonHyper().getHyperEdge(innerRes.first)); } @@ -149,7 +149,7 @@ void Builder::load(const std::vector> &ruleDatabase, if(std::any_of(ruleDatabase.begin(), ruleDatabase.end(), [](const auto &r) { return !r; })) { - throw LogicError("Nullptr in rule database."); + throw LogicError("Null pointer in rule database."); } std::ostringstream err; diff --git a/libs/libmod/src/mod/dg/DG.cpp b/libs/libmod/src/mod/dg/DG.cpp index 29899ad..d1d7805 100644 --- a/libs/libmod/src/mod/dg/DG.cpp +++ b/libs/libmod/src/mod/dg/DG.cpp @@ -104,7 +104,7 @@ DG::EdgeRange DG::edges() const { DG::Vertex DG::findVertex(std::shared_ptr g) const { if(!(hasActiveBuilder() || isLocked())) throw LogicError("The DG neither has an active builder nor is locked yet."); - if(!g) throw LogicError("The graph is a nullptr."); + if(!g) throw LogicError("The graph is a null pointer."); const auto &dg = getHyper(); const auto v = dg.getVertexOrNullFromGraph(&g->getGraph()); return dg.getInterfaceVertex(v); @@ -118,16 +118,16 @@ DG::HyperEdge DG::findEdge(const std::vector &sources, const std::vector const auto vs = vertices(dg).first; std::vector vSources, vTargets; for(auto v : sources) { - if(v.isNull()) throw LogicError("Source vertex descriptor is null."); + if(v.isNull()) throw LogicError("Source vertex is null."); if(v.getDG() != getNonHyper().getAPIReference()) - throw LogicError("Source vertex descriptor does not belong to this derivation graph: " + throw LogicError("Source vertex does not belong to this derivation graph: " + boost::lexical_cast(v)); vSources.push_back(vs[v.getId()]); } for(auto v : targets) { - if(v.isNull()) throw LogicError("Target vertex descriptor is null."); + if(v.isNull()) throw LogicError("Target vertex is null."); if(v.getDG() != getNonHyper().getAPIReference()) - throw LogicError("Target vertex descriptor does not belong to this derivation graph: " + throw LogicError("Target vertex does not belong to this derivation graph: " + boost::lexical_cast(v)); vTargets.push_back(vs[v.getId()]); } @@ -140,8 +140,14 @@ DG::HyperEdge DG::findEdge(const std::vector > &so if(!(hasActiveBuilder() || isLocked())) throw LogicError("The DG neither has an active builder nor is locked yet."); std::vector vSources, vTargets; - for(auto g : sources) vSources.push_back(findVertex(g)); - for(auto g : targets) vTargets.push_back(findVertex(g)); + for(auto g : sources) { + if(!g) throw LogicError("Source graph is a null pointer."); + vSources.push_back(findVertex(g)); + } + for(auto g : targets) { + if(!g) throw LogicError("Target graph is a null pointer."); + vTargets.push_back(findVertex(g)); + } return findEdge(vSources, vTargets); } @@ -226,7 +232,7 @@ std::shared_ptr DG::make(LabelSettings labelSettings, if(std::any_of(graphDatabase.begin(), graphDatabase.end(), [](const auto &g) { return !g; })) - throw LogicError("Nullptr in graph database."); + throw LogicError("Null pointer in graph database."); auto dgInternal = std::make_unique(labelSettings, graphDatabase, graphPolicy); return wrapIt(new DG(std::move(dgInternal))); } @@ -245,12 +251,12 @@ std::shared_ptr DG::load(const std::vector> &g if(std::any_of(graphDatabase.begin(), graphDatabase.end(), [](const auto &g) { return !g; })) { - throw LogicError("Nullptr in graph database."); + throw LogicError("Null pointer in graph database."); } if(std::any_of(ruleDatabase.begin(), ruleDatabase.end(), [](const auto &r) { return !r; })) { - throw LogicError("Nullptr in rule database."); + throw LogicError("Null pointer in rule database."); } std::ostringstream err; diff --git a/libs/libmod/src/mod/dg/GraphInterface.cpp b/libs/libmod/src/mod/dg/GraphInterface.cpp index 0728c73..1d73cf4 100644 --- a/libs/libmod/src/mod/dg/GraphInterface.cpp +++ b/libs/libmod/src/mod/dg/GraphInterface.cpp @@ -28,11 +28,12 @@ DG::InEdgeRange DG::Vertex::inEdges() const { } DG::OutEdgeRange DG::Vertex::outEdges() const { - if(!g) throw LogicError("Can not get in-edges on a null vertex."); + if(!g) throw LogicError("Can not get out-edges on a null vertex."); return OutEdgeRange(g, vId); } std::shared_ptr DG::Vertex::getGraph() const { + if(!g) throw LogicError("Can not get graph on a null vertex."); const auto &hyper = g->getHyper(); const auto v = hyper.getInternalVertex(*this); return hyper.getGraph()[v].graph->getAPIReference(); @@ -100,7 +101,7 @@ bool DG::HyperEdge::isNull() const { } std::size_t DG::HyperEdge::getId() const { - if(isNull()) throw LogicError("Can not get id on a null hyperedge."); + if(isNull()) throw LogicError("Can not get ID on a null hyperedge."); const auto &dg = g->getHyper().getGraph(); using boost::vertices; auto v = *std::next(vertices(dg).first, eId); @@ -108,42 +109,42 @@ std::size_t DG::HyperEdge::getId() const { } std::shared_ptr DG::HyperEdge::getDG() const { - if(isNull()) throw LogicError("Can not get derivation graph on a null hyperedge."); + if(isNull()) throw LogicError("Can not get DG on a null hyperedge."); return g; } std::size_t DG::HyperEdge::numSources() const { - if(isNull()) throw LogicError("Can not get number of sources on a null edge."); + if(isNull()) throw LogicError("Can not get number of sources on a null hyperedge."); const auto &dg = g->getHyper(); const auto v = dg.getInternalVertex(*this); return in_degree(v, dg.getGraph()); } DG::SourceRange DG::HyperEdge::sources() const { - if(isNull()) throw LogicError("Can not get sources on a null edge."); + if(isNull()) throw LogicError("Can not get sources on a null hyperedge."); return SourceRange(g, eId); } std::size_t DG::HyperEdge::numTargets() const { - if(isNull()) throw LogicError("Can not get number of targets on a null edge."); + if(isNull()) throw LogicError("Can not get number of targets on a null hyperedge."); const auto &dg = g->getHyper(); const auto v = dg.getInternalVertex(*this); return out_degree(v, dg.getGraph()); } DG::TargetRange DG::HyperEdge::targets() const { - if(isNull()) throw LogicError("Can not get targets on a null edge."); + if(isNull()) throw LogicError("Can not get targets on a null hyperedge."); return TargetRange(g, eId); } DG::RuleRange DG::HyperEdge::rules() const { - if(isNull()) throw LogicError("Can not get rules on a null edge."); + if(isNull()) throw LogicError("Can not get rules on a null hyperedge."); return RuleRange(*this); } DG::HyperEdge DG::HyperEdge::getInverse() const { - if(isNull()) throw LogicError("Can not get inverse of null edge."); - if(!getDG()->isLocked()) throw LogicError("Can not get inverse edge before the DG is locked."); + if(isNull()) throw LogicError("Can not get inverse on a null hyperedge."); + if(!getDG()->isLocked()) throw LogicError("Can not get inverse before the DG is locked."); const auto &dg = g->getHyper(); const auto v = dg.getInternalVertex(*this); return dg.getInterfaceEdge(dg.getReverseEdge(v)); @@ -152,8 +153,8 @@ DG::HyperEdge DG::HyperEdge::getInverse() const { std::vector > DG::HyperEdge::print(const graph::Printer &printer, const std::string &nomatchColour, const std::string &matchColour, int verbosity) const { - if(isNull()) throw LogicError("Can not print null edge."); - if(rules().size() == 0) throw LogicError("The edge has no rules."); + if(isNull()) throw LogicError("Can not print a null hyperedge."); + if(rules().size() == 0) throw LogicError("The hyperedge has no rules."); const auto &dg = g->getHyper(); const auto v = dg.getInternalVertex(*this); return lib::DG::Write::summaryDerivation(g->getNonHyper(), v, printer.getOptions(), nomatchColour, matchColour, diff --git a/libs/libmod/src/mod/dg/Printer.cpp b/libs/libmod/src/mod/dg/Printer.cpp index c2b6ca0..210e7db 100644 --- a/libs/libmod/src/mod/dg/Printer.cpp +++ b/libs/libmod/src/mod/dg/Printer.cpp @@ -119,6 +119,15 @@ Printer::Printer() : graphPrinter(std::make_unique()), Printer::~Printer() = default; +Printer::Printer(const Printer &other) : graphPrinter(std::make_unique(*other.graphPrinter)), + printer(std::make_unique(*other.printer)) {} + +Printer &Printer::operator=(const Printer &other) { + *graphPrinter = *other.graphPrinter; + *printer = *other.printer; + return *this; +} + lib::DG::Write::Printer &Printer::getPrinter() const { return *printer; } diff --git a/libs/libmod/src/mod/dg/Printer.hpp b/libs/libmod/src/mod/dg/Printer.hpp index b741df2..8f858ba 100644 --- a/libs/libmod/src/mod/dg/Printer.hpp +++ b/libs/libmod/src/mod/dg/Printer.hpp @@ -98,14 +98,16 @@ struct MOD_DECL PrintData { // rst-class-start: struct MOD_DECL Printer { Printer(); - Printer(const Printer &) = delete; - Printer &operator=(const Printer &) = delete; + Printer(const Printer &other); + Printer &operator=(const Printer &other); ~Printer(); lib::DG::Write::Printer &getPrinter() const; // rst: .. function:: graph::Printer &getGraphPrinter() // rst: const graph::Printer &getGraphPrinter() const // rst: // rst: :returns: a reference to the :class:`graph::Printer` used for graphs in vertices of the DG. + // rst: The initial :class:`graph::Printer` has :func:`graph::Printer::enableAll` called, + // rst: and then indices are removed (:texpr:`graph::Printer::setWithIndex(false)`). graph::Printer &getGraphPrinter(); const graph::Printer &getGraphPrinter() const; // rst: .. function:: void setWithShortcutEdges(bool value) diff --git a/libs/libmod/src/mod/lib/Chem/SmilesRead.cpp b/libs/libmod/src/mod/lib/Chem/SmilesRead.cpp index 03b5f09..e2b0c11 100644 --- a/libs/libmod/src/mod/lib/Chem/SmilesRead.cpp +++ b/libs/libmod/src/mod/lib/Chem/SmilesRead.cpp @@ -619,7 +619,7 @@ struct Converter { assert(!a.isImplicit); std::string label = a.symbol; if(a.class_ != -1) { - if(getConfig().graph.appendSmilesClass.get()) { + if(getConfig().graph.appendSmilesClass) { label += ":"; label += boost::lexical_cast(a.class_); } @@ -651,7 +651,7 @@ struct Converter { } if(a.radical) label += '.'; if(a.class_ != -1) { - if(getConfig().graph.appendSmilesClass.get()) { + if(getConfig().graph.appendSmilesClass) { label += ":"; label += boost::lexical_cast(a.class_); } @@ -885,7 +885,7 @@ parseSmiles(lib::IO::Warnings &warnings, const bool printStereoWarnings, } catch(const lib::IO::ParsingError &e) { return lib::IO::Result<>::Error(e.msg); } - if(getConfig().graph.smilesCheckAST.get()) { + if(getConfig().graph.smilesCheckAST) { std::stringstream astStr; astStr << ast; if(smiles != astStr.str()) { diff --git a/libs/libmod/src/mod/lib/DG/IO/WriteDerivation.cpp b/libs/libmod/src/mod/lib/DG/IO/WriteDerivation.cpp index 49dddfa..29ee61b 100644 --- a/libs/libmod/src/mod/lib/DG/IO/WriteDerivation.cpp +++ b/libs/libmod/src/mod/lib/DG/IO/WriteDerivation.cpp @@ -130,7 +130,7 @@ summaryDerivation(const NonHyper &dg, const lib::Rules::Real &rLower, const lib::Rules::GraphType &gUpper, const lib::Rules::GraphType &gLower, const auto &m, const std::string &strMatch) { - if(!getConfig().dg.dryDerivationPrinting.get()) { + if(!getConfig().dg.dryDerivationPrinting) { if(first) printHeader(); first = false; diff --git a/libs/libmod/src/mod/lib/DG/NonHyper.cpp b/libs/libmod/src/mod/lib/DG/NonHyper.cpp index 5c8a6a4..19d8c47 100644 --- a/libs/libmod/src/mod/lib/DG/NonHyper.cpp +++ b/libs/libmod/src/mod/lib/DG/NonHyper.cpp @@ -38,7 +38,7 @@ NonHyper::NonHyper(LabelSettings labelSettings, const std::vector > &graphDatabase, IsomorphismPolicy graphPolicy) : id(nextDGNum++), labelSettings(labelSettings), - graphDatabase(labelSettings, getConfig().graph.isomorphismAlg.get()) { + graphDatabase(labelSettings, getConfig().graph.isomorphismAlg) { switch(graphPolicy) { case IsomorphismPolicy::TrustMe: for(const auto &gCand : graphDatabase) { diff --git a/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp b/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp index 6947fdf..622a308 100644 --- a/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp +++ b/libs/libmod/src/mod/lib/DG/NonHyperBuilder.cpp @@ -185,7 +185,7 @@ struct NonHyperBuilder::ExecutionEnv final : public Strategies::ExecutionEnv { ExecuteResult Builder::execute(std::unique_ptr strategy_, int verbosity, bool ignoreRuleLabelTypes) { - const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding; NonHyperBuilder::StrategyExecution exec{ std::make_unique(*dg, dg->getLabelSettings(), doRuleIsomorphism, dg->graphAsRuleCache), @@ -236,7 +236,7 @@ std::vector> Builder::apply(const std::vector> &graphs, std::shared_ptr rOrig, int verbosity, IsomorphismPolicy graphPolicy) { - const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding; IO::Logger logger(std::cout); dg->rules.insert(rOrig); switch(graphPolicy) { @@ -251,7 +251,7 @@ Builder::apply(const std::vector> &graphs, } if(verbosity >= V_RuleApplication) { - logger.indent() << "Binding " << graphs.size() << " graphs to rule '" << rOrig->getName() << "' with " + logger.indent() << "Apply: Binding " << graphs.size() << " graphs to rule '" << rOrig->getName() << "' with " << rOrig->getNumLeftComponents() << " left-hand components." << std::endl; ++logger.indentLevel; } @@ -272,7 +272,7 @@ Builder::apply(const std::vector> &graphs, for(int round = 0; round != libGraphs.size(); ++round) { const auto onOutput = [ isLast = round + 1 == libGraphs.size(), - assumeConfluence = getConfig().dg.applyAssumeConfluence.get(), + assumeConfluence = getConfig().dg.applyAssumeConfluence, &resultRules] (IO::Logger logger, BoundRule br) -> bool { if(isLast) { @@ -316,7 +316,7 @@ Builder::apply(const std::vector> &graphs, std::vector> res; for(const BoundRule &br: resultRules) { - if(getConfig().dg.applyLimit.get() == res.size()) break; + if(getConfig().dg.applyLimit == res.size()) break; const auto &r = *br.rule; assert(r.isOnlyRightSide()); @@ -358,7 +358,7 @@ std::vector> Builder::applyRelaxed(const std::vector> &graphs, std::shared_ptr rOrig, int verbosity, IsomorphismPolicy graphPolicy) { - const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding.get(); + const bool doRuleIsomorphism = getConfig().dg.doRuleIsomorphismDuringBinding; IO::Logger logger(std::cout); dg->rules.insert(rOrig); switch(graphPolicy) { diff --git a/libs/libmod/src/mod/lib/DG/Strategies/Repeat.cpp b/libs/libmod/src/mod/lib/DG/Strategies/Repeat.cpp index eb7252c..9ebbe52 100644 --- a/libs/libmod/src/mod/lib/DG/Strategies/Repeat.cpp +++ b/libs/libmod/src/mod/lib/DG/Strategies/Repeat.cpp @@ -86,7 +86,7 @@ void Repeat::executeImpl(PrintSettings settings, const GraphState &input) { settings.indent() << "Round " << (i + 1) << ": Breaking repeat due to empty subset." << std::endl; break; } - if(!getConfig().dg.disableRepeatFixedPointCheck.get()) { + if(!getConfig().dg.disableRepeatFixedPointCheck) { if(i > 0) { if(subStrats.back()->getOutput() == subStrats[i - 1]->getOutput()) { if(settings.verbosity >= PrintSettings::V_RepeatBreak) diff --git a/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp b/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp index d03c616..f6460af 100644 --- a/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp +++ b/libs/libmod/src/mod/lib/DG/Strategies/Rule.cpp @@ -116,7 +116,7 @@ void handleBoundRulePair(int verbosity, IO::Logger logger, Context context, cons } } { // now the derivation is good, so add the products to output - if(getConfig().dg.putAllProductsInSubset.get()) { + if(getConfig().dg.putAllProductsInSubset) { for(const auto &g: d.right) context.output->addToSubset(&g->getGraph()); } else { diff --git a/libs/libmod/src/mod/lib/Graph/Canonicalisation.cpp b/libs/libmod/src/mod/lib/Graph/Canonicalisation.cpp index 14e72be..3117875 100644 --- a/libs/libmod/src/mod/lib/Graph/Canonicalisation.cpp +++ b/libs/libmod/src/mod/lib/Graph/Canonicalisation.cpp @@ -551,7 +551,7 @@ auto getCanonForm(const Single &g, EdgeHandler eHandler, LabelType labelType, bo auto res = can(graph, idx, vLess, vis); std::vector perm = std::move(res.first); const auto &stats = get(graph_canon::stats_visitor::result_t(), res.second); - if(getConfig().canon.printStats.get()) { + if(getConfig().canon.printStats) { // std::ofstream tree("tree.dot"); // graph_canonicalization::stats_visitor stats(&tree); // canon_permutation = can(getGraph(), idx, vLess, diff --git a/libs/libmod/src/mod/lib/Graph/Collection.cpp b/libs/libmod/src/mod/lib/Graph/Collection.cpp index 351e979..645bda0 100644 --- a/libs/libmod/src/mod/lib/Graph/Collection.cpp +++ b/libs/libmod/src/mod/lib/Graph/Collection.cpp @@ -32,7 +32,7 @@ struct Collection::Store { const bool iso = lib::Graph::Single::isomorphic(*g, *gCand, ls); if(iso) return gCand->getAPIReference(); // if iso: - // if(getConfig().dg.calculateDetailsVerbose.get()) { + // if(getConfig().dg.calculateDetailsVerbose) { // std::cout << "Discarding product " << gCand->getName() << ", isomorphic to " << g->getName() << std::endl; // std::cout << "\tLabelSettings: withStereo=" << std::boolalpha << this->labelSettings.withStereo << std::endl; // mod::postSection("Discarded"); diff --git a/libs/libmod/src/mod/lib/Graph/IO/Write.cpp b/libs/libmod/src/mod/lib/Graph/IO/Write.cpp index edfcd51..b59b1a1 100644 --- a/libs/libmod/src/mod/lib/Graph/IO/Write.cpp +++ b/libs/libmod/src/mod/lib/Graph/IO/Write.cpp @@ -601,7 +601,6 @@ void termStateImpl(const std::string &name, const LGraph &g) { } lib::Term::Write::wam(getMachine(termState), lib::Term::getStrings(), IO::Logger(s), [&](Address addr, std::ostream &s) { - s << " "; bool first = true; for(const auto &str: annotations[addr]) { if(!first) s << ", "; diff --git a/libs/libmod/src/mod/lib/Graph/Properties/Term.cpp b/libs/libmod/src/mod/lib/Graph/Properties/Term.cpp index a2f4dd5..6b77a46 100644 --- a/libs/libmod/src/mod/lib/Graph/Properties/Term.cpp +++ b/libs/libmod/src/mod/lib/Graph/Properties/Term.cpp @@ -14,7 +14,8 @@ PropTerm::PropTerm(const GraphType &g, const PropString &pString, const StringSt // take every unique string and parse it std::unordered_map labelToAddress; lib::Term::RawAppendStore varToAddr; - const auto handleLabel = [&stringStore, &labelToAddress, &varToAddr, this](const std::string &label) -> std::size_t { + const auto handleLabel = [&stringStore, &labelToAddress, &varToAddr, this]( + const std::string &label) -> std::size_t { // if there is a * in the label, then we can not just use label caching if(label.find('*') == std::string::npos) { auto iter = labelToAddress.find(label); @@ -33,19 +34,29 @@ PropTerm::PropTerm(const GraphType &g, const PropString &pString, const StringSt return addr.addr; }; this->vertexState.resize(num_vertices(g)); - for(Vertex v : asRange(vertices(g))) { + for(Vertex v: asRange(vertices(g))) { std::size_t vId = get(boost::vertex_index_t(), *this->g, v); assert(vId < this->vertexState.size()); this->vertexState[vId] = handleLabel(pString[v]); } this->edgeState.reserve(num_edges(g)); - for(Edge e : asRange(edges(g))) { + for(Edge e: asRange(edges(g))) { assert(get(boost::edge_index_t(), g, e) == this->edgeState.size()); this->edgeState.push_back(handleLabel(pString[e])); } + for(const auto &c: machine.getHeap()) { + if(c.tag == Term::Cell::Tag::REF) { + hasVariables = true; + break; + } + } verify(this->g); } +bool PropTerm::getHasVariables() const { + return hasVariables; +} + const std::string &PropTerm::getParsingError() const { assert(!isValid(*this)); return *parsingError; diff --git a/libs/libmod/src/mod/lib/Graph/Properties/Term.hpp b/libs/libmod/src/mod/lib/Graph/Properties/Term.hpp index 4ca9823..d7e8e26 100644 --- a/libs/libmod/src/mod/lib/Graph/Properties/Term.hpp +++ b/libs/libmod/src/mod/lib/Graph/Properties/Term.hpp @@ -14,12 +14,14 @@ struct PropTerm : Prop { using Base = Prop; public: PropTerm(const GraphType &g, const PropString &pString, const StringStore &stringStore); // parse-construct + bool getHasVariables() const; const std::string &getParsingError() const; // requires !isValid friend bool isValid(const PropTerm &p); friend const lib::Term::Wam &getMachine(const PropTerm &p); private: std::optional parsingError; lib::Term::Wam machine; + bool hasVariables = false; }; } // namespace mod::lib::Graph diff --git a/libs/libmod/src/mod/lib/Graph/Single.cpp b/libs/libmod/src/mod/lib/Graph/Single.cpp index 0e999c04..49addab 100644 --- a/libs/libmod/src/mod/lib/Graph/Single.cpp +++ b/libs/libmod/src/mod/lib/Graph/Single.cpp @@ -136,7 +136,7 @@ const std::string &Single::getGraphDFSWithIds() const { const std::string &Single::getSmiles() const { if(getMoleculeState().getIsMolecule()) { if(!smiles) { - if(getConfig().graph.useWrongSmilesCanonAlg.get()) { + if(getConfig().graph.useWrongSmilesCanonAlg) { smiles = Chem::getSmiles(getGraph(), getMoleculeState(), nullptr, false); } else { getCanonForm(LabelType::String, false); // TODO: make the withStereo a parameter @@ -147,7 +147,7 @@ const std::string &Single::getSmiles() const { } else { std::string text; text += "Graph " + boost::lexical_cast(getId()) + " with name '" + getName() + - "' is not a molecule.\n"; + "' is not a molecule.\n"; text += "Can not generate SMILES string. GraphDFS is\n\t" + getGraphDFS().first + "\n"; throw LogicError(std::move(text)); } @@ -156,7 +156,7 @@ const std::string &Single::getSmiles() const { const std::string &Single::getSmilesWithIds() const { if(getMoleculeState().getIsMolecule()) { if(!smilesWithIds) { - if(getConfig().graph.useWrongSmilesCanonAlg.get()) { + if(getConfig().graph.useWrongSmilesCanonAlg) { smilesWithIds = Chem::getSmiles(getGraph(), getMoleculeState(), nullptr, true); } else { getCanonForm(LabelType::String, false); // TODO: make the withStereo a parameter @@ -167,7 +167,7 @@ const std::string &Single::getSmilesWithIds() const { } else { std::string text; text += "Graph " + boost::lexical_cast(getId()) + " with name '" + getName() + - "' is not a molecule.\n"; + "' is not a molecule.\n"; text += "Can not generate SMILES string. GraphDFS is\n\t" + getGraphDFS().first + "\n"; throw LogicError(std::move(text)); } @@ -227,7 +227,7 @@ const Single::CanonForm &Single::getCanonForm(LabelType labelType, bool withSter if(!canon_form_string) { assert(!aut_group_string); std::tie(canon_perm_string, canon_form_string, aut_group_string) = lib::Graph::getCanonForm(*this, labelType, - withStereo); + withStereo); } assert(canon_form_string); assert(aut_group_string); @@ -250,20 +250,20 @@ namespace GM_MOD = lib::GraphMorphism; template void morphism(const Single &gDomain, - const Single &gCodomain, - LabelSettings labelSettings, - Finder finder, - Callback callback) { + const Single &gCodomain, + LabelSettings labelSettings, + Finder finder, + Callback callback) { lib::GraphMorphism::morphismSelectByLabelSettings(gDomain.getLabelledGraph(), gCodomain.getLabelledGraph(), - labelSettings, finder, callback); + labelSettings, finder, callback); } template std::size_t morphismMax(const Single &gDomain, - const Single &gCodomain, - std::size_t maxNumMatches, - LabelSettings labelSettings, - Finder finder) { + const Single &gCodomain, + std::size_t maxNumMatches, + LabelSettings labelSettings, + Finder finder) { auto mr = GM::makeLimit(maxNumMatches); morphism(gDomain, gCodomain, labelSettings, finder, std::ref(mr)); return mr.getNumHits(); @@ -275,13 +275,20 @@ std::size_t isomorphismSmilesOrCanonOrVF2(const Single &gDom, const Single &gCod // first try if we can compare canonical SMILES strings if(!labelSettings.withStereo && get_molecule(ggDom).getIsMolecule() && get_molecule(ggCodom).getIsMolecule() - && !getConfig().graph.useWrongSmilesCanonAlg.get()) + && !getConfig().graph.useWrongSmilesCanonAlg) return gDom.getSmiles() == gCodom.getSmiles() ? 1 : 0; // otherwise maybe we can still do canonical form comparison - if(labelSettings.type == LabelType::String && !labelSettings.withStereo - && get_molecule(ggDom).getHasOnlyChemicalBonds() && get_molecule(ggCodom).getHasOnlyChemicalBonds()) { - return canonicalCompare(gDom, gCodom, labelSettings.type, labelSettings.withStereo) ? 1 : 0; + if(!labelSettings.withStereo + && get_molecule(ggDom).getHasOnlyChemicalBonds() + && get_molecule(ggCodom).getHasOnlyChemicalBonds()) { + if(labelSettings.type == LabelType::String) { + return canonicalCompare(gDom, gCodom, labelSettings.type, false) ? 1 : 0; + } else { + assert(labelSettings.type == LabelType::Term); + if(!get_term(ggDom).getHasVariables() && !get_term(ggCodom).getHasVariables()) + return canonicalCompare(gDom, gCodom, LabelType::String, false) ? 1 : 0; + } } // otherwise, we have no choice but to use VF2 @@ -291,34 +298,34 @@ std::size_t isomorphismSmilesOrCanonOrVF2(const Single &gDom, const Single &gCod } // namespace std::size_t Single::isomorphismVF2(const Single &gDom, const Single &gCodom, std::size_t maxNumMatches, - LabelSettings labelSettings) { + LabelSettings labelSettings) { return morphismMax(gDom, gCodom, maxNumMatches, labelSettings, GM_MOD::VF2Isomorphism()); } bool Single::isomorphic(const Single &gDom, const Single &gCodom, LabelSettings labelSettings) { - ++getConfig().graph.numIsomorphismCalls(); + ++getConfig().graph.numIsomorphismCalls; const auto nDom = num_vertices(gDom.getGraph()); const auto nCodom = num_vertices(gCodom.getGraph()); if(nDom != nCodom) return false; // early bail-out if(&gDom == &gCodom) return true; - switch(getConfig().graph.isomorphismAlg.get()) { - case Config::IsomorphismAlg::SmilesCanonVF2: - return isomorphismSmilesOrCanonOrVF2(gDom, gCodom, labelSettings); - case Config::IsomorphismAlg::VF2: - return isomorphismVF2(gDom, gCodom, 1, labelSettings); - case Config::IsomorphismAlg::Canon: - if(labelSettings.relation != LabelRelation::Isomorphism) - throw LogicError("Can only do isomorphism via canonicalisation with the isomorphism relation."); - if(labelSettings.withStereo && labelSettings.stereoRelation != LabelRelation::Isomorphism) - throw LogicError("Can only do isomorphism via canonicalisation with the isomorphism stereo relation."); - return canonicalCompare(gDom, gCodom, labelSettings.type, labelSettings.withStereo); + switch(getConfig().graph.isomorphismAlg) { + case Config::IsomorphismAlg::SmilesCanonVF2: + return isomorphismSmilesOrCanonOrVF2(gDom, gCodom, labelSettings); + case Config::IsomorphismAlg::VF2: + return isomorphismVF2(gDom, gCodom, 1, labelSettings); + case Config::IsomorphismAlg::Canon: + if(labelSettings.relation != LabelRelation::Isomorphism) + throw LogicError("Can only do isomorphism via canonicalisation with the isomorphism relation."); + if(labelSettings.withStereo && labelSettings.stereoRelation != LabelRelation::Isomorphism) + throw LogicError("Can only do isomorphism via canonicalisation with the isomorphism stereo relation."); + return canonicalCompare(gDom, gCodom, labelSettings.type, labelSettings.withStereo); } MOD_ABORT; } std::size_t Single::isomorphism(const Single &gDom, const Single &gCodom, std::size_t maxNumMatches, LabelSettings labelSettings) { - ++getConfig().graph.numIsomorphismCalls(); + ++getConfig().graph.numIsomorphismCalls; if(maxNumMatches == 1) return isomorphic(gDom, gCodom, labelSettings) ? 1 : 0; // this hax with name comparing is basically to make abstract derivation graphs @@ -339,7 +346,7 @@ Single::monomorphism(const Single &gDom, const Single &gCodom, std::size_t maxNu namespace { auto makeMorphismEnumerationCallback(const Single &gDom, const Single &gCodom, - std::function)> callback) { + std::function)> callback) { return GM::makeSliceProps( // Slice away the properties for now GM::makeTransform( GM::ToInvertibleVectorVertexMap(), @@ -374,17 +381,17 @@ auto makeMorphismEnumerationCallback(const Single &gDom, const Single &gCodom, } // namespace void Single::enumerateIsomorphisms(const Single &gDom, const Single &gCodom, - std::function)> callback, - LabelSettings labelSettings) { + std::function)> callback, + LabelSettings labelSettings) { morphism(gDom, gCodom, labelSettings, GM_MOD::VF2Isomorphism(), - makeMorphismEnumerationCallback(gDom, gCodom, callback)); + makeMorphismEnumerationCallback(gDom, gCodom, callback)); } void Single::enumerateMonomorphisms(const Single &gDom, const Single &gCodom, - std::function)> callback, - LabelSettings labelSettings) { + std::function)> callback, + LabelSettings labelSettings) { morphism(gDom, gCodom, labelSettings, GM_MOD::VF2Monomorphism(), - makeMorphismEnumerationCallback(gDom, gCodom, callback)); + makeMorphismEnumerationCallback(gDom, gCodom, callback)); } bool Single::nameLess(const Single *g1, const Single *g2) { @@ -403,22 +410,22 @@ Single makePermutation(const Single &g) { // throw mod::FatalError("Can not (yet) permute graphs with stereo information."); std::unique_ptr pString; auto gBoost = lib::makePermutedGraph(g.getGraph(), - [&pString](GraphType &gNew) { - pString.reset(new PropString(gNew)); - }, - [&g, &pString](Vertex vOld, const GraphType &gOld, Vertex vNew, - GraphType &gNew) { - pString->addVertex(vNew, g.getStringState()[vOld]); - }, - [&g, &pString](Edge eOld, const GraphType &gOld, Edge eNew, GraphType &gNew) { - pString->addEdge(eNew, g.getStringState()[eOld]); - } + [&pString](GraphType &gNew) { + pString.reset(new PropString(gNew)); + }, + [&g, &pString](Vertex vOld, const GraphType &gOld, Vertex vNew, + GraphType &gNew) { + pString->addVertex(vNew, g.getStringState()[vOld]); + }, + [&g, &pString](Edge eOld, const GraphType &gOld, Edge eNew, GraphType &gNew) { + pString->addEdge(eNew, g.getStringState()[eOld]); + } ); Single gPerm(std::move(gBoost), std::move(pString), nullptr); - if(getConfig().graph.checkIsoInPermutation.get()) { + if(getConfig().graph.checkIsoInPermutation) { const bool iso = 1 == Single::isomorphismVF2(g, gPerm, 1, - {LabelType::String, LabelRelation::Isomorphism, false, - LabelRelation::Isomorphism}); + {LabelType::String, LabelRelation::Isomorphism, false, + LabelRelation::Isomorphism}); if(!iso) { Write::Options graphLike, molLike; graphLike.EdgesAsBonds(true).RaiseCharges(true).CollapseHydrogens(true).WithIndex(true); diff --git a/libs/libmod/src/mod/lib/GraphMorphism/Finder.hpp b/libs/libmod/src/mod/lib/GraphMorphism/Finder.hpp index 325cf44..e3303b9 100644 --- a/libs/libmod/src/mod/lib/GraphMorphism/Finder.hpp +++ b/libs/libmod/src/mod/lib/GraphMorphism/Finder.hpp @@ -94,7 +94,7 @@ struct DefaultFinderArgsProvider { template friend std::vector::vertex_descriptor> get_vertex_order(const DefaultFinderArgsProvider &, const Graph &g) { - if(getConfig().graph.vf2UseOrigVertexOrder.get()) + if(getConfig().graph.vf2UseOrigVertexOrder) return jla_boost::GraphMorphism::vertex_order_by_mult(g); else return vertex_order_by_max_connectivity(g); diff --git a/libs/libmod/src/mod/lib/GraphPimpl.hpp b/libs/libmod/src/mod/lib/GraphPimpl.hpp index 5cbfab8..af06f1c 100644 --- a/libs/libmod/src/mod/lib/GraphPimpl.hpp +++ b/libs/libmod/src/mod/lib/GraphPimpl.hpp @@ -86,7 +86,7 @@ bool GraphClass::Vertex::isNull() const { #define MOD_GRAPHPIMPL_Define_Vertex_id(GraphClass, getMacroGraph) \ \ std::size_t GraphClass::Vertex::getId() const { \ - if(!*this) throw LogicError("Can not get id on a null vertex."); \ + if(!*this) throw LogicError("Can not get ID on a null vertex."); \ const auto &graph = getMacroGraph; \ using boost::vertices; \ auto v = *std::next(vertices(graph).first, vId); \ diff --git a/libs/libmod/src/mod/lib/RC/ComposeRuleRealGeneric.hpp b/libs/libmod/src/mod/lib/RC/ComposeRuleRealGeneric.hpp index f778dd3..f66ee75 100644 --- a/libs/libmod/src/mod/lib/RC/ComposeRuleRealGeneric.hpp +++ b/libs/libmod/src/mod/lib/RC/ComposeRuleRealGeneric.hpp @@ -103,7 +103,7 @@ struct MatchMakerCallback { logger.indent() << "RuleComp\t" << rResult->getName() << "\t= " << rFirst.getName() << "\t. " << rSecond.getName() << std::endl; - if(getConfig().rc.printMatches.get()) { + if(getConfig().rc.printMatches) { RC::Write::test(rFirst, rSecond, m, *rResult); } const bool cont = rr(std::move(rResult)); @@ -128,7 +128,7 @@ void composeRuleRealByMatchMakerGeneric(const lib::Rules::Real &rFirst, MatchMaker mm, std::function)> rr, LabelSettings labelSettings) { - if(getConfig().rc.printMatches.get()) + if(getConfig().rc.printMatches) IO::post() << "summarySection \"RC Matches\"\n"; mm.makeMatches(rFirst, rSecond, detail::MatchMakerCallback(rr), labelSettings); } diff --git a/libs/libmod/src/mod/lib/RC/IO/Write.cpp b/libs/libmod/src/mod/lib/RC/IO/Write.cpp index 9a65ac9..0440992 100644 --- a/libs/libmod/src/mod/lib/RC/IO/Write.cpp +++ b/libs/libmod/src/mod/lib/RC/IO/Write.cpp @@ -66,7 +66,7 @@ std::string pdf(const Evaluator &rc) { void test(const lib::Rules::Real &rFirst, const lib::Rules::Real &rSecond, const CoreCoreMap &match, const lib::Rules::Real &rNew) { - if(getConfig().rc.printMatchesOnlyHaxChem.get()) { + if(getConfig().rc.printMatchesOnlyHaxChem) { const auto &lg = get_labelled_left(rNew.getDPORule()); const auto &g = get_graph(lg); const auto &mol = get_molecule(lg); @@ -110,7 +110,7 @@ void test(const lib::Rules::Real &rFirst, const lib::Rules::Real &rSecond, const Rules::Write::Options options; options.CollapseHydrogens(true); options.EdgesAsBonds(true); - if(getConfig().rc.matchesWithIndex.get()) + if(getConfig().rc.matchesWithIndex) options.WithIndex(true); const auto visible = [](CoreVertex) { return true; diff --git a/libs/libmod/src/mod/lib/RC/MatchMaker/Common.hpp b/libs/libmod/src/mod/lib/RC/MatchMaker/Common.hpp index 9198b96..8fda18b 100644 --- a/libs/libmod/src/mod/lib/RC/MatchMaker/Common.hpp +++ b/libs/libmod/src/mod/lib/RC/MatchMaker/Common.hpp @@ -40,7 +40,7 @@ struct Common { if(labelSettings.withStereo && labelSettings.stereoRelation == LabelRelation::Specialisation) { MOD_ABORT; } - if(getConfig().rc.useBoostCommonSubgraph.get()) { + if(getConfig().rc.useBoostCommonSubgraph) { lib::GraphMorphism::morphismSelectByLabelSettings( lgDom, lgCodom, labelSettings, lib::GraphMorphism::CommonSubgraphFinder(maximum, connected), diff --git a/libs/libmod/src/mod/lib/RC/MatchMaker/ComponentWiseUtil.hpp b/libs/libmod/src/mod/lib/RC/MatchMaker/ComponentWiseUtil.hpp index 95357a0..7aa226b 100644 --- a/libs/libmod/src/mod/lib/RC/MatchMaker/ComponentWiseUtil.hpp +++ b/libs/libmod/src/mod/lib/RC/MatchMaker/ComponentWiseUtil.hpp @@ -91,7 +91,7 @@ struct RuleRuleComponentMonomorphism { LabelSettings labelSettings, bool verbose, IO::Logger &logger) : rsDom(rsDom), rsCodom(rsCodom), enforceConstraints(enforceConstraints), labelSettings(labelSettings), - verbose(verbose), logger(logger), haxMorphismLimit(getConfig().rc.componentWiseMorphismLimit.get()) {} + verbose(verbose), logger(logger), haxMorphismLimit(getConfig().rc.componentWiseMorphismLimit) {} std::vector operator()(const std::size_t idDom, const std::size_t idCodom) const { const auto doIt = [this, idDom, idCodom](auto mrStore) { diff --git a/libs/libmod/src/mod/lib/RC/MatchMaker/Super.hpp b/libs/libmod/src/mod/lib/RC/MatchMaker/Super.hpp index 616be02..6e3f643 100644 --- a/libs/libmod/src/mod/lib/RC/MatchMaker/Super.hpp +++ b/libs/libmod/src/mod/lib/RC/MatchMaker/Super.hpp @@ -92,7 +92,7 @@ struct Super { auto maybeMap = matchFromPosition(rFirst, rSecond, position); if(!maybeMap) { if(verbosity >= V_MorphismGen) - std::cout << "Super: matchFromPosition returned none." << std::endl; + logger.indent() << "Super: matchFromPosition returned none." << std::endl; continue; } auto map = *std::move(maybeMap); diff --git a/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp b/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp index f2eab9a..9f55da4 100644 --- a/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp +++ b/libs/libmod/src/mod/lib/RC/Visitor/MatchConstraints.hpp @@ -234,7 +234,7 @@ struct MatchConstraints : Null { assert(&dpoFirst == &rFirst.getRule()); assert(&dpoSecond == &rSecond.getRule()); - if(!getConfig().rc.composeConstraints.get()) return true; + if(!getConfig().rc.composeConstraints) return true; for(const auto &cFirst: get_match_constraints(get_labelled_left(rFirst))) { detail::ConvertFirst visitor(rFirst, result); diff --git a/libs/libmod/src/mod/lib/Rules/IO/Write.cpp b/libs/libmod/src/mod/lib/Rules/IO/Write.cpp index e440797..7fc4e68 100644 --- a/libs/libmod/src/mod/lib/Rules/IO/Write.cpp +++ b/libs/libmod/src/mod/lib/Rules/IO/Write.cpp @@ -346,7 +346,7 @@ struct OpenBabelCoordsCacheEntry { bool disallowHydrogenCollapseByChangeThenCallback(const Real &r, const CombinedVertex vCG, std::function disallowCollapse) { - if(getConfig().rule.collapseChangedHydrogens.get()) + if(getConfig().rule.collapseChangedHydrogens) return disallowCollapse(vCG); const auto &gCombined = r.getDPORule().getRule().getCombinedGraph(); // if we are changed, then disallow @@ -678,7 +678,7 @@ tikz(const std::string &fileCoordsNoExt, const Real &r, unsigned int idOffset, c const auto &g = getL(rDPO); const auto &depict = r.getDepictionData().getLeft(); const auto adv = AdvOptionsSide(r, idOffset, args, disallowCollapse, - getConfig().rule.changeColourL.get(), + getConfig().rule.changeColourL, g, getMorL(rDPO), rDPO.getLtoCG(), r.getDepictionData().getLeft(), get_labelled_left(r.getDPORule())); @@ -695,7 +695,7 @@ tikz(const std::string &fileCoordsNoExt, const Real &r, unsigned int idOffset, c EdgeVisible(const Real &r) : r(&r) {} bool operator()(const CombinedEdge e) const { - if(getConfig().rule.printChangedEdgesInContext.get()) return true; + if(getConfig().rule.printChangedEdgesInContext) return true; return !get_string(r->getDPORule()).isChanged(e); } private: @@ -703,7 +703,7 @@ tikz(const std::string &fileCoordsNoExt, const Real &r, unsigned int idOffset, c }; boost::filtered_graph gFiltered(g, EdgeVisible(r)); const auto adv = AdvOptionsK(r, idOffset, args, disallowCollapse, - getConfig().rule.changeColourK.get()); + getConfig().rule.changeColourK); IO::Graph::Write::tikz(s, options, gFiltered, depict, fileCoords, adv, jla_boost::Nop<>(), ""); } { // right @@ -711,7 +711,7 @@ tikz(const std::string &fileCoordsNoExt, const Real &r, unsigned int idOffset, c const auto &g = getR(rDPO); const auto &depict = r.getDepictionData().getRight(); const auto adv = AdvOptionsSide(r, idOffset, args, disallowCollapse, - getConfig().rule.changeColourR.get(), + getConfig().rule.changeColourR, g, getMorR(rDPO), rDPO.getRtoCG(), r.getDepictionData().getRight(), get_labelled_right(r.getDPORule())); diff --git a/libs/libmod/src/mod/lib/Term/IO/Write.cpp b/libs/libmod/src/mod/lib/Term/IO/Write.cpp index fc3953a..47eec87 100644 --- a/libs/libmod/src/mod/lib/Term/IO/Write.cpp +++ b/libs/libmod/src/mod/lib/Term/IO/Write.cpp @@ -4,9 +4,8 @@ #include #include -#include - #include +#include namespace mod::lib::Term::Write { namespace { @@ -51,18 +50,21 @@ std::ostream &rawTerm(const RawTerm &term, const StringStore &strings, std::ostr } std::ostream &element(Cell cell, const StringStore &strings, std::ostream &s) { + std::ostringstream res; switch(cell.tag) { case Cell::Tag::STR: - return s << "STR " << cell.STR.addr; + res << "STR " << cell.STR.addr; + break; case Cell::Tag::Structure: - s << strings.getString(cell.Structure.name); + res << strings.getString(cell.Structure.name); if(cell.Structure.arity > 0) - s << "/" << cell.Structure.arity; - return s; + res << "/" << cell.Structure.arity; + break; case Cell::Tag::REF: - return s << "REF " << cell.REF.addr; + res << "REF " << cell.REF.addr; } - __builtin_unreachable(); + s << std::setw(10) << res.str(); + return s; } void wam(const Wam &machine, const StringStore &strings, IO::Logger logger) { diff --git a/libs/libmod/src/mod/rule/Rule.cpp b/libs/libmod/src/mod/rule/Rule.cpp index 64ec9a3..0951d14 100644 --- a/libs/libmod/src/mod/rule/Rule.cpp +++ b/libs/libmod/src/mod/rule/Rule.cpp @@ -78,7 +78,7 @@ Rule::RightGraph Rule::getRight() const { std::shared_ptr Rule::makeInverse() const { lib::Rules::LabelledRule dpoRule(getRule().getDPORule(), true); - if(getConfig().rule.ignoreConstraintsDuringInversion.get()) { + if(getConfig().rule.ignoreConstraintsDuringInversion) { if(get_match_constraints(get_labelled_left(dpoRule)).size() > 0 || get_match_constraints(get_labelled_right(dpoRule)).size() > 0) { std::cout << "WARNING: inversion of rule strips constraints.\n"; @@ -92,10 +92,10 @@ std::shared_ptr Rule::makeInverse() const { } } dpoRule.invert(); - const bool ignore = getConfig().rule.ignoreConstraintsDuringInversion.get(); + const bool ignore = getConfig().rule.ignoreConstraintsDuringInversion; if(ignore) dpoRule.rightData.matchConstraints.clear(); auto rInner = std::make_unique(std::move(dpoRule), getLabelType()); - rInner->setName(this->getName() +", inverse"); + rInner->setName(this->getName() + ", inverse"); if(p->externalToInternalIds) return makeRule(std::move(rInner), *p->externalToInternalIds); else @@ -228,7 +228,7 @@ std::shared_ptr handleLoadedRule(lib::IO::Result d assert(data.rule->pString); if(invert) { if(!get_match_constraints(get_labelled_left(*data.rule)).empty()) { - const bool ignore = getConfig().rule.ignoreConstraintsDuringInversion.get(); + const bool ignore = getConfig().rule.ignoreConstraintsDuringInversion; std::string msg = "The rule '"; if(data.name) msg += *data.name; else msg += "anon"; @@ -236,9 +236,7 @@ std::shared_ptr handleLoadedRule(lib::IO::Result d msg += dataSource; msg += " has matching constraints "; if(!ignore) { - msg += "and can not be reversed. Use "; - msg += getConfig().rule.ignoreConstraintsDuringInversion.getName(); - msg += " == true to strip constraints."; + msg += "and can not be reversed. Use config.rule.ignoreConstraintsDuringInversion == True to strip constraints."; throw InputError(std::move(msg)); } else { msg += "and these will be stripped from the reversed rule."; diff --git a/libs/post_mod/share/mod/summary.tex b/libs/post_mod/share/mod/summary.tex index 31b6af3..10299e9 100644 --- a/libs/post_mod/share/mod/summary.tex +++ b/libs/post_mod/share/mod/summary.tex @@ -50,7 +50,7 @@ \fancyhead[OR]{} \fancyfoot[OL]{} \fancyfoot[OC]{} -\fancyfoot[OR]{Page \thepage\ af \pageref{LastPage}} +\fancyfoot[OR]{Page \thepage\ of \pageref{LastPage}} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt} \renewcommand{\footruleskip}{.3\normalbaselineskip} diff --git a/libs/pymod/CMakeLists.txt b/libs/pymod/CMakeLists.txt index 3d163d0..47f5172 100644 --- a/libs/pymod/CMakeLists.txt +++ b/libs/pymod/CMakeLists.txt @@ -30,14 +30,6 @@ set_target_properties(pymod PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN ON) target_compile_definitions(pymod PRIVATE PYMOD_SOURCE) -if(ENABLE_IPO) - check_ipo_supported(RESULT result OUTPUT output) - if(result) - set_property(TARGET pymod PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) - else() - message(FATAL_ERROR "Interprocedural optimization was requested ('ENABLE_IPO=on'), but it is not supported: ${output}") - endif() -endif() install(TARGETS pymod EXPORT PROJECT_exports diff --git a/libs/pymod/bin/mod.in b/libs/pymod/bin/mod.in index ba65678..3efd68a 100755 --- a/libs/pymod/bin/mod.in +++ b/libs/pymod/bin/mod.in @@ -13,7 +13,8 @@ function printHelp { echo " Execution Customization Options" echo "" echo " -i Enter interactive mode after execution, and disable the log." - echo " -q Use quiet mode." + echo " -q Do not print messages from this script and the include()-function." + echo " This does not influence the library." echo "" echo " Post-processing Options" echo "" @@ -320,10 +321,10 @@ mod.includedFiles = set() def include(fName, checkDup=True, putDup=True, skipDup=True): t = fName.rpartition("/") if(fName != prefixFilename(fName)): - if not mod.config.common.quiet: + if not _modWrapperScriptQuiet: print("Executing code from '", fName, "' ('", prefixFilename(fName), "')", sep="") else: - if not mod.config.common.quiet: + if not _modWrapperScriptQuiet: print("Executing code from '", fName, "'", sep="") fPrefixed = prefixFilename(fName) skip = False @@ -340,7 +341,7 @@ def include(fName, checkDup=True, putDup=True, skipDup=True): if t[1] != "": pushFilePrefix(t[0] + t[1]) if skip: - if not mod.config.common.quiet: + if not _modWrapperScriptQuiet: print("Skipping inclusion (already included)") else: with open(fPrefixed, 'rb') as f: @@ -348,7 +349,7 @@ def include(fName, checkDup=True, putDup=True, skipDup=True): exec(code, globals()) if t[1] != "": popFilePrefix() - if not mod.config.common.quiet: + if not _modWrapperScriptQuiet: if(fName != prefixFilename(fName)): print("End of code from '", fName, "' ('", prefixFilename(fName), "')", sep="") else: @@ -376,7 +377,9 @@ EOF echo '# From command line arguments' >> $pyFile if test "$quiet" = "true"; then - echo "config.common.quiet = True" >> $pyFile + echo "_modWrapperScriptQuiet = True" >> $pyFile + else + echo "_modWrapperScriptQuiet = False" >> $pyFile fi while [ "$1" ]; do case $1 in diff --git a/libs/pymod/lib/mod/__init__.py b/libs/pymod/lib/mod/__init__.py index b24b444..5a4c131 100644 --- a/libs/pymod/lib/mod/__init__.py +++ b/libs/pymod/lib/mod/__init__.py @@ -14,6 +14,7 @@ sys.setdlopenflags(_oldFlags | ctypes.RTLD_GLOBAL) from . import libpymod from .libpymod import * +from . import post sys.setdlopenflags(_oldFlags) # from http://mail.python.org/pipermail/tutor/2003-November/026645.html @@ -62,9 +63,13 @@ def _fixClass(name: str, c: Any, indent: int) -> None: if a[0] == "__class__": continue _fixClass(a[0], a[1], indent + 1) -classes = inspect.getmembers(libpymod, inspect.isclass) -for c in classes: - _fixClass(c[0], c[1], 0) +def _fixModule(modObj): + classes = inspect.getmembers(modObj, inspect.isclass) + for c in classes: + _fixClass(c[0], c[1], 0) + +_fixModule(libpymod) +_fixModule(post) #---------------------------------------------------------- @@ -280,8 +285,8 @@ def _DG_print(self: DG, printer: Optional[DGPrinter] = None, data: Optional[DGPr _DG_findEdge_orig = DG.findEdge def _DG_findEdge(self: DG, - srcsI: Union[Sequence[Graph], Sequence[DGVertex]], - tarsI: Union[Sequence[Graph], Sequence[DGVertex]]) -> DGHyperEdge: + srcsI: Union[Sequence[Graph], Sequence[DG.Vertex]], + tarsI: Union[Sequence[Graph], Sequence[DG.Vertex]]) -> DG.HyperEdge: srcs = srcsI tars = tarsI @@ -327,8 +332,8 @@ def _DG__getattribute__(self: DG, name: str) -> Any: DG.__hash__ = lambda self: self.id # type: ignore -class DGBuilder: - _builder: Optional[libpymod._DGBuilder] +class DGBuildContextManager: + _builder: Optional[DG.Builder] def __init__(self, dg: DG, onNewVertex, onNewHyperEdge) -> None: assert dg is not None @@ -337,7 +342,7 @@ def __init__(self, dg: DG, onNewVertex, onNewHyperEdge) -> None: None if onNewHyperEdge is None else _funcWrap(libpymod._Func_VoidDGHyperEdge, onNewHyperEdge) ) - def __enter__(self) -> "DGBuilder": + def __enter__(self) -> "DGBuildContextManager": return self def __exit__(self, exc_type, exc_val, exc_tb) -> None: @@ -355,21 +360,21 @@ def isActive(self) -> bool: return self._builder.isActive def addDerivation(self, d: Derivations, - graphPolicy: IsomorphismPolicy = IsomorphismPolicy.Check) -> DGHyperEdge: + graphPolicy: IsomorphismPolicy = IsomorphismPolicy.Check) -> DG.HyperEdge: assert self._builder return self._builder.addDerivation(d, graphPolicy) - def addHyperEdge(self, e: DGHyperEdge, - graphPolicy: IsomorphismPolicy = IsomorphismPolicy.Check) -> DGHyperEdge: + def addHyperEdge(self, e: DG.HyperEdge, + graphPolicy: IsomorphismPolicy = IsomorphismPolicy.Check) -> DG.HyperEdge: assert self._builder return self._builder.addHyperEdge(e, graphPolicy) - def execute(self, strategy: DGStrat, *, verbosity: int=2, ignoreRuleLabelTypes: bool=False) -> DGExecuteResult: + def execute(self, strategy: DGStrat, *, verbosity: int=2, ignoreRuleLabelTypes: bool=False) -> DG.Builder.ExecuteResult: assert self._builder return self._builder.execute(dgStrat(strategy), verbosity, ignoreRuleLabelTypes) # type: ignore def apply(self, graphs: Iterable[Graph], rule: Rule, onlyProper: bool=True, verbosity: int=0, - graphPolicy: IsomorphismPolicy=IsomorphismPolicy.Check) -> List[DGHyperEdge]: + graphPolicy: IsomorphismPolicy=IsomorphismPolicy.Check) -> List[DG.HyperEdge]: assert self._builder return _unwrap(self._builder.apply(_wrap(libpymod._VecGraph, graphs), rule, onlyProper, verbosity, graphPolicy)) @@ -384,32 +389,32 @@ def load(self, ruleDatabase: List[Rule], f: str, verbosity: int = 2) -> None: prefixFilename(f), verbosity) _DG_build_orig = DG.build -DG.build = lambda self, *, onNewVertex=None, onNewHyperEdge=None: DGBuilder(self, onNewVertex, onNewHyperEdge) # type: ignore +DG.build = lambda self, *, onNewVertex=None, onNewHyperEdge=None: DGBuildContextManager(self, onNewVertex, onNewHyperEdge) # type: ignore #---------------------------------------------------------- -# DGExecuteResult +# DG.Builder.ExecuteResult #---------------------------------------------------------- -def _DGExecuteResult__getattribute__(self: DGExecuteResult, name: str) -> Any: +def _DGExecuteResult__getattribute__(self: DG.Builder.ExecuteResult, name: str) -> Any: if name in ("subset", "universe"): return _unwrap(object.__getattribute__(self, name)) return object.__getattribute__(self, name) -DGExecuteResult.__getattribute__ = _DGExecuteResult__getattribute__ # type: ignore +DG.Builder.ExecuteResult.__getattribute__ = _DGExecuteResult__getattribute__ # type: ignore -_DGExecuteResult_list_orig = DGExecuteResult.list -def _DGExecuteResult_list(self: DGExecuteResult, *, withUniverse: bool=False) -> None: +_DGExecuteResult_list_orig = DG.Builder.ExecuteResult.list +def _DGExecuteResult_list(self: DG.Builder.ExecuteResult, *, withUniverse: bool=False) -> None: return _DGExecuteResult_list_orig(self, withUniverse) # type: ignore -DGExecuteResult.list = _DGExecuteResult_list # type: ignore +DG.Builder.ExecuteResult.list = _DGExecuteResult_list # type: ignore #---------------------------------------------------------- -# DGHyperEdge +# DG.HyperEdge #---------------------------------------------------------- -_DGHyperEdge_print_orig = DGHyperEdge.print -DGHyperEdge.print = lambda self, *args, **kwargs: _unwrap(_DGHyperEdge_print_orig(self, *args, **kwargs)) # type: ignore +_DGHyperEdge_print_orig = DG.HyperEdge.print +DG.HyperEdge.print = lambda self, *args, **kwargs: _unwrap(_DGHyperEdge_print_orig(self, *args, **kwargs)) # type: ignore #---------------------------------------------------------- @@ -422,7 +427,7 @@ def callback(self, f, *args, **kwargs): import inspect spec = inspect.getfullargspec(f) if len(spec.args) == 2: - _deprecation("The callback for {} seems to take two arguments, a graph and a derivation graph. This is deprecated, the callback should take a single DGVertex argument.".format(name)) + _deprecation("The callback for {} seems to take two arguments, a graph and a derivation graph. This is deprecated, the callback should take a single DG.Vertex argument.".format(name)) fOrig = f f = lambda v, fOrig=fOrig: fOrig(v.graph, v.dg) return orig(self, _funcWrap(func, f), *args, **kwargs) diff --git a/libs/pymod/lib/mod/libpymod.pyi b/libs/pymod/lib/mod/libpymod.pyi index e51f260..a5121ea 100644 --- a/libs/pymod/lib/mod/libpymod.pyi +++ b/libs/pymod/lib/mod/libpymod.pyi @@ -14,8 +14,8 @@ U = TypeVar("U") class Vec(List[T]): ... -class _VecDGHyperEdge(Vec[DGHyperEdge]): ... -class _VecDGVertex(Vec[DGVertex]): ... +class _VecDGHyperEdge(Vec[DG.HyperEdge]): ... +class _VecDGVertex(Vec[DG.Vertex]): ... class _VecDGStrat(Vec[DGStrat]): ... class _VecGraph(Vec[Graph]): ... class _VecRCExpExp(Vec[RCExpExp]): ... @@ -34,25 +34,25 @@ class _Func_BoolDerivation: def __call__(self, d: Derivation) -> bool: ... class _Func_VoidDGVertex: - def __call__(self, v: DGVertex) -> None: ... + def __call__(self, v: DG.Vertex) -> None: ... class _Func_BoolDGVertex: - def __call__(self, v: DGVertex) -> bool: ... + def __call__(self, v: DG.Vertex) -> bool: ... class _Func_StringDGVertex: - def __call__(self, v: DGVertex) -> str: ... + def __call__(self, v: DG.Vertex) -> str: ... class _Func_PairDoubleBoolDGVertex: - def __call__(self, v: DGVertex) -> Tuple[float, bool]: ... + def __call__(self, v: DG.Vertex) -> Tuple[float, bool]: ... class _Func_StringDGVertexInt: - def __call__(self, v: DGVertex, dupNum: int) -> str: ... + def __call__(self, v: DG.Vertex, dupNum: int) -> str: ... class _Func_VoidDGHyperEdge: - def __call__(self, e: DGHyperEdge) -> None: ... + def __call__(self, e: DG.HyperEdge) -> None: ... class _Func_BoolDGHyperEdge: - def __call__(self, e: DGHyperEdge) -> bool: ... + def __call__(self, e: DG.HyperEdge) -> bool: ... class _Func_StringDGHyperEdge: - def __call__(self, e: DGHyperEdge) -> str: ... + def __call__(self, e: DG.HyperEdge) -> str: ... class _Func_PairDoubleBoolDGHyperEdge: - def __call__(self, e: DGHyperEdge) -> Tuple[float, bool]: ... + def __call__(self, e: DG.HyperEdge) -> Tuple[float, bool]: ... class _Func_BoolGraph: def __call__(self, g: Graph) -> bool: ... @@ -139,26 +139,6 @@ class Derivations: ... def rngUniformReal() -> float: ... -# Post -#----------------------------------------------------------------------------- - -class post: - @staticmethod - def command(line: str) -> None: ... - @staticmethod - def flushCommands() -> None: ... - @staticmethod - def disableCommands() -> None: ... - @staticmethod - def enableCommands() -> None: ... - @staticmethod - def reopenCommandFile() -> None: ... - - @staticmethod - def summaryChapter(heading: str) -> None: ... - @staticmethod - def summarySection(heading: str) -> None: ... - #----------------------------------------------------------------------------- # dg @@ -168,54 +148,50 @@ class DG: def __init__(self, *, labelSettings: LabelSettings=..., graphDatabase: Iterable[Graph]=..., graphPolicy: IsomorphismPolicy=...) -> None: ... - def findVertex(self, g: Graph) -> DGVertex: ... + def findVertex(self, g: Graph) -> DG.Vertex: ... @overload - def findEdge(self, sources: List[DGVertex], targets: List[DGVertex]) -> DGHyperEdge: ... + def findEdge(self, sources: List[DG.Vertex], targets: List[DG.Vertex]) -> DG.HyperEdge: ... @overload - def findEdge(self, sourcesGraphs: List[Graph], targetGraphs: List[Graph]) -> DGHyperEdge: ... + def findEdge(self, sourcesGraphs: List[Graph], targetGraphs: List[Graph]) -> DG.HyperEdge: ... def build(self, - onNewVertex: Optional[Callable[[DGVertex], None]]=None, - onNewHyperEdge: Optional[Callable[[DGHyperEdge], None]]=None): ... + onNewVertex: Optional[Callable[[DG.Vertex], None]]=None, + onNewHyperEdge: Optional[Callable[[DG.HyperEdge], None]]=None): ... def print(self, printer: DGPrinter=..., data: Optional[DGPrintData]=...) -> Tuple[str, str]: ... @staticmethod def load(graphDatabase: List[Graph], ruleDatabase: List[Rule], file: str, graphPolicy: IsomorphismPolicy=..., verbosity: int=...) -> DG: ... + class Vertex: + graph: Graph -class _DGBuilder: - @property - def dg(self) -> DG: ... - @property - def isActive(self) -> bool: ... - def addDerivation(self, d: Derivations, graphPolicy: IsomorphismPolicy=...) -> DGHyperEdge: ... - def addHyperEdge(self, e: DGHyperEdge, graphPolicy: IsomorphismPolicy=...) -> DGHyperEdge: ... - def execute(self, strategy: DGStrat, *, verbosity: int=..., ignoreRuleLabelTypes: bool=...) -> DGExecuteResult: ... - def apply(self, graphs: List[Graph], rule: Rule, onlyProper: bool=..., verbosity: int=..., graphPolicy: IsomorphismPolicy=...) -> List[DGHyperEdge]: ... - def addAbstract(self, description: str) -> None: ... - def load(self, ruleDatabase: List[Rule], file: str, verbosity: int=...) -> None: ... - - -class DGExecuteResult: - def list(self, *, withUniverse: bool=...) -> None: ... - - -class DGVertex: - graph: Graph + class HyperEdge: + def print(self, printer: GraphPrinter=..., nomatchColour: str=..., matchColour: str=...) -> List[Tuple[str, str]]: ... + class Builder: + @property + def dg(self) -> DG: ... + @property + def isActive(self) -> bool: ... + def addDerivation(self, d: Derivations, graphPolicy: IsomorphismPolicy=...) -> DG.HyperEdge: ... + def addHyperEdge(self, e: DG.HyperEdge, graphPolicy: IsomorphismPolicy=...) -> DG.HyperEdge: ... + def execute(self, strategy: DGStrat, *, verbosity: int=..., ignoreRuleLabelTypes: bool=...) -> ExecuteResult: ... + def apply(self, graphs: List[Graph], rule: Rule, onlyProper: bool=..., verbosity: int=..., graphPolicy: IsomorphismPolicy=...) -> List[DG.HyperEdge]: ... + def addAbstract(self, description: str) -> None: ... + def load(self, ruleDatabase: List[Rule], file: str, verbosity: int=...) -> None: ... -class DGHyperEdge: - def print(self, printer: GraphPrinter=..., nomatchColour: str=..., matchColour: str=...) -> List[Tuple[str, str]]: ... + class ExecuteResult: + def list(self, *, withUniverse: bool=...) -> None: ... class DGPrinter: - def pushVertexVisible(self, f: Union[Callable[[DGVertex], bool], bool]) -> None: ... - def pushEdgeVisible(self, f: Union[Callable[[DGHyperEdge], bool], bool]) -> None: ... - def pushVertexLabel(self, f: Union[Callable[[DGVertex], str], str]) -> None: ... - def pushEdgeLabel(self, f: Union[Callable[[DGHyperEdge], str], str]) -> None: ... - def pushVertexColour(self, f: Union[Callable[[DGVertex], str], str], extendToEdges: bool=...) -> None: ... - def pushEdgeColour(self, f: Union[Callable[[DGHyperEdge], str], str]) -> None: ... + def pushVertexVisible(self, f: Union[Callable[[DG.Vertex], bool], bool]) -> None: ... + def pushEdgeVisible(self, f: Union[Callable[[DG.HyperEdge], bool], bool]) -> None: ... + def pushVertexLabel(self, f: Union[Callable[[DG.Vertex], str], str]) -> None: ... + def pushEdgeLabel(self, f: Union[Callable[[DG.HyperEdge], str], str]) -> None: ... + def pushVertexColour(self, f: Union[Callable[[DG.Vertex], str], str], extendToEdges: bool=...) -> None: ... + def pushEdgeColour(self, f: Union[Callable[[DG.HyperEdge], str], str]) -> None: ... def setRotationOverwrite(self, f: Union[Callable[[Graph], int], int]) -> None: ... def setMirrorOverwrite(self, f: Union[Callable[[Graph], bool], bool]) -> None: ... - def setImageOverwrite(self, f: Union[Callable[[DGVertex, int], str], str]) -> None: ... + def setImageOverwrite(self, f: Union[Callable[[DG.Vertex, int], str], str]) -> None: ... class DGPrintData: diff --git a/libs/pymod/lib/mod/post.pyi b/libs/pymod/lib/mod/post.pyi new file mode 100644 index 0000000..d3d8990 --- /dev/null +++ b/libs/pymod/lib/mod/post.pyi @@ -0,0 +1,9 @@ + +def command(line: str) -> None: ... +def flushCommands() -> None: ... +def disableCommands() -> None: ... +def enableCommands() -> None: ... +def reopenCommandFile() -> None: ... + +def summaryChapter(heading: str) -> None: ... +def summarySection(heading: str) -> None: ... diff --git a/libs/pymod/share/mod/extra.supp b/libs/pymod/share/mod/extra.supp index 7333174..d6597c4 100644 --- a/libs/pymod/share/mod/extra.supp +++ b/libs/pymod/share/mod/extra.supp @@ -35,3 +35,10 @@ ... fun:_PyObject_GC_Resize } +{ + + Memcheck:Leak + fun:malloc + ... + fun:_PyObject_GC_NewVar +} diff --git a/libs/pymod/src/mod/py/Collections.cpp b/libs/pymod/src/mod/py/Collections.cpp index b0798a2..59016a5 100644 --- a/libs/pymod/src/mod/py/Collections.cpp +++ b/libs/pymod/src/mod/py/Collections.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include #include #include @@ -79,7 +78,6 @@ void Collections_doExport() { makePair(); makePair(); makePair(); - makePair, dg::VertexMapper::Map>(); // Optional py::to_python_converter, ToPythonOptionalValue>(); diff --git a/libs/pymod/src/mod/py/Config.cpp b/libs/pymod/src/mod/py/Config.cpp index d57e5c3..3cc29ae 100644 --- a/libs/pymod/src/mod/py/Config.cpp +++ b/libs/pymod/src/mod/py/Config.cpp @@ -233,7 +233,8 @@ void Config_doExport() { // rst: skip the storage, but only for a pre-defined known subset of properties. // rst: // rst: :type: bool - .def_readwrite("fullyIgnoreV2000UnhandledKnownProperty", &MDLOptions::fullyIgnoreV2000UnhandledKnownProperty) + .def_readwrite("fullyIgnoreV2000UnhandledKnownProperty", + &MDLOptions::fullyIgnoreV2000UnhandledKnownProperty) // rst: .. attribute:: onV3000UnhandledAtomProperty = Action.Warn // rst: // rst: What to do when a property in atom line in a V3000 MOL file is not recognized. @@ -302,30 +303,14 @@ void Config_doExport() { BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 0, tNS), \ BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_NS_SIZE(), 2, tNS)) \ ; -#define SettingIter(rSetting, dataSetting, iSetting, tSetting) \ - .add_property(AddConfig( \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 0, tSetting), \ - BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting), \ - dataSetting \ - )) -#define AddConfig(Type, Name, Class) \ - MOD_toString(Name), \ - py::make_function([] (Config::Class *c) -> Type { \ - return c->Name.get(); \ - }, \ - py::default_call_policies(), \ - boost::mpl::vector()), \ - py::make_function([] (Config::Class *c, Type t) -> void { \ - c->Name.set(t); \ - }, \ - py::default_call_policies(), \ - boost::mpl::vector()) +#define SettingIter(rSetting, dataSetting, iSetting, tSetting) \ + .def_readwrite(MOD_toString(BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting)), \ + &Config::dataSetting::BOOST_PP_TUPLE_ELEM(MOD_CONFIG_DATA_SETTING_SIZE(), 1, tSetting)) BOOST_PP_SEQ_FOR_EACH(NSIter, ~, MOD_CONFIG_DATA()) #undef NSIter #undef SettingIter -#undef AddConfig py::list classNames; #define NSIter(rNS, dataNS, tNS) \ diff --git a/libs/pymod/src/mod/py/Misc.cpp b/libs/pymod/src/mod/py/Misc.cpp index 0f05d90..cf4fc22 100644 --- a/libs/pymod/src/mod/py/Misc.cpp +++ b/libs/pymod/src/mod/py/Misc.cpp @@ -95,4 +95,4 @@ void Misc_doExport() { py::def("printGeometryGraph", &mod::printGeometryGraph); } -} // namespace mod::Py +} // namespace mod::Py \ No newline at end of file diff --git a/libs/pymod/src/mod/py/Module.cpp b/libs/pymod/src/mod/py/Module.cpp index 0225c3f..86b884f 100644 --- a/libs/pymod/src/mod/py/Module.cpp +++ b/libs/pymod/src/mod/py/Module.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include @@ -12,7 +12,8 @@ #define MOD_NAMESPACED_FILES() \ ((graph, (Printer))) /* this must be before DGGraphInterface due to default arg */ \ - ((dg, (Builder) (DG) (GraphInterface) (Printer) (Strategy) (VertexMapper))) \ + /* DG first, as others makes nested classes */ \ + ((dg, (DG) (Builder) (GraphInterface) (Printer) (Strategy) (VertexMapper))) \ ((graph, (Graph) (Union))) \ ((graph, (Automorphism) (GraphInterface))) /* nested classes of Graph, so must be after */ \ ((rule, (CompositionMatch) (Composition) (Rule) (GraphInterface))) \ @@ -35,16 +36,19 @@ BOOST_PP_SEQ_FOR_EACH(MOD_iterDecl, _, MOD_NAMESPACED_FILES()) #undef MOD_forwardDeclare } // namespace mod -BOOST_PYTHON_MODULE (libpymod) { +BOOST_PYTHON_MODULE(libpymod) { + // specify that this module is actually a package + py::object package = py::scope(); + package.attr("__path__") = "libpymod"; #define MOD_call(a, prefix) mod::prefix Py:: BOOST_PP_CAT(a, _doExport)(); #define MOD_iterDecl(r, data, t) MOD_call(t,) - BOOST_PP_SEQ_FOR_EACH(MOD_iterDecl, _, MOD_ROOT_FILES()) + BOOST_PP_SEQ_FOR_EACH(MOD_iterDecl, _, MOD_ROOT_FILES()) #undef MOD_iterDecl #define MOD_iterNs(r, data, i, t) MOD_call(t, data::) #define MOD_iterDecl(r, data, t) \ - BOOST_PP_SEQ_FOR_EACH_I(MOD_iterNs, BOOST_PP_TUPLE_ELEM(2, 0, t), BOOST_PP_TUPLE_ELEM(2, 1, t)) - BOOST_PP_SEQ_FOR_EACH(MOD_iterDecl, _, MOD_NAMESPACED_FILES()) + BOOST_PP_SEQ_FOR_EACH_I(MOD_iterNs, BOOST_PP_TUPLE_ELEM(2, 0, t), BOOST_PP_TUPLE_ELEM(2, 1, t)) + BOOST_PP_SEQ_FOR_EACH(MOD_iterDecl, _, MOD_NAMESPACED_FILES()) #undef MOD_iterDecl #undef MOD_iterNs #undef MOD_call diff --git a/libs/pymod/src/mod/py/Post.cpp b/libs/pymod/src/mod/py/Post.cpp index 8feb73b..1f34c27 100644 --- a/libs/pymod/src/mod/py/Post.cpp +++ b/libs/pymod/src/mod/py/Post.cpp @@ -12,83 +12,80 @@ void Post_doExport() { // rst: :rtype: str py::def("makeUniqueFilePrefix", &makeUniqueFilePrefix); - struct Post { - // a fake class to hax a "submodule" - }; - // rst: .. class:: post + + // https://stackoverflow.com/questions/29006439/boost-python-multiple-modules-in-one-shared-object + py::scope PostModule = py::object(py::handle<>(py::borrowed(PyImport_AddModule("mod.post")))); + // rst: .. module:: post // rst: - // rst: This class (which will be a submodule in the future) - // rst: contains various functions to manipulate post-processing (:ref:`mod_post`). + // rst: The ``post`` submodule contains various functions to manipulate post-processing (:ref:`mod_post`). // rst: Commands for the post-processor are written to the command file ``out/post.sh`` // rst: which the post-processor executes internally as a Bash script. // rst: - py::class_("post", py::no_init) - // rst: .. staticmethod:: command(line) - // rst: - // rst: Write the given text to the command file and write a newline character. - // rst: - // rst: :param str line: the text to be written. - // rst: - // rst: .. warning:: The contents of the command file is executed without any security checks. - .def("command", &command).staticmethod("command") - // rst: .. staticmethod:: flushCommands() - // rst: - // rst: Flush the command file buffer. - .def("flushCommands", &flushCommands).staticmethod("flushCommands") - // rst: .. staticmethod:: disableCommands() - // rst: - // rst: Disable command writing and flushing, also for commands emitted internally in the library. - .def("disableCommands", &disableCommands).staticmethod("disableCommands") - // rst: .. staticmethod:: enableCommands() - // rst: - // rst: Enable command writing and flushing, also for commands emitted internally in the library. - .def("enableCommands", &enableCommands).staticmethod("enableCommands") - // rst: .. staticmethod:: reopenCommandFile() - // rst: - // rst: Reopen the command file, which may be useful if it was modified externally while open by the library. - .def("reopenCommandFile", &reopenCommandFile).staticmethod("reopenCommandFile") - // rst: .. staticmethod:: summaryChapter(heading) - // rst: - // rst: Command the post-processor to insert a ``\chapter`` macro in the summary. - // rst: - // rst: :param str heading: the chapter heading to insert. - .def("summaryChapter", &summaryChapter).staticmethod("summaryChapter") - // rst: .. staticmethod:: summarySection(heading) - // rst: - // rst: Command the post-processor to insert a ``\section`` macro in the summary. - // rst: - // rst: :param str heading: the section heading to insert. - .def("summarySection", &summarySection).staticmethod("summarySection") - // rst: .. staticmethod:: summaryRaw(latexCode, file=...) - // rst: - // rst: Command the post-processor to insert the given code verbatim in the summary. - // rst: - // rst: :param str latexCode: the code to insert. - // rst: :param str file: if given then that will be appended to a unique prefix for the final filename the code is stored in. - .def("summaryRaw", static_cast(&summaryRaw)) - .def("summaryRaw", static_cast(&summaryRaw)) - .staticmethod("summaryRaw") - // rst: .. staticmethod:: summaryInput(filename) - // rst: - // rst: Command the post-processor to insert a ``\input`` macro in the summary. - // rst: - // rst: :param str filename: the filename to input. - .def("summaryInput", &summaryInput).staticmethod("summaryInput") - // rst: .. staticmethod:: disableInvokeMake() - // rst: enableInvokeMake() - // rst: - // rst: Disable/enable the invocation of Make in the post-processor. - // rst: The processing of commands and generation of Makefiles will still be carried out, - // rst: and Make invocation can be done manually afterwards through the post-processor - .def("disableInvokeMake", &disableInvokeMake).staticmethod("disableInvokeMake") - .def("enableInvokeMake", &enableInvokeMake).staticmethod("enableInvokeMake") - // rst: .. staticmethod:: disableCompileSummary() - // rst: enableCompileSummary() - // rst: - // rst: Disable/enable the compilation of the final summary during post-processing. - // rst: The compilation can be invoked manually afterwards through the post-processor. - .def("disableCompileSummary", &disableCompileSummary).staticmethod("disableCompileSummary") - .def("enableCompileSummary", &enableCompileSummary).staticmethod("enableCompileSummary"); + // rst: .. function:: command(line) + // rst: + // rst: Write the given text to the command file and write a newline character. + // rst: + // rst: :param str line: the text to be written. + // rst: + // rst: .. warning:: The contents of the command file is executed without any security checks. + py::def("command", &command); + // rst: .. function:: flushCommands() + // rst: + // rst: Flush the command file buffer. + py::def("flushCommands", &flushCommands); + // rst: .. function:: disableCommands() + // rst: + // rst: Disable command writing and flushing, also for commands emitted internally in the library. + py::def("disableCommands", &disableCommands); + // rst: .. function:: enableCommands() + // rst: + // rst: Enable command writing and flushing, also for commands emitted internally in the library. + py::def("enableCommands", &enableCommands); + // rst: .. function:: reopenCommandFile() + // rst: + // rst: Reopen the command file, which may be useful if it was modified externally while open by the library. + py::def("reopenCommandFile", &reopenCommandFile); + // rst: .. function:: summaryChapter(heading) + // rst: + // rst: Command the post-processor to insert a ``\chapter`` macro in the summary. + // rst: + // rst: :param str heading: the chapter heading to insert. + py::def("summaryChapter", &summaryChapter); + // rst: .. function:: summarySection(heading) + // rst: + // rst: Command the post-processor to insert a ``\section`` macro in the summary. + // rst: + // rst: :param str heading: the section heading to insert. + py::def("summarySection", &summarySection); + // rst: .. function:: summaryRaw(latexCode, file=...) + // rst: + // rst: Command the post-processor to insert the given code verbatim in the summary. + // rst: + // rst: :param str latexCode: the code to insert. + // rst: :param str file: if given then that will be appended to a unique prefix for the final filename the code is stored in. + py::def("summaryRaw", static_cast(&summaryRaw)); + py::def("summaryRaw", static_cast(&summaryRaw)); + // rst: .. function:: summaryInput(filename) + // rst: + // rst: Command the post-processor to insert a ``\input`` macro in the summary. + // rst: + // rst: :param str filename: the filename to input. + py::def("summaryInput", &summaryInput); + // rst: .. function:: disableInvokeMake() + // rst: enableInvokeMake() + // rst: + // rst: Disable/enable the invocation of Make in the post-processor. + // rst: The processing of commands and generation of Makefiles will still be carried out, + // rst: and Make invocation can be done manually afterwards through the post-processor + py::def("disableInvokeMake", &disableInvokeMake); + py::def("enableInvokeMake", &enableInvokeMake); + // rst: .. function:: disableCompileSummary() + // rst: enableCompileSummary() + // rst: + // rst: Disable/enable the compilation of the final summary during post-processing. + // rst: The compilation can be invoked manually afterwards through the post-processor. + py::def("disableCompileSummary", &disableCompileSummary); + py::def("enableCompileSummary", &enableCompileSummary); } } // namespace mod::post::Py \ No newline at end of file diff --git a/libs/pymod/src/mod/py/dg/Builder.cpp b/libs/pymod/src/mod/py/dg/Builder.cpp index 84d18e5..4b4dcd9 100644 --- a/libs/pymod/src/mod/py/dg/Builder.cpp +++ b/libs/pymod/src/mod/py/dg/Builder.cpp @@ -17,12 +17,14 @@ Builder_execute(std::shared_ptr b, std::shared_ptr strategy, } // namespace void Builder_doExport() { + py::object DGobj = py::scope().attr("DG"); + py::scope DGscope = DGobj; using AddDerivation = DG::HyperEdge (Builder::*)(const Derivations &, IsomorphismPolicy); using AddHyperEdge = DG::HyperEdge (Builder::*)(const DG::HyperEdge &, IsomorphismPolicy); using Apply = std::vector (Builder::*)(const std::vector > &, std::shared_ptr, bool, int, IsomorphismPolicy); - // rst: .. class:: DGBuilder + // rst: .. class:: DG.Builder // rst: // rst: An RAII-style object obtained from :meth:`DG.build`. // rst: On destruction of an active builder object the owning :class:`DG` will be locked @@ -34,12 +36,12 @@ void Builder_doExport() { // rst: // rst: dg = DG() // rst: with dg.build() as b: - // rst: # b is a DGBuilder + // rst: # b is a DG.Builder // rst: # b has now been destructed and dg is locked. // rst: // rst: Otherwise one can manually use ``del`` on the obtained builder to trigger the destruction. // rst: - py::class_, boost::noncopyable>("_DGBuilder", py::no_init) + py::object BuilderObj = py::class_, boost::noncopyable>("Builder", py::no_init) // rst: .. attribute:: dg // rst: // rst: The derivation graph this builder can modify. @@ -60,7 +62,7 @@ void Builder_doExport() { // rst: :param Derivations d: a derivation to add a hyperedge for. // rst: :param IsomorphismPolicy graphPolicy: the isomorphism policy for adding the given graphs. // rst: :returns: the hyperedge corresponding to the given derivation. - // rst: :rtype: DGHyperEdge + // rst: :rtype: HyperEdge // rst: :raises: :class:`LogicError` if ``d.left`` or ``d.right`` is empty. // rst: :raises: :class:`LogicError` if a ``None``is in ``d.left``, ``d.right``, or ``d.rules``. // rst: :raises: :class:`LogicError` if ``graphPolicy == IsomorphismPolicy.Check`` and a given graph object @@ -73,10 +75,10 @@ void Builder_doExport() { // rst: (from a different :class:`DG`). // rst: If it already exists, only add the rules to the edge. // rst: - // rst: :param DGHyperEdge e: a hyperedge to copy. + // rst: :param HyperEdge e: a hyperedge to copy. // rst: :param IsomorphismPolicy graphPolicy: the isomorphism policy for adding the given graphs. // rst: :returns: the hyperedge corresponding to the copy of the given hyperedge. - // rst: :rtype: DGHyperEdge + // rst: :rtype: HyperEdge // rst: :raises: :class:`LogicError` if ``e`` is a null edge. // rst: :raises: :class:`LogicError` if ``graphPolicy == IsomorphismPolicy.Check`` and a given graph object // rst: is different but isomorphic to another given graph object or to a graph object already @@ -93,7 +95,7 @@ void Builder_doExport() { // rst: :param bool ignoreRuleLabelTypes: whether rules in the strategy should be checked beforehand for // rst: whether they have an associated :class:`LabelType` which matches the one in the underlying derivation graph. // rst: :returns: a proxy object for accessing the result of the execution. - // rst: :rtype: DGExecuteResult + // rst: :rtype: ExecuteResult // rst: :throws: :class:`LogicError` if a static "add" strategy has :attr:`IsomorphismPolicy.Check` as graph policy, // rst: and it tries to add a graph object isomorphic to an already known, but different, graph object in the database. // rst: This is checked before execution, so there is strong exception guarantee. @@ -125,7 +127,7 @@ void Builder_doExport() { // rst: :returns: a list of hyper edges representing the found direct derivations. // rst: The list may contain duplicates if there are multiple ways of constructing // rst: the same direct derivation when ignoring the specific match morphism. - // rst: :rtype: list[DGHyperEdge] + // rst: :rtype: list[HyperEdge] // rst: :raises: :class:`LogicError` if there is a ``None`` in ``graphs``. // rst: :raises: :class:`LogicError` if ``r`` is ``None``. // rst: :raises: :class:`LogicError` if ``graphPolicy == IsomorphismPolicy.Check`` and a given graph object @@ -163,16 +165,17 @@ void Builder_doExport() { // rst: :type f: str or CWDPath // rst: :raises: :class:`LogicError` if there is a ``None`` in ``ruleDatabase``. // rst: :raises: :class:`LogicError` if the label settings of the dump does not match those of this DG. - // rst: :raises: :class:`InputError` if the file can not be opened or its content is bad. + // rst: :raises: :class:`InputError` if the file can not be opened or its content is bad. .def("load", &Builder::load); - // rst: .. class:: DGExecuteResult + // rst: .. class:: DG.Builder.ExecuteResult // rst: - // rst: The result from calling :func:`DGBuilder.execute`. + // rst: The result from calling :func:`DG.Builder.execute`. // rst: - py::class_, boost::noncopyable>("DGExecuteResult", py::no_init) + py::scope Builderscope = BuilderObj; + py::class_, boost::noncopyable>("ExecuteResult", py::no_init) // rst: .. attribute:: subset - // rst: universe + // rst: universe // rst: // rst: (Read-only) Respectively the subset and the universe computed // rst: by the strategy execution (see also :ref:`dgStrat`). diff --git a/libs/pymod/src/mod/py/dg/DG.cpp b/libs/pymod/src/mod/py/dg/DG.cpp index 0203bc5..fa59d5b 100644 --- a/libs/pymod/src/mod/py/dg/DG.cpp +++ b/libs/pymod/src/mod/py/dg/DG.cpp @@ -40,7 +40,7 @@ void DG_doExport() { // rst: :math:`\mathcal{H} = (V, E)`. Each hyperedge :math:`e\in E` is thus an ordered pair // rst: :math:`(e^+, e^-)` of multisets of vertices, the sources and the targets. // rst: Each vertex is annotated with a graph, and each hyperedge is annotated with list of transformation rules. - // rst: A derivation graph is constructed incrementally using a :class:`DGBuilder` obtained from the :meth:`build()` + // rst: A derivation graph is constructed incrementally using a :class:`DG.Builder` obtained from the :meth:`build()` // rst: function. When the obtained builder is destructed the derivation graph becomes locked and can no longer be modified. // rst: py::class_, boost::noncopyable>("DG", py::no_init) @@ -80,7 +80,7 @@ void DG_doExport() { //------------------------------------------------------------------ // rst: .. attribute:: hasActiveBuilder // rst: - // rst: (Read-only) Whether :meth:`build` has been called and the returned :class:`DGBuilder` is still active. + // rst: (Read-only) Whether :meth:`build` has been called and the returned :class:`DG.Builder` is still active. // rst: // rst: :type: bool .add_property("hasActiveBuilder", &DG::hasActiveBuilder) @@ -102,7 +102,7 @@ void DG_doExport() { // rst: // rst: (Read-only) An iterable of all vertices in the derivation graph. // rst: - // rst: :type: DGVertexRange + // rst: :type: DG.VertexRange // rst: :raises: :class:`LogicError` if neither ``hasActiveBuilder`` nor ``isLocked``. .add_property("vertices", &DG::vertices) // rst: .. attribute:: numEdges @@ -116,7 +116,7 @@ void DG_doExport() { // rst: // rst: (Read-only) An iterable of all hyperedges in the derivation graph. // rst: - // rst: :type: DGEdgeRange + // rst: :type: DG.EdgeRange // rst: :raises: :class:`LogicError` if neither ``hasActiveBuilder`` nor ``isLocked``. .add_property("edges", &DG::edges) //------------------------------------------------------------------ @@ -125,17 +125,17 @@ void DG_doExport() { // rst: :param Graph g: the graph to find a vertex which has it associated. // rst: :returns: a vertex descriptor for which the given graph is associated, // rst: or a null descriptor if no such vertex exists. - // rst: :rtype: DGVertex + // rst: :rtype: DG.Vertex // rst: :raises: :class:`LogicError` if neither ``hasActiveBuilder`` nor ``isLocked``. // rst: :raises: :class:`LogicError` if ``g`` is ``None``. .def("findVertex", &DG::findVertex) // rst: .. method:: findEdge(sources, targets) - // rst: findEdge(sourceGraphs, targetGraphs) + // rst: findEdge(sourceGraphs, targetGraphs) // rst: // rst: :param sources: the list of source vertices the resulting hyperedge must have. - // rst: :type sources: list[DGVertex] + // rst: :type sources: list[DG.Vertex] // rst: :param targets: the list of targets vertices the resulting hyperedge must have. - // rst: :type targets: list[DGVertex] + // rst: :type targets: list[DG.Vertex] // rst: :param sourceGraphs: the list of graphs that must be associated with the source vertices the resulting hyperedge must have. // rst: :type sourceGraphs: list[Graph] // rst: :param targetGraphs: the list of graphs that must be associated with the targets vertices the resulting hyperedge must have. @@ -143,18 +143,22 @@ void DG_doExport() { // rst: :returns: a hyperedge with the given sources and targets. // rst: If no such hyperedge exists in the derivation graph then a null edge is returned. // rst: In the second version, the graphs are put through :meth:`findVertex` first. - // rst: :rtype: DGHyperEdge + // rst: :rtype: DG.HyperEdge // rst: :raises: :class:`LogicError` if a vertex descriptor is null, or does not belong to the derivation graph. // rst: :raises: :class:`LogicError` if neither ``hasActiveBuilder`` nor ``isLocked``. .def("findEdge", findEdgeVertices) .def("findEdge", findEdgeGraphs) //------------------------------------------------------------------ - // rst: .. method:: build() + // rst: .. method:: build(onNewVertex=None, onNewHyperEdge=None) // rst: + // rst: :param onNewVertex: a callback invoked when a new vertex is added to the underlying derivation graph. + // rst: :type onNewVertex: Optional[Callable[[DG.Vertex], None]] + // rst: :param onNewHyperEdge: a callback invoked when a new hyperedge is added to the underlying derivation graph. + // rst: :type onNewVertex: Optional[Callable[[DG.HyperEdge], None]] // rst: :returns: an RAII-style object which can be used to construct the derivation graph. - // rst: It can be used as a context manager in a ``with``-statement (see the documentation of :class:`DGBuilder`). - // rst: On destruction of an active builder object the associated DG object becomes locked for further modifications. - // rst: :rtype: DGBuilder + // rst: It can be used as a context manager in a ``with``-statement (see the documentation of :class:`DG.Builder`). + // rst: On destruction of an active builder object the associated DG object becomes locked for further modifications. + // rst: :rtype: DG.Builder // rst: :raises: :class:`LogicError` if the DG already has an active builder (see :attr:`hasActiveBuilder`). // rst: :raises: :class:`LogicError` if the DG is locked (see :attr:`locked`). .def("build", &DG_build) @@ -194,7 +198,7 @@ void DG_doExport() { // rst: dump(filename) // rst: // rst: Exports the derivation graph to a file, including associated graphs and rules. - // rst: Use :meth:`load` or :meth:`DGBuilder.load` to import the derivation graph again. + // rst: Use :meth:`load` or :meth:`DG.Builder.load` to import the derivation graph again. // rst: // rst: :param str filename: the name of the file to save the dump to. // rst: If non is given an auto-generated name in the ``out/`` folder is used. @@ -217,7 +221,7 @@ void DG_doExport() { // rst: .. staticmethod:: load(graphDatabase, ruleDatabase, f, graphPolicy=IsomorphismPolicy.Check, verbosity=2) // rst: // rst: Load a derivation graph dump as a locked object. - // rst: Use :func:`DGBuilder.load` to load a dump into a derivation graph under construction. + // rst: Use :func:`DG.Builder.load` to load a dump into a derivation graph under construction. // rst: // rst: This is done roughly by making a :class:`DG` with the given `graphDatabase` and `graphPolicy`. // rst: The label settings are retrieved from the dump file. @@ -262,4 +266,4 @@ void DG_doExport() { py::def("diffDGs", &DG::diff); } -} // namespace mod::dg::Py \ No newline at end of file +} // namespace mod::dg::Py diff --git a/libs/pymod/src/mod/py/dg/GraphInterface.cpp b/libs/pymod/src/mod/py/dg/GraphInterface.cpp index 0e624f3..b31d9a9 100644 --- a/libs/pymod/src/mod/py/dg/GraphInterface.cpp +++ b/libs/pymod/src/mod/py/dg/GraphInterface.cpp @@ -10,11 +10,13 @@ namespace mod::dg::Py { void GraphInterface_doExport() { - // rst: .. class:: DGVertex + py::object DGobj = py::scope().attr("DG"); + py::scope DGscope = DGobj; + // rst: .. class:: DG.Vertex // rst: // rst: A descriptor of either a vertex in a derivation graph, or a null vertex. // rst: - py::class_("DGVertex", py::no_init) + py::class_("Vertex", py::no_init) // rst: .. method:: __init__() // rst: // rst: Constructs a null descriptor. @@ -59,7 +61,7 @@ void GraphInterface_doExport() { // rst: // rst: (Read-only) A range of in-hyperedges for this vertex. // rst: - // rst: :type: DGInEdgeRange + // rst: :type: DG.InEdgeRange // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("inEdges", &DG::Vertex::inEdges) // rst: .. attribute:: outDegree @@ -73,7 +75,7 @@ void GraphInterface_doExport() { // rst: // rst: (Read-only) A range of out-hyperedges for this vertex. // rst: - // rst: :type: DGOutEdgeRange + // rst: :type: DG.OutEdgeRange // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("outEdges", &DG::Vertex::outEdges) // rst: .. attribute:: graph @@ -84,11 +86,11 @@ void GraphInterface_doExport() { // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("graph", &DG::Vertex::getGraph); - // rst: .. class:: DGHyperEdge + // rst: .. class:: DG.HyperEdge // rst: // rst: A descriptor of either a hyperedge in a derivation graph, or a null edge. // rst: - py::class_("DGHyperEdge", py::no_init) + py::class_("HyperEdge", py::no_init) // rst: .. method:: __init__() // rst: // rst: Constructs a null descriptor. @@ -132,7 +134,7 @@ void GraphInterface_doExport() { // rst: // rst: (Read-only) The sources of the hyperedge. // rst: - // rst: :type: DGSourceRange + // rst: :type: DG.SourceRange // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("sources", &DG::HyperEdge::sources) // rst: .. attribute:: numTargets @@ -145,14 +147,14 @@ void GraphInterface_doExport() { // rst: // rst: (Read-only) The targets of the hyperedge. // rst: - // rst: :type: DGTargetRange + // rst: :type: DG.TargetRange // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("targets", &DG::HyperEdge::targets) // rst: .. attribute:: rules // rst: // rst: (Read-only) The rules associated with the hyperedge. // rst: - // rst: :type: DGRuleRange + // rst: :type: DG.RuleRange // rst: :raises: :class:`LogicError` if it is a null descriptor. .add_property("rules", &DG::HyperEdge::rules) // rst: .. attribute:: inverse @@ -160,7 +162,7 @@ void GraphInterface_doExport() { // rst: (Read-only) A descriptor for the inverse hyperedge of this one, if it exists. // rst: Otherwise a null descriptor is returned. // rst: - // rst: :type: DGHyperEdge + // rst: :type: DG.HyperEdge // rst: :raises: :class:`LogicError` if it is a null descriptor. // rst: :raises: :class:`LogicError` if not ``dg.locked``. .add_property("inverse", &DG::HyperEdge::getInverse) @@ -185,19 +187,19 @@ void GraphInterface_doExport() { py::arg("verbosity") = 0) ); - py::class_("DGVertexRange", py::no_init) + py::class_("VertexRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGEdgeRange", py::no_init) + py::class_("EdgeRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGInEdgeRange", py::no_init) + py::class_("InEdgeRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGOutEdgeRange", py::no_init) + py::class_("OutEdgeRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGSourceRange", py::no_init) + py::class_("SourceRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGTargetRange", py::no_init) + py::class_("TargetRange", py::no_init) .def("__iter__", py::iterator()); - py::class_("DGRuleRange", py::no_init) + py::class_("RuleRange", py::no_init) .def("__iter__", py::iterator()) .def("__len__", &DG::RuleRange::size); } diff --git a/libs/pymod/src/mod/py/dg/Printer.cpp b/libs/pymod/src/mod/py/dg/Printer.cpp index 7fbedae..453c8a7 100644 --- a/libs/pymod/src/mod/py/dg/Printer.cpp +++ b/libs/pymod/src/mod/py/dg/Printer.cpp @@ -87,7 +87,7 @@ void Printer_doExport() { // rst: Create another version of the given hyperedge and give it the given duplicate number. // rst: It will connect to duplicate 0 of all head and tail vertices. // rst: - // rst: :param DGHyperEdge e: a reference to the derivation to duplicate. + // rst: :param DG.HyperEdge e: a reference to the derivation to duplicate. // rst: :param int eDup: the duplicate number for the new version of the derivation. // rst: :raises: :class:`LogicError` if ``not e``. // rst: :raises: :class:`LogicError` if ``e.dg != dg``. @@ -97,7 +97,7 @@ void Printer_doExport() { // rst: // rst: Remove the version of the given hyperedge with the given duplicate number. // rst: - // rst: :param DGHyperEdge e: a reference to the derivation to duplicate. + // rst: :param DG.HyperEdge e: a reference to the derivation to duplicate. // rst: :param int eDup: the duplicate number for the version of the derivation to remove. // rst: :raises: :class:`LogicError` if ``not e``. // rst: :raises: :class:`LogicError` if ``e.dg != dg``. @@ -108,9 +108,9 @@ void Printer_doExport() { // rst: For the given hyperedge duplicate, reconnect the given source vertex to the given duplicate of that source. // rst: If the vertex is a source multiple times, then an arbitrary one of them is reconnected. // rst: - // rst: :param DGHyperEdge e: a reference to the derivation to reconnect. + // rst: :param DG.HyperEdge e: a reference to the derivation to reconnect. // rst: :param int eDup: the duplicate number of the derivation to reconnect. - // rst: :param DGVertex v: a source vertex to reconnect. + // rst: :param DG.Vertex v: a source vertex to reconnect. // rst: :param int vDupTar: the new duplicate number for the source vertex. // rst: :raises: :class:`LogicError` if ``not e``. // rst: :raises: :class:`LogicError` if ``e.dg != dg``. @@ -124,9 +124,9 @@ void Printer_doExport() { // rst: For the given hyperedge duplicate, reconnect the given head to the given duplicate of that head. // rst: If the vertex is a head multiple times, then an arbitrary one of them is reconnected. // rst: - // rst: :param DGHyperEdge e: a reference to the derivation to reconnect. + // rst: :param DG.HyperEdge e: a reference to the derivation to reconnect. // rst: :param int eDup: the duplicate number of the derivation to reconnect. - // rst: :param DGVertex v: a target vertex to reconnect. + // rst: :param DG.Vertex v: a target vertex to reconnect. // rst: :param int vDupTar: the new duplicate number for the target vertex. // rst: :raises: :class:`LogicError` if ``not e``. // rst: :raises: :class:`LogicError` if ``e.dg != dg``. @@ -151,6 +151,9 @@ void Printer_doExport() { // rst: Access the :class:`GraphPrinter` used when printing images of graphs. // rst: Note that assignment to the property copies the argument. // rst: + // rst: The initial printer has :meth:`GraphPrinter.enableAll` called, + // rst: and then indices are removed (:attr:`GraphPrinter.withIndex` set to ``False``). + // rst: // rst: :type: GraphPrinter .add_property("graphPrinter", py::make_function(Printer_getGraphPrinter, py::return_internal_reference<1>()), @@ -182,7 +185,7 @@ void Printer_doExport() { // rst: All visibility functions must return ``true`` for a vertex to be visible. // rst: // rst: :param f: the function or constant to push for specifying vertex visibility. - // rst: :type f: Callable[[DGVertex], bool] or bool + // rst: :type f: Callable[[DG.Vertex], bool] or bool .def("pushVertexVisible", &Printer_pushVertexVisible) // rst: .. method:: popVertexVisible() // rst: @@ -196,7 +199,7 @@ void Printer_doExport() { // rst: All visibility functions must return ``true`` for a hyperedge to be visible. // rst: // rst: :param f: the function or constant to push for specifying hyperedge visibility. - // rst: :type f: Callable[[DGHyperEdge], bool] or bool + // rst: :type f: Callable[[DG.HyperEdge], bool] or bool .def("pushEdgeVisible", &Printer_pushEdgeVisible) // rst: .. method:: popEdgeVisible() // rst: @@ -235,7 +238,7 @@ void Printer_doExport() { // rst: The result of this function is added to the end of each label. // rst: // rst: :param f: the function or constant to push for labelling vertices. - // rst: :type f: Callable[[DGVertex], str] or str + // rst: :type f: Callable[[DG.Vertex], str] or str .def("pushVertexLabel", &Printer_pushVertexLabel) // rst: .. method:: popVertexLabel() // rst: @@ -248,7 +251,7 @@ void Printer_doExport() { // rst: Add another function or constant for edge labelling. The result of this function is appended to each label. // rst: // rst: :param f: the function or constant to push for labelling edges. - // rst: :type f: Callable[[DGHyperEdge], str] or str + // rst: :type f: Callable[[DG.HyperEdge], str] or str .def("pushEdgeLabel", &Printer_pushEdgeLabel) // rst: .. method:: popEdgeLabel() // rst: @@ -289,7 +292,7 @@ void Printer_doExport() { // rst: The edge extension of vertex colour takes lower precedence than explicitly added hyperedge colouring functions. // rst: // rst: :param f: the function to push for colouring vertices. - // rst: :type f: Callable[[DGVertex], str] or str + // rst: :type f: Callable[[DG.Vertex], str] or str // rst: :param bool extendToEdges: whether some hyperedges are coloured as well (see above). .def("pushVertexColour", &Printer_pushVertexColour) // rst: .. method:: popVertexColour() @@ -304,7 +307,7 @@ void Printer_doExport() { // rst: first colour function returning a non-empty string. // rst: // rst: :param f: the function or constant to push for colouring hyperedges. - // rst: :type f: Callable[[DGHyperEdge], str] or str + // rst: :type f: Callable[[DG.HyperEdge], str] or str .def("pushEdgeColour", &Printer_pushEdgeColour) // rst: .. method:: popEdgeColour() // rst: @@ -349,7 +352,7 @@ void Printer_doExport() { // rst: The image overwrite can be removed by calling with ``None``. // rst: // rst: :param f: the callback to use, or ``None`` to remove an existing callback. - // rst: :type f: Callable[[DGVertex, int], tuple[str, str]] or None + // rst: :type f: Callable[[DG.Vertex, int], tuple[str, str]] or None .def("setImageOverwrite", &Printer_setImageOverride) // rst: .. attribute:: graphvizPrefix // rst: diff --git a/libs/pymod/src/mod/py/dg/VertexMapper.cpp b/libs/pymod/src/mod/py/dg/VertexMapper.cpp index 4f604b6..dcad740 100644 --- a/libs/pymod/src/mod/py/dg/VertexMapper.cpp +++ b/libs/pymod/src/mod/py/dg/VertexMapper.cpp @@ -9,7 +9,7 @@ namespace mod::dg::Py { void VertexMapper_doExport() { // rst: .. class:: DGVertexMapper // rst: - // rst: A class for enumerating all valid vertex maps for a given :class:`DGHyperEdge`. + // rst: A class for enumerating all valid vertex maps for a given :class:`DG.HyperEdge`. // rst: That is, for such a hyperedge, collect the graphs associated with // rst: respectively the source and target vertices, and create the disjoint union of those graphs. // rst: Let the result be the graphs :math:`G'` and :math:`H'`. @@ -28,7 +28,7 @@ void VertexMapper_doExport() { // rst: By default all maps :math:`V(G) \rightarrow V(H)` are enumerated. // rst: To only enumerate a singular vertex map per rule, use ``upToIsomorphismG = True`` and ``leftLimit = rightLimit = 1``. // rst: - // rst: :param DGHyperEdge e: the hyperedge to construct vertex maps for. + // rst: :param DG.HyperEdge e: the hyperedge to construct vertex maps for. // rst: :param bool upToIsomrophismG: whether to enumerate all :math:`m`, or just those such that all bottom spans // rst: :math:`(G\leftarrow D\rightarrow H)` up to isomorphism are generated. // rst: :param int leftLimit: after bottom span generation, find this many isomorphisms back to the sources of the hyperedge. @@ -42,7 +42,7 @@ void VertexMapper_doExport() { // rst: // rst: (Read-only) The hyperedge to calculate vertex maps for. // rst: - // rst: :type: DGHyperEdge + // rst: :type: DG.HyperEdge .def_readonly("edge", &VertexMapper::getEdge) // rst: .. attribute:: left // rst: right diff --git a/libs/pymod/src/mod/py/rule/Composition.cpp b/libs/pymod/src/mod/py/rule/Composition.cpp index f8c17b3..21d6503 100644 --- a/libs/pymod/src/mod/py/rule/Composition.cpp +++ b/libs/pymod/src/mod/py/rule/Composition.cpp @@ -104,7 +104,7 @@ void Composition_doExport() { // rst: Print the graph representing all expressions evaluated so far. .def("print", &Composer::print); - // rst: .. method:: rcEvaluator(database, labelSettings) + // rst: .. method:: rcEvaluator(database, labelSettings=LabelSettings(LabelType.String, LabelRelation.Isomorphism)) // rst: // rst: :param database: a list of isomorphic rules the evaluator will compare against. // rst: :type database: list[Rule] diff --git a/requirements.txt b/requirements.txt index 6cc7f1b..59e56bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -r requirements_nodoc.txt -sphinx>=3.5 +sphinx>=7.3 sphinx_design sphinxcontrib-jquery # for the bootstrap theme diff --git a/scripts/makePyExamples.py b/scripts/makePyExamples.py index 9af77ee..54444dc 100755 --- a/scripts/makePyExamples.py +++ b/scripts/makePyExamples.py @@ -14,7 +14,7 @@ def processExamples(topSrcDir): assert "title" in section section['id'] = sec section['exs'] = [] - for ex in os.listdir(root + sec): + for ex in sorted(os.listdir(root + sec)): if ex in ('out', 'summary'): continue exFull = root + sec + "/" + ex diff --git a/test/cmake_add_subdirectory/project/CMakeLists.txt b/test/cmake_add_subdirectory/project/CMakeLists.txt index 5a5483c..f7f7332 100644 --- a/test/cmake_add_subdirectory/project/CMakeLists.txt +++ b/test/cmake_add_subdirectory/project/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(CMakeTestProject CXX) diff --git a/test/cmake_import/CMakeLists.txt b/test/cmake_import/CMakeLists.txt index a245628..d1a41cf 100644 --- a/test/cmake_import/CMakeLists.txt +++ b/test/cmake_import/CMakeLists.txt @@ -2,14 +2,17 @@ set(workDir ${CMAKE_CURRENT_BINARY_DIR}/workDir/cmake_import_configure) file(MAKE_DIRECTORY ${workDir}) add_test(NAME cmake_import_configure COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" - -DBOOST_ROOT=${BOOST_ROOT} -DCMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH} + -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} ${CMAKE_CURRENT_SOURCE_DIR}/project WORKING_DIRECTORY ${workDir}) add_test(NAME cmake_import_build COMMAND ${CMAKE_COMMAND} --build . WORKING_DIRECTORY ${workDir}) -set_tests_properties(cmake_import_configure PROPERTIES - FIXTURES_SETUP cmake_import) -set_tests_properties(cmake_import_build PROPERTIES - FIXTURES_REQUIRED cmake_import) +add_test(NAME cmake_import_run + COMMAND ./doStuff + WORKING_DIRECTORY ${workDir}) +set_tests_properties(cmake_import_configure PROPERTIES FIXTURES_SETUP cmake_import_build) +set_tests_properties(cmake_import_build PROPERTIES FIXTURES_REQUIRED cmake_import_build) +set_tests_properties(cmake_import_build PROPERTIES FIXTURES_SETUP cmake_import_run) +set_tests_properties(cmake_import_run PROPERTIES FIXTURES_REQUIRED cmake_import_run) \ No newline at end of file diff --git a/test/cmake_import/project/CMakeLists.txt b/test/cmake_import/project/CMakeLists.txt index f37037b..e8e8f91 100644 --- a/test/cmake_import/project/CMakeLists.txt +++ b/test/cmake_import/project/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10) +cmake_minimum_required(VERSION 3.15) project(CMakeTestProject CXX) diff --git a/test/py/DGSmilesProblem.py b/test/py/DGSmilesProblem.py index 63cd0f8..cbeda17 100644 --- a/test/py/DGSmilesProblem.py +++ b/test/py/DGSmilesProblem.py @@ -130,6 +130,6 @@ edge [ source 96 target 97 label "-" ] ] ]""") -dg = dgRuleComp([a], addSubset(a) >> p) -dg.calc() +dg = DG(graphDatabase=[a]) +dg.build().execute(addSubset(a) >> p) dg.print() diff --git a/test/py/derivation.py b/test/py/derivation.py index 6a62429..4e43639 100644 --- a/test/py/derivation.py +++ b/test/py/derivation.py @@ -24,6 +24,27 @@ d.right = [None] assert str(d) == "{ null }, { null }" +############################################################################## +d = Derivation() +assert str(d) == "{ }, { }" +assert repr(d) == str(d) +d.left.append(g1) +assert d.left == [g1] +assert str(d) == "{ 'g1' }, { }" + +d.rule = r +assert d.rule == r +assert str(d) == "{ 'g1' }, 'r', { }" +d.right.append(g2) +assert d.right == [g2] +assert str(d) == "{ 'g1' }, 'r', { 'g2' }" + +d = Derivation() +d.left.append(None) +assert str(d) == "{ null }, { }" +d.right.append(None) +assert str(d) == "{ null }, { null }" + ############################################################################## d = Derivations() assert str(d) == "{ } < > { }" @@ -47,6 +68,29 @@ d.right = [None] assert str(d) == "{ null } < null > { null }" +############################################################################## +d = Derivations() +assert str(d) == "{ } < > { }" +assert repr(d) == str(d) +d.left.append(g1) +assert d.left == [g1] +assert str(d) == "{ 'g1' } < > { }" + +d.rules.append(r) +assert d.rules == [r] +assert str(d) == "{ 'g1' } < 'r' > { }" +d.right.append(g2) +assert d.right == [g2] +assert str(d) == "{ 'g1' } < 'r' > { 'g2' }" + +d = Derivations() +d.left.append(None) +assert str(d) == "{ null } < > { }" +d.rules.append(None) +assert str(d) == "{ null } < null > { }" +d.right.append(None) +assert str(d) == "{ null } < null > { null }" + ############################################################################## d = Derivation() d.left = [g1] @@ -56,3 +100,13 @@ dd = Derivations(d) assert str(d) == "{ 'g1' }, 'r', { 'g2' }" assert str(dd) == "{ 'g1' } < 'r' > { 'g2' }" + +############################################################################## +d = Derivation() +d.left.append(g1) +d.rule = r +d.right.append(g2) + +dd = Derivations(d) +assert str(d) == "{ 'g1' }, 'r', { 'g2' }" +assert str(dd) == "{ 'g1' } < 'r' > { 'g2' }" diff --git a/test/py/dg/000_basic.py b/test/py/dg/000_basic.py index 6026a77..12f5838 100644 --- a/test/py/dg/000_basic.py +++ b/test/py/dg/000_basic.py @@ -1,7 +1,7 @@ include("xx0_helpers.py") g = smiles('O') -v = DGVertex() +v = DG.Vertex() dg = DG() assert dg.id == 0 @@ -51,13 +51,12 @@ assert dg.labelSettings.withStereo assert dg.labelSettings.stereoRelation == LabelRelation.Isomorphism -fail(lambda: DG(graphDatabase=[None]), "Nullptr in graph database.") +fail(lambda: DG(graphDatabase=[None]), "Null pointer in graph database.") g1 = smiles('O') g2 = smiles('O') fail(lambda: DG(graphDatabase=[g1, g2]), "Isomorphic graphs '{}' and '{}' in initial graph database.".format(g1.name, g2.name)) dg = DG(graphDatabase=[g1, g2], graphPolicy=IsomorphismPolicy.TrustMe) - dg = DG(graphDatabase=[g]) assert dg.products == [] dg.build().execute(addSubset(g) >> ruleGMLString("""rule [ diff --git a/test/py/dg/001_graphInterface.py b/test/py/dg/001_graphInterface.py index 1504370..0a9396d 100644 --- a/test/py/dg/001_graphInterface.py +++ b/test/py/dg/001_graphInterface.py @@ -11,12 +11,30 @@ e1 = b.addDerivation(d1) assert dg.numVertices == 2 assert dg.numEdges == 1 - fail(lambda: e1.inverse, "Can not get inverse edge before the DG is locked.") + fail(lambda: e1.inverse, "Can not get inverse before the DG is locked.") e2 = b.addDerivation(d2) assert dg.numVertices == 2 assert dg.numEdges == 2 - fail(lambda: e2.inverse, "Can not get inverse edge before the DG is locked.") + fail(lambda: e2.inverse, "Can not get inverse before the DG is locked.") assert e1.inverse == e2 assert e2.inverse == e1 + +fail(lambda: DG.Vertex().id, "Can not get ID on a null vertex.") +fail(lambda: DG.Vertex().dg, "Can not get DG on a null vertex.") +fail(lambda: DG.Vertex().inDegree, "Can not get in-degree on a null vertex.") +fail(lambda: DG.Vertex().inEdges, "Can not get in-edges on a null vertex.") +fail(lambda: DG.Vertex().outDegree, "Can not get out-degree on a null vertex.") +fail(lambda: DG.Vertex().outEdges, "Can not get out-edges on a null vertex.") +fail(lambda: DG.Vertex().graph, "Can not get graph on a null vertex.") + +fail(lambda: DG.HyperEdge().id, "Can not get ID on a null hyperedge.") +fail(lambda: DG.HyperEdge().dg, "Can not get DG on a null hyperedge.") +fail(lambda: DG.HyperEdge().numSources, "Can not get number of sources on a null hyperedge.") +fail(lambda: DG.HyperEdge().sources, "Can not get sources on a null hyperedge.") +fail(lambda: DG.HyperEdge().numTargets, "Can not get number of targets on a null hyperedge.") +fail(lambda: DG.HyperEdge().targets, "Can not get targets on a null hyperedge.") +fail(lambda: DG.HyperEdge().rules, "Can not get rules on a null hyperedge.") +fail(lambda: DG.HyperEdge().inverse, "Can not get inverse on a null hyperedge.") +fail(lambda: DG.HyperEdge().print(), "Can not print a null hyperedge.") diff --git a/test/py/dg/010_find.py b/test/py/dg/010_find.py index 689d935..99c9840 100644 --- a/test/py/dg/010_find.py +++ b/test/py/dg/010_find.py @@ -1,7 +1,14 @@ include("xx0_helpers.py") +dgOther = DG() +dgOther.build().addAbstract("A -> B") +eOther = next(iter(dgOther.edges)) +vAOther = next(iter(eOther.sources)) +vBOther = next(iter(eOther.targets)) +assert dgOther.findEdge([vAOther], [vBOther]) == eOther + g = smiles('O') -v = DGVertex() +v = DG.Vertex() dg = DG() @@ -11,19 +18,28 @@ fail(lambda: dg.findEdge([g], [g]), msg) def active(): - assert dg.findVertex(g) == DGVertex() - fail(lambda: dg.findEdge([v], []), "Source vertex descriptor is null.") - fail(lambda: dg.findEdge([], [v]), "Target vertex descriptor is null.") - fail(lambda: dg.findEdge([g], []), "Source vertex descriptor is null.") - fail(lambda: dg.findEdge([], [g]), "Target vertex descriptor is null.") + assert dg.findVertex(g) == DG.Vertex() + assert dg.findEdge([vA], [vB]) == e + fail(lambda: dg.findEdge([v], []), "Source vertex is null.") + fail(lambda: dg.findEdge([], [v]), "Target vertex is null.") + fail(lambda: dg.findEdge([g], []), "Source vertex is null.") + fail(lambda: dg.findEdge([], [g]), "Target vertex is null.") + fail(lambda: dg.findEdge([vAOther], []), + f"Source vertex does not belong to this derivation graph: {vAOther}") + fail(lambda: dg.findEdge([], [vBOther]), + f"Target vertex does not belong to this derivation graph: {vBOther}") - fail(lambda: dg.findVertex(None), "The graph is a nullptr.") + fail(lambda: dg.findVertex(None), "The graph is a null pointer.") fail(lambda: dg.findEdge([None], [g]), "Incompatible Data Type", err=TypeError) fail(lambda: dg.findEdge([g], [None]), "Incompatible Data Type", err=TypeError) - fail(lambda: dg.findEdge([g, None], [g]), "The graph is a nullptr.") - fail(lambda: dg.findEdge([g], [g, None]), "The graph is a nullptr.") + fail(lambda: dg.findEdge([g, None], [g]), "Source graph is a null pointer.") + fail(lambda: dg.findEdge([g], [g, None]), "Target graph is a null pointer.") b = dg.build() +b.addAbstract("A -> B") +e = next(iter(dg.edges)) +vA = next(iter(e.sources)) +vB = next(iter(e.targets)) # Active builder, not locked active() diff --git a/test/py/dg/019_dump.py b/test/py/dg/019_dump.py index 330745d..8cd67cd 100644 --- a/test/py/dg/019_dump.py +++ b/test/py/dg/019_dump.py @@ -36,11 +36,11 @@ dg.build() f = dg.dump() -fail(lambda: DG.load([None], [], f), "Nullptr in graph database.") +fail(lambda: DG.load([None], [], f), "Null pointer in graph database.") fail(lambda: DG.load([g1, g2], [], CWDPath(f)), "Isomorphic graphs '{}' and '{}' in initial graph database.".format(g1.name, g2.name)) dg = DG.load([g1, g2], [], CWDPath(f), graphPolicy=IsomorphismPolicy.TrustMe) -fail(lambda: DG.load([], [None], CWDPath(f)), "Nullptr in rule database.") +fail(lambda: DG.load([], [None], CWDPath(f)), "Null pointer in rule database.") fail(lambda: DG.load([], [], 'doesNotExist.dg'), "DG load error: Could not open file", err=InputError, isSubstring=True) @@ -84,13 +84,13 @@ _compareDGs(dg, dg3) -# DGBuilder.load +# DG.Builder.load dg = DG() dg.build() f = dg.dump() -fail(lambda: DG().build().load([None], CWDPath(f)), "Nullptr in rule database.") +fail(lambda: DG().build().load([None], CWDPath(f)), "Null pointer in rule database.") fail(lambda: DG().build().load([], 'doesNotExist.dg'), "DG load error: Could not open file ", err=InputError, isSubstring=True) diff --git a/test/py/dg/050_build_addDerivation.py b/test/py/dg/050_build_addDerivation.py index 5aec6ac..55345be 100644 --- a/test/py/dg/050_build_addDerivation.py +++ b/test/py/dg/050_build_addDerivation.py @@ -68,14 +68,14 @@ def asserts(): d = Derivations() d.left = [None] d.right = [smiles("O")] -fail(lambda: DG().build().addDerivation(d), "Derivation has a nullptr in the left side: " + str(d)) +fail(lambda: DG().build().addDerivation(d), "Derivation has a null pointer in the left side: " + str(d)) d.left = [smiles("O")] d.right = [None] -fail(lambda: DG().build().addDerivation(d), "Derivation has a nullptr in the right side: " + str(d)) +fail(lambda: DG().build().addDerivation(d), "Derivation has a null pointer in the right side: " + str(d)) d.left = [smiles("O")] d.right = [smiles("O")] d.rules = [None] -fail(lambda: DG().build().addDerivation(d), "Derivation has a nullptr in the rule list: " + str(d)) +fail(lambda: DG().build().addDerivation(d), "Derivation has a null pointer in the rule list: " + str(d)) g = smiles("O") diff --git a/test/py/dg/051_build_addHyperEdge.py b/test/py/dg/051_build_addHyperEdge.py index c4b073d..768e8c5 100644 --- a/test/py/dg/051_build_addHyperEdge.py +++ b/test/py/dg/051_build_addHyperEdge.py @@ -18,7 +18,7 @@ dg2 = DG() with dg2.build() as b: - fail(lambda: b.addHyperEdge(DGHyperEdge()), "The hyperedge is null.") + fail(lambda: b.addHyperEdge(DG.HyperEdge()), "The hyperedge is null.") e2 = b.addHyperEdge(e) diff --git a/test/py/dg/100_build_execute_basic.py b/test/py/dg/100_build_execute_basic.py index 3d875d3..346f1cc 100644 --- a/test/py/dg/100_build_execute_basic.py +++ b/test/py/dg/100_build_execute_basic.py @@ -15,12 +15,15 @@ print("deprecated dgRuleComp") -dg = dgRuleComp([g1a], addSubset(g2a), - labelSettings=LabelSettings(LabelType.Term, LabelRelation.Isomorphism)) +dg = checkDeprecated(lambda: dgRuleComp([g1a], addSubset(g2a), + labelSettings=LabelSettings(LabelType.Term, LabelRelation.Isomorphism))) assert dg.labelSettings.type == LabelType.Term assert dg.labelSettings.relation == LabelRelation.Isomorphism assert dg.graphDatabase == [g1a] +old = config.common.ignoreDeprecation +config.common.ignoreDeprecation = True dg.calc(printInfo=False) +config.common.ignoreDeprecation = old assert dg.graphDatabase == [g1a, g2a] diff --git a/test/py/dg/400_printer.py b/test/py/dg/400_printer.py index ace9249..27e7f3a 100644 --- a/test/py/dg/400_printer.py +++ b/test/py/dg/400_printer.py @@ -1,18 +1,22 @@ include("../xxx_helpers.py") -p = DGPrinter() -assert type(p.graphPrinter) == GraphPrinter +# nested GraphPrinter +assert type(DGPrinter().graphPrinter) == GraphPrinter gp = GraphPrinter() gp.enableAll() gp.withIndex = False -assert p.graphPrinter == gp +assert DGPrinter().graphPrinter == gp +# check that assignment is a true copy gp = GraphPrinter() assert not gp.withIndex +p = DGPrinter() p.graphPrinter = gp gp.withIndex = True assert gp.withIndex assert not p.graphPrinter.withIndex +# And now the rest of the DGPrinter + p = DGPrinter() assert p.withShortcutEdges assert p.withGraphImages diff --git a/test/py/dg/410_printData.py b/test/py/dg/410_printData.py index 0272afa..9266596 100644 --- a/test/py/dg/410_printData.py +++ b/test/py/dg/410_printData.py @@ -19,21 +19,21 @@ d = DGPrintData(dg) assert d.dg == dg -fail(lambda: d.makeDuplicate(DGHyperEdge(), 1), "The hyperedge is null.") +fail(lambda: d.makeDuplicate(DG.HyperEdge(), 1), "The hyperedge is null.") fail(lambda: d.makeDuplicate(eOther, 1), "The hyperedge does not belong to the derivation graph this data is for.") fail(lambda: d.makeDuplicate(e, 0), "Duplicate already exists.") -fail(lambda: d.removeDuplicate(DGHyperEdge(), 1), "The hyperedge is null.") +fail(lambda: d.removeDuplicate(DG.HyperEdge(), 1), "The hyperedge is null.") fail(lambda: d.removeDuplicate(eOther, 1), "The hyperedge does not belong to the derivation graph this data is for.") fail(lambda: d.removeDuplicate(e, 42), "Duplicate does not exist.") -fail(lambda: d.reconnectSource(DGHyperEdge(), 0, vTail, 0), +fail(lambda: d.reconnectSource(DG.HyperEdge(), 0, vTail, 0), "The hyperedge is null.") fail(lambda: d.reconnectSource(eOther, 0, vTail, 0), "The hyperedge does not belong to the derivation graph this data is for.") -fail(lambda: d.reconnectSource(e, 0, DGVertex(), 0), +fail(lambda: d.reconnectSource(e, 0, DG.Vertex(), 0), "The vertex is null.") fail(lambda: d.reconnectSource(e, 0, vOther, 0), "The vertex does not belong to the derivation graph this data is for.") @@ -42,11 +42,11 @@ fail(lambda: d.reconnectSource(e, 42, vTail, 42), "Hyperedge duplicate does not exist.") -fail(lambda: d.reconnectTarget(DGHyperEdge(), 0, vHead, 0), +fail(lambda: d.reconnectTarget(DG.HyperEdge(), 0, vHead, 0), "The hyperedge is null.") fail(lambda: d.reconnectTarget(eOther, 0, vHead, 0), "The hyperedge does not belong to the derivation graph this data is for.") -fail(lambda: d.reconnectTarget(e, 0, DGVertex(), 0), +fail(lambda: d.reconnectTarget(e, 0, DG.Vertex(), 0), "The vertex is null.") fail(lambda: d.reconnectTarget(e, 0, vOther, 0), "The vertex does not belong to the derivation graph this data is for.") diff --git a/test/py/dg/450_print_dpo_fail.py b/test/py/dg/450_print_dpo_fail.py index b6da175..53e0066 100644 --- a/test/py/dg/450_print_dpo_fail.py +++ b/test/py/dg/450_print_dpo_fail.py @@ -1,12 +1,12 @@ include("../xxx_helpers.py") -e = DGHyperEdge() -fail(lambda: e.print(), "Can not print null edge.") +e = DG.HyperEdge() +fail(lambda: e.print(), "Can not print a null hyperedge.") dg = DG() dg.build().addAbstract("A -> B") e = next(iter(dg.edges)) -fail(lambda: e.print(), "The edge has no rules.") +fail(lambda: e.print(), "The hyperedge has no rules.") r = ruleGMLString("""rule [ left [ node [ id 1 label "B" ] ] diff --git a/test/py/dg/600_vertexMap_basic.py b/test/py/dg/600_vertexMap_basic.py index ee760f1..a15d4bd 100644 --- a/test/py/dg/600_vertexMap_basic.py +++ b/test/py/dg/600_vertexMap_basic.py @@ -1,6 +1,6 @@ include("../xxx_helpers.py") -fail(lambda: DGVertexMapper(DGHyperEdge()), +fail(lambda: DGVertexMapper(DG.HyperEdge()), "Can not find vertex maps for null edge.") O = smiles("[O]", name="O") diff --git a/test/py/dg/900_dgDerivations.py b/test/py/dg/900_dgDerivations.py index 0cd012c..680ef70 100644 --- a/test/py/dg/900_dgDerivations.py +++ b/test/py/dg/900_dgDerivations.py @@ -18,7 +18,7 @@ def check(rs): d.rule = r d.right = [g3, g4] ders.append(d) - dg = dgDerivations(ders) + dg = checkDeprecated(lambda: dgDerivations(ders)) assert dg.numVertices == 4 assert sorted((v.graph for v in dg.vertices)) == sorted(([g1, g2, g3, g4])) assert dg.numEdges == 1 diff --git a/test/py/dg/old/dgDiff.py b/test/py/dg/old/dgDiff.py index fb078d2..402a199 100644 --- a/test/py/dg/old/dgDiff.py +++ b/test/py/dg/old/dgDiff.py @@ -19,16 +19,22 @@ def makeDer(left, rule, right): r4 = makeRule("r4") print("DG1") -dg1 = dgDerivations([ - makeDer([a], r1, [b]), - makeDer([a], r2, [b]), - makeDer([a, a], r1, [b]), -]) +dg1 = DG() +with dg1.build() as builder: + for d in [ + makeDer([a], r1, [b]), + makeDer([a], r2, [b]), + makeDer([a, a], r1, [b]), + ]: + builder.addDerivation(d) print("DG2") -dg2 = dgDerivations([ - makeDer([a, a], r2, [b]), - makeDer([a], r1, [b]), -]) +dg2 = DG() +with dg2.build() as builder: + for d in [ + makeDer([a, a], r2, [b]), + makeDer([a], r1, [b]), + ]: + builder.addDerivation(d) diffDGs(dg1, dg2) dg1.print() dg2.print() diff --git a/test/py/function.py b/test/py/function.py index 4dcb3b5..cf66a96 100644 --- a/test/py/function.py +++ b/test/py/function.py @@ -1,7 +1,7 @@ include("formoseCommon/grammar.py") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules[0] >> inputRules[2]) -dg.calc() +dg = DG(graphDatabase=inputGraphs) +dg.build().execute(addSubset(inputGraphs) >> inputRules[0] >> inputRules[2]) printer = DGPrinter() post.summarySection("Const False") @@ -14,7 +14,7 @@ printer.popVertexVisible() post.summarySection("Func") -def f(g, dg): return all(g != a for a in inputGraphs) +def f(v): return all(v.graph != a for a in inputGraphs) printer.pushVertexVisible(f) dg.print(printer) printer.popVertexVisible() @@ -24,6 +24,6 @@ def f(g, dg): return all(g != a for a in inputGraphs) printer.popVertexVisible() post.summarySection("Lambda") -printer.pushVertexVisible(lambda g, dg: all(g != a for a in inputGraphs)) +printer.pushVertexVisible(lambda v: all(v.graph != a for a in inputGraphs)) dg.print(printer) printer.popVertexVisible() diff --git a/test/py/graph/850_annotated.py b/test/py/graph/850_annotated.py new file mode 100644 index 0000000..ee857d6 --- /dev/null +++ b/test/py/graph/850_annotated.py @@ -0,0 +1,20 @@ +g = Graph.fromSMILES("OCC(=O)C(N)C(=N)C(S)C(=S)") + +p = GraphPrinter() +p.setMolDefault() +fs = g.print(p) +fTex = fs[0][:-3] + "tex" + +post.summarySection("Annotated") +post.summaryInput(fTex) +s = "\\begin{tikzpicture}[remember picture, overlay]\n" +def makeTikzID(v): + return f"\\modIdPrefix v-{v.id}" +for v in g.vertices: + # we are hiding the hydrogens, so don't annotate those + if v.atomId == AtomIds.H and v.charge == 0: + continue + s += f"\\draw[color=red] ({makeTikzID(v)}) circle (1em);\n" + s += f"\\node[at=({makeTikzID(v)}.south east), anchor=north west, inner sep=0] {{\\tiny $\\delta 2.1$}};\n" +s += "\\end{tikzpicture}\n" +post.summaryRaw(s) diff --git a/test/py/makeReactionSmiles.py b/test/py/makeReactionSmiles.py new file mode 100644 index 0000000..d63ef11 --- /dev/null +++ b/test/py/makeReactionSmiles.py @@ -0,0 +1,48 @@ +def getReactionSmiles(dg): + origSmiles = {} + # change the class labels for every atom + for v in dg.vertices: + s = v.graph.smilesWithIds + s = s.replace(":", ":o") + origSmiles[v.graph] = s + + + res = {} + for e in dg.edges: + maps = DGVertexMapper(e) + + # replace the original local IDs with global IDs + eductSmiles = [origSmiles[g] for g in maps.left] + for v in maps.left.vertices: + s = eductSmiles[v.graphIndex] + s = s.replace(":o%d]" % v.vertex.id, ":%d]" % v.id) + eductSmiles[v.graphIndex] = s + + strs = set() + for r in maps: + m = r.map + productSmiles = [origSmiles[g] for g in maps.right] + for vLeft in maps.left.vertices: + vRight = m[vLeft] + s = productSmiles[vRight.graphIndex] + s = s.replace(":o%d]" % vRight.vertex.id, ":%d]" % vRight.id) + productSmiles[vRight.graphIndex] = s + left = ".".join(eductSmiles) + right = ".".join(productSmiles) + s = "%s>>%s" % (left, right) + assert ":o" not in s + strs.add(s) + res[e] = list(sorted(strs)) + return res + +include("formoseCommon/grammar.py") + +dg = DG(graphDatabase=inputGraphs) +dg.build().execute(addSubset(inputGraphs) >> inputRules >> inputRules) +dg.print() + +res = getReactionSmiles(dg) +for e in dg.edges: + print(e) + for s in res[e]: + print("\t", s) diff --git a/test/py/matchConstraints/adjacency/90_term_conversion.py b/test/py/matchConstraints/adjacency/90_term_conversion.py new file mode 100644 index 0000000..16bf430 --- /dev/null +++ b/test/py/matchConstraints/adjacency/90_term_conversion.py @@ -0,0 +1,48 @@ +ls = LabelSettings(LabelType.Term, LabelRelation.Specialisation) +rId = Rule.fromGMLString("""rule [ + context [ + node [ id 0 label "C" ] + ] + right [ + node [ id 1 label "R" ] + edge [ source 0 target 1 label "-" ] + ] +]""") +rIdInv = rId.makeInverse() +rStr = """rule [ + context [ + node [ id 0 label "C" ] + node [ id 1 label "Q" ] + edge [ source 0 target 1 label "-" ] + ] + constrainAdj [ + id 1 + nodeLabels [ label "a" label "_x" label "b(c)" label "d(_y)" ] + edgeLabels [ label "g" label "_p" label "h(i)" label "j(_q)" ] + op "=" count 1 + ] +]""" +a = Rule.fromGMLString(rStr) +post.summaryChapter("TermState") +a.printTermState() +#b = a.makeInverse() + +post.summaryChapter("Compose first") +rc = rcEvaluator([], ls) +res = rc.eval(a *rcSuper* rId) +for b in res: + b.print() + b.printTermState() + +post.summaryChapter("Compose second") +rc = rcEvaluator([], ls) +res = rc.eval(rIdInv *rcSub* a) +for b in res: + b.print() + b.printTermState() + +post.summaryChapter("DGRuleComp") +Graph.fromDFS("C[Q]") +dg = DG(labelSettings=ls) +dg.build().execute(addSubset(inputGraphs) >> a) +dg.print() diff --git a/test/py/matchConstraints/labelAny.py b/test/py/matchConstraints/labelAny.py index 9e7ab70..3ec71c3 100644 --- a/test/py/matchConstraints/labelAny.py +++ b/test/py/matchConstraints/labelAny.py @@ -18,6 +18,6 @@ a.print() a.printTermState() print(a.getGMLString()) -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation)) -dg.calc() +dg = DG(graphDatabase=inputGraphs, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation)) +dg.build().execute(addSubset(inputGraphs) >> inputRules) dg.print() diff --git a/test/py/matchConstraints/shortestPath.py b/test/py/matchConstraints/shortestPath.py index fbdbf9b..2006b21 100644 --- a/test/py/matchConstraints/shortestPath.py +++ b/test/py/matchConstraints/shortestPath.py @@ -41,11 +41,11 @@ ruleGMLString(ruleTemplate % ("Geq2", "geq2", ">=", "2")) length1 = graphGMLString('graph [ %s edge [ source 0 target 3 label "-" ] ]' % graphCommon) length3 = graphGMLString('graph [ %s ]' % graphCommon) -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=lString) -dg.calc() +dg = DG(graphDatabase=inputGraphs, labelSettings=lString) +dg.build().execute(addSubset(inputGraphs) >> inputRules) dg.print() -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=lTerm) -dg.calc() +dg = DG(graphDatabase=inputGraphs, labelSettings=lString) +dg.build().execute(addSubset(inputGraphs) >> inputRules) dg.print() diff --git a/test/py/papers/17_tetra_icgt/code/310_stereoDpo.py b/test/py/papers/17_tetra_icgt/code/310_stereoDpo.py index 539b3c5..ce04cab 100644 --- a/test/py/papers/17_tetra_icgt/code/310_stereoDpo.py +++ b/test/py/papers/17_tetra_icgt/code/310_stereoDpo.py @@ -15,7 +15,7 @@ ]""") g = smiles("[C@](C)(P)(S)(O)") -dg = dgRuleComp(inputGraphs, addSubset(g) >> r, +dg = DG(graphDatabase=inputGraphs, # seldctino of attributes and morphisms for matching labelSettings=LabelSettings( # use terms as labels, instead of strings @@ -26,7 +26,7 @@ # with specialisation in the morphisms LabelRelation.Specialisation) ) -dg.calc() +dg.build().execute(addSubset(g) >> r) # print DPO digram with special settings p = GraphPrinter() p.setReactionDefault() diff --git a/test/py/papers/17_tetra_icgt/code/320_aconitase.py b/test/py/papers/17_tetra_icgt/code/320_aconitase.py index e6dc7cf..588af83 100644 --- a/test/py/papers/17_tetra_icgt/code/320_aconitase.py +++ b/test/py/papers/17_tetra_icgt/code/320_aconitase.py @@ -39,7 +39,7 @@ ] ]""") -dg = dgRuleComp(inputGraphs, addSubset(cit, water) >> aconitase, +dg = DG(graphDatabase=inputGraphs, # seldctino of attributes and morphisms for matching labelSettings=LabelSettings( # use terms as labels, instead of strings @@ -50,7 +50,7 @@ # with specialisation in the morphisms LabelRelation.Specialisation) ) -dg.calc() +dg.build().execute(addSubset(cit, water) >> aconitase) for e in dg.edges: p = GraphPrinter() p.withColour = True diff --git a/test/py/papers/17_tetra_icgt/code/330_tartaric.py b/test/py/papers/17_tetra_icgt/code/330_tartaric.py index 9ab86d2..ce0976c 100644 --- a/test/py/papers/17_tetra_icgt/code/330_tartaric.py +++ b/test/py/papers/17_tetra_icgt/code/330_tartaric.py @@ -13,7 +13,7 @@ right [ node [ id 0 stereo "tetrahedral[1, 2, 3, 4]!" ] ] ]""") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> repeat(change), +dg = DG(graphDatabase=inputGraphs, # seldctino of attributes and morphisms for matching labelSettings=LabelSettings( # use terms as labels, instead of strings @@ -24,7 +24,7 @@ # with specialisation in the morphisms LabelRelation.Specialisation) ) -dg.calc() +dg.build().execute(addSubset(inputGraphs) >> repeat(change)) p = GraphPrinter() p.setMolDefault() diff --git a/test/py/papers/17_tetra_icgt/code/340_tree.py b/test/py/papers/17_tetra_icgt/code/340_tree.py index 69d5ea1..e8f9fcd 100644 --- a/test/py/papers/17_tetra_icgt/code/340_tree.py +++ b/test/py/papers/17_tetra_icgt/code/340_tree.py @@ -10,7 +10,7 @@ right [ node [ id 0 stereo "tetrahedral[1, 2, 3, 4]!" ] ] ]""") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> repeat(change), +dg = DG(graphDatabase=inputGraphs, # seldctino of attributes and morphisms for matching labelSettings=LabelSettings( # use terms as labels, instead of strings @@ -21,7 +21,7 @@ # with specialisation in the morphisms LabelRelation.Specialisation) ) -dg.calc() +dg.build().execute(addSubset(inputGraphs) >> repeat(change)) p = GraphPrinter() p.setMolDefault() diff --git a/test/py/papers/17_tetra_icgt/figures/tartaric/doIt.py b/test/py/papers/17_tetra_icgt/figures/tartaric/doIt.py index fa94d71..5c22e12 100644 --- a/test/py/papers/17_tetra_icgt/figures/tartaric/doIt.py +++ b/test/py/papers/17_tetra_icgt/figures/tartaric/doIt.py @@ -4,9 +4,9 @@ smiles("[C@@H]([C@H](C(=O)O)O)(C(=O)O)O", name="L-tartaric acid") smiles("[C@H]([C@@H](C(=O)O)O)(C(=O)O)O", name="D-tartaric acid") smiles("[C@@H]([C@@H](C(=O)O)O)(C(=O)O)O", name="Meso-tartaric acid") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> repeat(inputRules), +dg = DG(graphDatabase=inputGraphs, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation, LabelRelation.Specialisation)) -dg.calc() +dg.build().execute(addSubset(inputGraphs) >> repeat(inputRules)) p = DGPrinter() p.withRuleName = True p.withRuleId = False diff --git a/test/py/papers/17_tetra_icgt/figures/tree/doIt.py b/test/py/papers/17_tetra_icgt/figures/tree/doIt.py index f434e49..97d6a18 100644 --- a/test/py/papers/17_tetra_icgt/figures/tree/doIt.py +++ b/test/py/papers/17_tetra_icgt/figures/tree/doIt.py @@ -4,9 +4,9 @@ #g = smiles("N[C@](O)([C@](S)(P)(O))([C@](S)(P)(O))") g = smiles("[N][C@]([O])([C@]([S])([P])([O]))([C@]([S])([P])([O]))") -dg = dgRuleComp(inputGraphs, addSubset(g) >> repeat(change), +dg = DG(graphDatabase=inputGraphs, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Specialisation, LabelRelation.Specialisation)) -dg.calc() +dg.build().execute(addSubset(g) >> repeat(change)) p = DGPrinter() p.withRuleName = True p.withRuleId = False diff --git a/test/py/post.py b/test/py/post.py index 0402b87..ad7dbed 100644 --- a/test/py/post.py +++ b/test/py/post.py @@ -3,7 +3,6 @@ assert type(makeUniqueFilePrefix()) == str post.command("echo hello") -checkDeprecated(lambda: post("echo hello")) post.flushCommands() checkDeprecated(lambda: postFlush()) diff --git a/test/py/pppCommon/dgStrict.py b/test/py/pppCommon/dgStrict.py index 9e04bc9..31574c2 100644 --- a/test/py/pppCommon/dgStrict.py +++ b/test/py/pppCommon/dgStrict.py @@ -6,5 +6,5 @@ transAldo >> transKeto, aldoKetoB >> aldolase >> phosphohydro ]) -dg = dgRuleComp(inputGraphs, strat) -dg.calc() +dg = DG(graphDatabase=inputGraphs) +dg.build().execute(strat) diff --git a/test/py/reactionSmilesMake.py b/test/py/reactionSmilesMake.py new file mode 100644 index 0000000..0384a7c --- /dev/null +++ b/test/py/reactionSmilesMake.py @@ -0,0 +1,44 @@ +def getReactionSmiles(dg): + origSmiles = {} + for v in dg.vertices: + s = v.graph.smilesWithIds + s = s.replace(":", ":o") + origSmiles[v.graph] = s + + res = {} + for e in dg.edges: + vms = DGVertexMapper(e) + eductSmiles = [origSmiles[g] for g in vms.left] + + for ev in vms.left.vertices: + s = eductSmiles[ev.graphIndex] + s = s.replace(f":o{ev.vertex.id}]", f":{ev.id}]") + eductSmiles[ev.graphIndex] = s + + strs = set() + for vm in DGVertexMapper(e): + productSmiles = [origSmiles[g] for g in vms.right] + for ev in vms.left.vertices: + pv = vm.map[ev] + s = productSmiles[pv.graphIndex] + s = s.replace(f":o{pv.vertex.id}]", f":{ev.id}]") + productSmiles[pv.graphIndex] = s + left = ".".join(eductSmiles) + right = ".".join(productSmiles) + s = f"{left}>>{right}" + assert ":o" not in s + strs.add(s) + res[e] = list(sorted(strs)) + return res + +include("formoseCommon/grammar.py") + +dg = DG(graphDatabase=inputGraphs) +dg.build().execute(addSubset(inputGraphs) >> inputRules >> inputRules) +dg.print() + +res = getReactionSmiles(dg) +for e in dg.edges: + print(e) + for s in res[e]: + print("\t", s) diff --git a/test/py/parseReactionSmiles.py b/test/py/reactionSmilesParse.py similarity index 93% rename from test/py/parseReactionSmiles.py rename to test/py/reactionSmilesParse.py index ca4e15b..2d1b51f 100644 --- a/test/py/parseReactionSmiles.py +++ b/test/py/reactionSmilesParse.py @@ -1,5 +1,4 @@ -# type: str -> Rule -def makeReactionSmiles(line): +def parseReactionSmiles(line: str) -> Rule: sLeft, sRight = line.split(">>") ssLeft = sLeft.split(".") ssRight = sRight.split(".") @@ -25,7 +24,7 @@ def printGraph(g): for m in mRight: s += printGraph(m) s += "\t]\n]\n" - return ruleGMLString(s, add=False) + return Rule.fromGMLString(s, add=False) strs = [ @@ -34,7 +33,7 @@ def printGraph(g): "[C:1]1([C:2]([H:10])=[C:3]([C:4]([O:5][C-:6]([H:14])[H:13])=[C:7]([C:0]=1[H:8])[H:12])[H:11])[H:9]>>[C:3]1([C-:4]=[C:7]([C:0]([H:8])=[C:1]([C:2]=1[H:10])[H:9])[H:12])[H:11].[C:6]([H:13])([H:14])=[O:5]", ] for s in strs: - r = makeReactionSmiles(s) + r = parseReactionSmiles(s) p = GraphPrinter() p.setReactionDefault() p.withIndex = True diff --git a/test/py/rule/520_inverse.py b/test/py/rule/520_inverse.py index c4895c8..cfba44d 100644 --- a/test/py/rule/520_inverse.py +++ b/test/py/rule/520_inverse.py @@ -87,4 +87,4 @@ def check(s1, s2): ]""" r = Rule.fromGMLString(data) fail(lambda: Rule.fromGMLString(data, invert=True), err=InputError, - pattern="has matching constraints and can not be reversed. Use Rule::ignoreConstraintsDuringInversion == true to strip constraints.") + pattern="has matching constraints and can not be reversed. Use config.rule.ignoreConstraintsDuringInversion == True to strip constraints.") diff --git a/test/py/term/makeVars.py b/test/py/term/makeVars.py index ad89c3d..069cacb 100644 --- a/test/py/term/makeVars.py +++ b/test/py/term/makeVars.py @@ -26,8 +26,8 @@ ]""") -dg = dgRuleComp(inputGraphs, addSubset(inputGraphs) >> inputRules, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Unification)) -dg.calc() +dg = DG(graphDatabase=inputGraphs, labelSettings=LabelSettings(LabelType.Term, LabelRelation.Unification)) +dg.build().execute(addSubset(inputGraphs) >> inputRules) dg.print() post.summarySection("Input Graphs") for a in inputGraphs: diff --git a/test/py/xxx_graphInterface.py b/test/py/xxx_graphInterface.py index 79234bc..14df083 100644 --- a/test/py/xxx_graphInterface.py +++ b/test/py/xxx_graphInterface.py @@ -24,7 +24,7 @@ def checkGraph(g, *, string: str, vertexString: str, edgeString: str, assert type(vNull.__hash__()) == int assert not vNull assert vNull.isNull() - fail(lambda: vNull.id, "Can not get id on a null vertex.") + fail(lambda: vNull.id, "Can not get ID on a null vertex.") fail(lambda: vNull.graph, "Can not get graph on a null vertex.") fail(lambda: vNull.degree, "Can not get degree on a null vertex.") fail(lambda: vNull.incidentEdges, "Can not get incident edges on a null vertex.") From c80709abc3831c1f86068c265fb0262df776fb69 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 17 Jun 2024 20:04:44 +0200 Subject: [PATCH 13/14] Set release date --- ChangeLog.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog.rst b/ChangeLog.rst index 532317f..f671110 100644 --- a/ChangeLog.rst +++ b/ChangeLog.rst @@ -5,8 +5,8 @@ Changes ####### -develop -======= +v0.16.0 (2024-06-18) +==================== Incompatible Changes -------------------- From c793b3c3829cd73389dbf78b3133701ba72129af Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Mon, 17 Jun 2024 20:57:32 +0200 Subject: [PATCH 14/14] [conda] Update Miniconda version for build --- conda/build.Dockerfile | 9 +++++---- docker/Conda.Dockerfile | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/conda/build.Dockerfile b/conda/build.Dockerfile index c08c7c3..f6718c3 100644 --- a/conda/build.Dockerfile +++ b/conda/build.Dockerfile @@ -10,10 +10,10 @@ ENV PATH /opt/conda/bin:$PATH RUN apt-get update --fix-missing \ && apt-get install -y wget bzip2 ca-certificates curl git -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh -O ~/miniconda.sh && \ +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -O ~/miniconda.sh && \ /bin/bash ~/miniconda.sh -b -p /opt/conda && \ rm ~/miniconda.sh && \ - /opt/conda/bin/conda clean -tipsy && \ + /opt/conda/bin/conda clean -afy && \ ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ echo "conda activate base" >> ~/.bashrc @@ -46,6 +46,7 @@ RUN echo "END CONDA BUILD" RUN echo "START INSTALLATION TEST" FROM ubuntu:20.04 AS test +ARG MinicondaURL # Based on continuumio/miniconda3 #ENV LANG=C.UTF-8 LC_ALL=C.UTF-8 @@ -54,10 +55,10 @@ ENV PATH /opt/conda/bin:$PATH RUN apt-get update --fix-missing \ && apt-get install -y wget bzip2 ca-certificates curl git -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-4.5.11-Linux-x86_64.sh -O ~/miniconda.sh && \ +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -O ~/miniconda.sh && \ /bin/bash ~/miniconda.sh -b -p /opt/conda && \ rm ~/miniconda.sh && \ - /opt/conda/bin/conda clean -tipsy && \ + /opt/conda/bin/conda clean -afy && \ ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc && \ echo "conda activate base" >> ~/.bashrc diff --git a/docker/Conda.Dockerfile b/docker/Conda.Dockerfile index c9c84ca..b95b2ba 100644 --- a/docker/Conda.Dockerfile +++ b/docker/Conda.Dockerfile @@ -8,10 +8,10 @@ ENV PATH /opt/conda/bin:$PATH RUN apt-get update --fix-missing \ && apt-get install -y wget bzip2 ca-certificates curl git -RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_4.12.0-Linux-x86_64.sh -O ~/miniconda.sh && \ +RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-py38_23.11.0-2-Linux-x86_64.sh -O ~/miniconda.sh && \ /bin/bash ~/miniconda.sh -b -p /opt/conda && \ rm ~/miniconda.sh && \ - /opt/conda/bin/conda clean -tipsy && \ + /opt/conda/bin/conda clean -afy && \ ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh && \ echo ". /opt/conda/etc/profile.d/conda.sh" >> ~/.bashrc