From 1af54132b86c9a66ee5876e9fd9d733d2ec64e77 Mon Sep 17 00:00:00 2001 From: Emily Boudreaux Date: Fri, 31 Oct 2025 07:08:54 -0400 Subject: [PATCH] fix(construction): added reaclib_reaction_is_weak call previously I had neglected to actually call the heuristic removing weak reaclib reactions. This is now called properly. Therefore it is this commit which actually prevents weak reaclib reactions from getting registered --- src/lib/engine/procedures/construction.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lib/engine/procedures/construction.cpp b/src/lib/engine/procedures/construction.cpp index 6aae513b..dfabe8c1 100644 --- a/src/lib/engine/procedures/construction.cpp +++ b/src/lib/engine/procedures/construction.cpp @@ -18,9 +18,10 @@ #include "quill/Logger.h" #include "quill/LogMacros.h" namespace { + // Simple heuristic to check if a reaclib reaction is a strong or weak reaction bool reaclib_reaction_is_weak(const gridfire::reaction::Reaction& reaction) { - std::vector reactants = reaction.reactants(); - std::vector products = reaction.products(); + const std::vector& reactants = reaction.reactants(); + const std::vector& products = reaction.products(); if (reactants.size() != products.size()) { return false; @@ -69,7 +70,7 @@ namespace gridfire { // Clone all relevant REACLIB reactions into the master pool const auto& allReaclibReactions = reaclib::get_all_reaclib_reactions(); for (const auto& reaction : allReaclibReactions) { - if (reaction->is_reverse() == reverse) { // Only add reactions of the correct direction and which are not weak. Weak reactions are handled from the WRL separately which provides much higher quality weak reactions than reaclib does + if (reaction->is_reverse() == reverse && !reaclib_reaction_is_weak(*reaction)) { // Only add reactions of the correct direction and which are not weak. Weak reactions are handled from the WRL separately which provides much higher quality weak reactions than reaclib does master_reaction_pool.add_reaction(reaction->clone()); } }