Skip to content

Commit 78dd1ba

Browse files
committed
Added the maximumFusedRings species constraint
1 parent 56667ac commit 78dd1ba

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

rmgpy/constraints.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,4 +143,9 @@ def fails_species_constraints(species):
143143
if struct.get_singlet_carbene_count() > 0 and struct.get_radical_count() > max_carbene_radicals:
144144
return f"Exceeded maximumCarbeneRadicals: {struct.get_radical_count()} > {max_carbene_radicals}"
145145

146+
max_fused_rings = species_constraints.get('maximumFusedRings', -1)
147+
if max_fused_rings != -1 and struct.is_cyclic():
148+
if struct.get_ring_count_in_largest_fused_ring_system() > max_fused_rings:
149+
return True
150+
146151
return False

rmgpy/rmg/input.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,7 @@ def generated_species_constraints(**kwargs):
14151415
'maximumRadicalElectrons',
14161416
'maximumSingletCarbenes',
14171417
'maximumCarbeneRadicals',
1418+
'maximumFusedRings',
14181419
'allowSingletO2',
14191420
'speciesCuttingThreshold',
14201421
]

0 commit comments

Comments
 (0)