Skip to content

Commit 9f3ecba

Browse files
committed
Added a validator to schema checking for an inert species
when running RMG with PDep
1 parent b036d5e commit 9f3ecba

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

t3/schema.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,19 @@ def check_qm(cls, value):
585585
"""InputBase.qm validator"""
586586
return value or dict()
587587

588+
@validator('rmg', always=True)
589+
def check_rmg(cls, value):
590+
"""InputBase.rmg validator"""
591+
# Check the presence of at least one inert gas if PDep is requested
592+
if value.species and value.pdep and value.pdep.method:
593+
for species in value.species:
594+
if not species.reactive:
595+
break
596+
else:
597+
raise ValueError(f'Pressure Dependence calculations require at least one inert (non-reacting) '
598+
f'species for the bath gas.')
599+
return value
600+
588601
@root_validator(pre=True)
589602
def validate_rmg_t3(cls, values):
590603
"""InputBase.validate_rmg_t3"""

0 commit comments

Comments
 (0)