Skip to content

Commit b036d5e

Browse files
committed
BugFix: In schema check_pdep_only_if_gas_phase(), reactor is an object
not a dict. Note that it is a dict under `check_species_and_reactors()` which is a root_validator, on line 503. Cofusing, but crashes otherwise
1 parent f44de87 commit b036d5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

t3/schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,13 +489,14 @@ def check_model(cls, value):
489489
def check_pdep_only_if_gas_phase(cls, value, values):
490490
"""RMG.pdep validator"""
491491
if value is not None and values['reactors'] is not None:
492-
reactor_types = set([reactor['type'] for reactor in values['reactors']])
492+
reactor_types = set([reactor.type for reactor in values['reactors']])
493493
if value is not None and not any(['gas' in reactor for reactor in reactor_types]):
494494
raise ValueError(f'A pdep section can only be specified for gas phase reactors, got: {reactor_types}')
495495
return value
496496

497497
@root_validator(pre=True)
498498
def check_species_and_reactors(cls, values):
499+
"""Check species and reactors"""
499500
if 'reactors' in values and values['reactors'] is not None \
500501
and 'species' in values and values['species'] is not None:
501502
# check species attributes (balance, solvation) make sense

0 commit comments

Comments
 (0)