From b300c096962137810e0bd51c6ac7f604c2249823 Mon Sep 17 00:00:00 2001 From: Alon Grinberg Dana Date: Wed, 7 Feb 2024 12:57:15 +0200 Subject: [PATCH] Added the maximumFusedRings species constraint --- rmgpy/constraints.py | 5 +++++ rmgpy/rmg/input.py | 1 + 2 files changed, 6 insertions(+) diff --git a/rmgpy/constraints.py b/rmgpy/constraints.py index be7f950f4ce..2f2aa56c5ea 100644 --- a/rmgpy/constraints.py +++ b/rmgpy/constraints.py @@ -141,4 +141,9 @@ def fails_species_constraints(species): if struct.get_singlet_carbene_count() > 0 and struct.get_radical_count() > max_carbene_radicals: return True + max_fused_rings = species_constraints.get('maximumFusedRings', -1) + if max_fused_rings != -1 and struct.is_cyclic(): + if struct.get_ring_count_in_largest_fused_ring_system() > max_fused_rings: + return True + return False diff --git a/rmgpy/rmg/input.py b/rmgpy/rmg/input.py index e04cd82e2ed..bf450f90b35 100644 --- a/rmgpy/rmg/input.py +++ b/rmgpy/rmg/input.py @@ -1379,6 +1379,7 @@ def generated_species_constraints(**kwargs): 'maximumRadicalElectrons', 'maximumSingletCarbenes', 'maximumCarbeneRadicals', + 'maximumFusedRings', 'allowSingletO2', 'speciesCuttingThreshold', ]