Skip to content

Commit

Permalink
[ck2yaml] Fix species count printed in output summary
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Dec 7, 2023
1 parent 884cc9f commit 8563be1
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions interfaces/cython/cantera/ck2yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -2105,10 +2105,14 @@ def convert_mech(input_file, thermo_file=None, transport_file=None,
# Write output file
surface_names = parser.write_yaml(name=phase_name, out_name=out_name)
if not quiet:
nReactions = len(parser.reactions) + sum(len(surf.reactions) for surf in parser.surfaces)
logger.info('Wrote YAML mechanism file to {0!r}.'.format(out_name))
logger.info('Mechanism contains {0} species and {1} reactions.'.format(
len(parser.species_list), nReactions))
nSpecies = len(parser.species_list)
nReactions = len(parser.reactions)
for surf in parser.surfaces:
nSpecies += len(surf.species_list)
nReactions += len(surf.reactions)
logger.info(f'Wrote YAML mechanism file to {out_name!r}.')
logger.info(f'Mechanism contains {nSpecies} species and {nReactions} '
'reactions.')
return parser, surface_names

def show_duplicate_reactions(self, error_message):
Expand Down

0 comments on commit 8563be1

Please sign in to comment.